Skip to content

Commit

Permalink
cleanup Hubitat apps & drivers
Browse files Browse the repository at this point in the history
  • Loading branch information
heythisisnate committed Feb 3, 2019
1 parent 9d552e5 commit 8c44e83
Show file tree
Hide file tree
Showing 14 changed files with 27 additions and 193 deletions.
2 changes: 1 addition & 1 deletion hubitat/apps/konnected-connect.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* for the specific language governing permissions and limitations under the License.
*
*/
public static String version() { return "2.2.3" }
public static String version() { return "2.2.6" }

definition(
name: "Konnected (Connect)",
Expand Down
52 changes: 26 additions & 26 deletions hubitat/apps/konnected-service-manager.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* for the specific language governing permissions and limitations under the License.
*
*/
public static String version() { return "2.2.3" }
public static String version() { return "2.2.6" }

definition(
name: "Konnected Service Manager",
Expand All @@ -37,7 +37,8 @@ mappings {
preferences {
page(name: "pageWelcome", install: false, uninstall: true, content: "pageWelcome", nextPage: "pageConfiguration")
page(name: "pageDiscovery", install: false, content: "pageDiscovery" )
page(name: "pageConfiguration", install: true, content: "pageConfiguration")
page(name: "pageConfiguration")
page(name: "pageSelectHwType")
}

def installed() {
Expand Down Expand Up @@ -111,7 +112,7 @@ def pageWelcome() {
} else {
href(
name: "discovery",
title: "Tap here to start discovery",
title: "Click here to start discovery",
page: "pageDiscovery"
)
}
Expand All @@ -121,7 +122,7 @@ def pageWelcome() {
href(
name: "pageWelcomeManual",
title: "Instructions & Knowledge Base",
description: "Tap to view the support portal at help.konnected.io",
description: "View the support portal at help.konnected.io",
required: false,
image: "https://raw.githubusercontent.com/konnected-io/docs/master/assets/images/manual-icon.png",
url: "https://help.konnected.io"
Expand All @@ -147,7 +148,7 @@ def pageDiscovery() {
href(
name: "discoveryComplete",
title: "Found konnected-" + state.device.mac[-6..-1] + "!",
description: "Tap to continue",
description: "Click here to continue",
page: "pageConfiguration"
)
}
Expand All @@ -161,37 +162,30 @@ def pageDiscovery() {

// Page : 3 : Configure things wired to the Konnected board
def pageConfiguration(params) {
def setHwType = params?.hwType
if (setHwType) { state.hwType = setHwType }
state.hwType ? pageAssignPins() : pageSelectHwType()
settings.hwType ? pageAssignPins() : pageSelectHwType()
}

private pageSelectHwType() {
dynamicPage(name: "pageConfiguration") {
dynamicPage(name: "pageConfiguration", nextPage: "pageConfiguration", install: false) {
section(title: "Which wiring hardware do you have?") {
href(
name: "Konnected Alarm Panel",
title: "Konnected Alarm Panel",
description: "Tap to select",
page: "pageConfiguration",
params: [hwType: "alarmPanel"],
image: "https://s3.us-east-2.amazonaws.com/konnected-io/konnected-alarm-panel-st-icon-t.jpg",
)
href(
name: "NodeMCU Base",
title: "NodeMCU Base",
description: "Tap to select",
page: "pageConfiguration",
params: [hwType: "nodemcu"],
image: "https://s3.us-east-2.amazonaws.com/konnected-io/icon-nodemcu.jpg",
paragraph "Select \"Konnected\" if you are using Konnected branded hardware, otherwise select NodeMCU for the open source pin mapping."
input(
name: "hwType",
type: "enum",
title: "Pin Mapping",
description: "Click to select",
required: true,
submitOnChange: true,
options: ["Konnected","NodeMCU"]
)
}
}
}


private pageAssignPins() {
def device = state.device
dynamicPage(name: "pageConfiguration") {
dynamicPage(name: "pageConfiguration", install: true) {
section() {
input(
name: "name",
Expand Down Expand Up @@ -244,6 +238,12 @@ private pageAssignPins() {
required: false,
defaultValue: true
)
href(
name: "changePinMapping",
page: "pageSelectHwType",
title: "Change pin mapping",
description: null
)
}
}
}
Expand Down Expand Up @@ -490,7 +490,7 @@ void syncChildPinState(hubitat.device.HubResponse hubResponse) {
}

private Map pinMapping() {
if (state.hwType == "alarmPanel") {
if (settings.hwType == "Konnected") {
return [
1: "Zone 1",
2: "Zone 2",
Expand Down
16 changes: 0 additions & 16 deletions hubitat/drivers/konnected-beep-blink.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -41,22 +41,6 @@ metadata {
input name: "alarmPause", type: "number", title: "Alarm Pause (ms)",
description: "Pause between tones in alarm", range: "10..*"
}

tiles(scale: 2) {
standardTile("beep", "device.switch", width: 6, height: 4, canChangeIcon: true, decoration: "flat") {
state "off", label: 'Beep', action: "tone.beep", icon: "st.alarm.beep.beep", backgroundColor: "#ffffff", nextState: "pushed"
state "on", label: 'Beep', action: "tone.beep", icon: "st.alarm.beep.beep", backgroundColor: "#00a0dc"
state "pushed", label:'pushed', action: "tone.beep", icon: "st.alarm.beep.beep", backgroundColor:"#00a0dc", nextState: "off"
}
standardTile("alarm", "device.alarm", width: 2, height: 2, decoration: "flat") {
state "off", label: "Off", action: "alarm.siren", icon: "st.security.alarm.clear", nextState: "turningOn"
state "siren", label: "Alarm", action: "alarm.off", icon: "st.security.alarm.alarm", backgroundColor: "#e86d13", nextState: "turningOff"
state "turningOn", label:'Activating', icon:"st.security.alarm.alarm", action:"alarm.off", backgroundColor:"#e86d13", nextState: "turningOff"
state "turningOff", label:'Turning off', icon:"st.security.alarm.clear", action:"alarm.siren", backgroundColor:"#ffffff", nextState: "turningOn"
}
main "beep"
details "beep", "alarm"
}
}

def updated() {
Expand Down
10 changes: 0 additions & 10 deletions hubitat/drivers/konnected-co-sensor.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,6 @@ metadata {
description: "By default, the alarm state is triggered when the sensor circuit is open (NC). Select Normally Open (NO) when a closed circuit indicates an alarm."
}

tiles {
multiAttributeTile(name:"main", type: "generic", width: 6, height: 4, canChangeIcon: true) {
tileAttribute ("device.carbonMonoxide", key: "PRIMARY_CONTROL") {
attributeState ("clear", label: "Clear", icon:"st.alarm.carbon-monoxide.clear", backgroundColor:"#ffffff")
attributeState ("detected", label: "Warning", icon:"st.alarm.carbon-monoxide.carbon-monoxide", backgroundColor:"#e86d13")
}
}
main "main"
details "main"
}
}

def isClosed() {
Expand Down
10 changes: 0 additions & 10 deletions hubitat/drivers/konnected-contact-sensor.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,6 @@ metadata {
description: "Most door & window sensors are Normally Open (NO), meaning that the circuit closes when the door/window is closed. To reverse this logic, select Normally Closed (NC)."
}

tiles {
multiAttributeTile(name:"main", type: "generic", width: 6, height: 4, canChangeIcon: true) {
tileAttribute ("device.contact", key: "PRIMARY_CONTROL") {
attributeState ("closed", label: "Closed", icon:"st.contact.contact.closed", backgroundColor:"#00a0dc")
attributeState ("open", label: "Open", icon:"st.contact.contact.open", backgroundColor:"#e86d13")
}
}
main "main"
details "main"
}
}

def isClosed() {
Expand Down
11 changes: 0 additions & 11 deletions hubitat/drivers/konnected-momentary-switch.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,6 @@ metadata {
description: "Off delay (in milliseconds)"
}

tiles {
multiAttributeTile(name:"main", type: "generic", width: 6, height: 4, canChangeIcon: true) {
tileAttribute ("device.switch", key: "PRIMARY_CONTROL") {
attributeState "off", label: 'Push', action: "momentary.push", backgroundColor: "#ffffff", nextState: "pushed"
attributeState "on", label: 'Push', action: "momentary.push", backgroundColor: "#00a0dc"
attributeState "pushed", label:'pushed', action: "momentary.push", backgroundColor:"#00a0dc", nextState: "off"
}
}
main "main"
details "main"
}
}

def updated() {
Expand Down
10 changes: 0 additions & 10 deletions hubitat/drivers/konnected-motion-sensor.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,6 @@ metadata {
description: "Most motion sensors are Normally Closed (NC), meaning that the circuit opens when motion is detected. To reverse this logic, select Normally Open (NO)."
}

tiles {
multiAttributeTile(name:"main", type: "generic", width: 6, height: 4, canChangeIcon: true) {
tileAttribute ("device.motion", key: "PRIMARY_CONTROL") {
attributeState ("inactive", label: "No Motion", icon:"st.motion.motion.inactive", backgroundColor:"#ffffff")
attributeState ("active", label: "Motion", icon:"st.motion.motion.active", backgroundColor:"#00a0dc")
}
}
main "main"
details "main"
}
}

def isClosed() {
Expand Down
10 changes: 0 additions & 10 deletions hubitat/drivers/konnected-panic-button.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,6 @@ metadata {
description: "By default, the alarm state is triggered when the sensor circuit is open (NC). Select Normally Open (NO) when a closed circuit indicates an alarm."
}

tiles {
multiAttributeTile(name:"main", type: "generic", width: 6, height: 4, canChangeIcon: true) {
tileAttribute ("device.switch", key: "PRIMARY_CONTROL") {
attributeState ("off", label: "Off", icon:"st.illuminance.illuminance.dark", backgroundColor:"#ffffff")
attributeState ("on", label: "Panic!", icon:"st.illuminance.illuminance.light", backgroundColor:"#e86d13")
}
}
main "main"
details "main"
}
}


Expand Down
12 changes: 0 additions & 12 deletions hubitat/drivers/konnected-siren-strobe.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,6 @@ metadata {
description: "Select if the attached relay uses a low-level trigger. Default is high-level trigger"
}

tiles {
multiAttributeTile(name:"main", type: "generic", width: 6, height: 4, canChangeIcon: true) {
tileAttribute ("device.alarm", key: "PRIMARY_CONTROL") {
attributeState ("off", label: "Off", icon:"st.security.alarm.clear", action:"alarm.both", backgroundColor:"#ffffff", nextState: "turningOn")
attributeState ("both", label: "Alarm!", icon:"st.security.alarm.alarm", action:"alarm.off", backgroundColor:"#e86d13", nextState: "turningOff")
attributeState ("turningOn", label:'Activating', icon:"st.security.alarm.alarm", action:"alarm.off", backgroundColor:"#e86d13", nextState: "turningOff")
attributeState ("turningOff", label:'Turning off', icon:"st.security.alarm.clear", action:"alarm.on", backgroundColor:"#ffffff", nextState: "turningOn")
}
}
main "main"
details "main"
}
}

def updated() {
Expand Down
10 changes: 0 additions & 10 deletions hubitat/drivers/konnected-smoke-sensor.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,6 @@ metadata {
description: "By default, the alarm state is triggered when the sensor circuit is open (NC). Select Normally Open (NO) when a closed circuit indicates an alarm."
}

tiles {
multiAttributeTile(name:"main", type: "generic", width: 6, height: 4, canChangeIcon: true) {
tileAttribute ("device.smoke", key: "PRIMARY_CONTROL") {
attributeState ("clear", label: "Clear", icon:"st.alarm.smoke.clear", backgroundColor:"#ffffff")
attributeState ("detected", label: "Smoke", icon:"st.alarm.smoke.smoke", backgroundColor:"#e86d13")
}
}
main "main"
details "main"
}
}

def isClosed() {
Expand Down
12 changes: 0 additions & 12 deletions hubitat/drivers/konnected-switch.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,6 @@ metadata {
description: "Select if the attached relay uses a low-level trigger. Default is high-level trigger"
}

tiles {
multiAttributeTile(name:"main", type: "generic", width: 6, height: 4, canChangeIcon: true) {
tileAttribute ("device.switch", key: "PRIMARY_CONTROL") {
attributeState ("off", label: '${name}', icon:"st.switches.switch.off", action:"switch.on", backgroundColor:"#ffffff", nextState: "turningOn")
attributeState ("on", label: '${name}', icon:"st.switches.switch.on", action:"switch.off", backgroundColor:"#00A0DC", nextState: "turningOff")
attributeState ("turningOn", label:'Turning on', icon:"st.switches.switch.on", action:"switch.off", backgroundColor:"#00a0dc", nextState: "turningOff")
attributeState ("turningOff", label:'Turning off', icon:"st.switches.switch.off", action:"switch.on", backgroundColor:"#ffffff", nextState: "turningOn")
}
}
main "main"
details "main"
}
}

def updated() {
Expand Down
29 changes: 0 additions & 29 deletions hubitat/drivers/konnected-temperature-humidity-sensor-dht.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -26,35 +26,6 @@ metadata {
description: "Frequency of sensor updates"
}

tiles {
multiAttributeTile(name:"main", type:"thermostat", width:6, height:4) {
tileAttribute("device.temperature", key: "PRIMARY_CONTROL") {
attributeState "temperature", label:'${currentValue}°F', unit: "°F", backgroundColors: [
// Celsius Color Range
[value: 0, color: "#153591"],
[value: 7, color: "#1E9CBB"],
[value: 15, color: "#90D2A7"],
[value: 23, color: "#44B621"],
[value: 29, color: "#F1D801"],
[value: 33, color: "#D04E00"],
[value: 36, color: "#BC2323"],
// Fahrenheit Color Range
[value: 40, color: "#153591"],
[value: 44, color: "#1E9CBB"],
[value: 59, color: "#90D2A7"],
[value: 74, color: "#44B621"],
[value: 84, color: "#F1D801"],
[value: 92, color: "#D04E00"],
[value: 96, color: "#BC2323"]
]
}
tileAttribute("device.humidity", key: "SECONDARY_CONTROL") {
attributeState("humidity", label:'${currentValue}%', unit:"%", defaultState: true)
}
}
main "main"
details "main"
}
}

def updated() {
Expand Down
26 changes: 0 additions & 26 deletions hubitat/drivers/konnected-temperature-probe-ds18b20.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -19,32 +19,6 @@ metadata {
capability "Temperature Measurement"
}

tiles {
multiAttributeTile(name:"main", type:"thermostat", width:6, height:4) {
tileAttribute("device.temperature", key: "PRIMARY_CONTROL") {
attributeState "temperature", label:'${currentValue}°F', unit: "°F", backgroundColors: [
// Celsius Color Range
[value: 0, color: "#153591"],
[value: 7, color: "#1E9CBB"],
[value: 15, color: "#90D2A7"],
[value: 23, color: "#44B621"],
[value: 29, color: "#F1D801"],
[value: 33, color: "#D04E00"],
[value: 36, color: "#BC2323"],
// Fahrenheit Color Range
[value: 40, color: "#153591"],
[value: 44, color: "#1E9CBB"],
[value: 59, color: "#90D2A7"],
[value: 74, color: "#44B621"],
[value: 84, color: "#F1D801"],
[value: 92, color: "#D04E00"],
[value: 96, color: "#BC2323"]
]
}
}
main "main"
details "main"
}
}

def updated() {
Expand Down
10 changes: 0 additions & 10 deletions hubitat/drivers/konnected-water-sensor.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,6 @@ metadata {
defaultValue: "Normally Open",
description: "Most leak sensors indicate water when the circuit is closed (NO). Select Normally Closed (NC) to reverse this logic."
}
tiles {
multiAttributeTile(name:"main", type: "generic", width: 6, height: 4, canChangeIcon: true) {
tileAttribute ("device.water", key: "PRIMARY_CONTROL") {
attributeState ("dry", label: "Dry", icon: "st.alarm.water.dry", backgroundColor: "#ffffff")
attributeState ("wet", label: "Wet", icon: "st.alarm.water.wet", backgroundColor: "#00A0DC")
}
}
main "main"
details "main"
}
}

def isClosed() {
Expand Down

0 comments on commit 8c44e83

Please sign in to comment.