Compare commits

..

1 Commits

3 changed files with 18 additions and 18 deletions

View File

@@ -23,8 +23,8 @@ metadata {
fingerprint profileId: "0104", inClusters: "0000, 0003, 0004, 0005, 0006" fingerprint profileId: "0104", inClusters: "0000, 0003, 0004, 0005, 0006"
fingerprint profileId: "0104", inClusters: "0000, 0003, 0006", outClusters: "0003, 0006, 0019, 0406", manufacturer: "Leviton", model: "ZSS-10", deviceJoinName: "Leviton Switch" fingerprint profileId: "0104", inClusters: "0000, 0003, 0006", outClusters: "0003, 0006, 0019, 0406", manufacturer: "Leviton", model: "ZSS-10", deviceJoinName: "Leviton Switch"
fingerprint profileId: "0104", inClusters: "0000, 0003, 0006", outClusters: "000A", manufacturer: "HAI", model: "65A21-1", deviceJoinName: "Leviton Wireless Load Control Module-30amp" fingerprint profileId: "0104", inClusters: "0000, 0003, 0006", outClusters: "000A", manufacturer: "HAI", model: "65A21-1", deviceJoinName: "Leviton Wireless Load Control Module-30amp"
fingerprint profileId: "0104", inClusters: "0000, 0003, 0004, 0005, 0006", outClusters: "0003, 0006, 0008, 0019, 0406", manufacturer: "Leviton", model: "DL15A", deviceJoinName: "Leviton Lumina RF Plug-In Appliance Module" fingerprint profileId: "0104", inClusters: "0000, 0003, 0004, 0005, 0006", outClusters: "0003, 0006, 0008, 0019, 0406", manufacturer: "Lumi", model: "DL15A", deviceJoinName: "LM-Z3"
fingerprint profileId: "0104", inClusters: "0000, 0003, 0004, 0005, 0006", outClusters: "0003, 0006, 0008, 0019, 0406", manufacturer: "Leviton", model: "DL15S", deviceJoinName: "Leviton Lumina RF Switch" fingerprint profileId: "0104", inClusters: "0000, 0003, 0004, 0005, 0006", outClusters: "0003, 0006, 0008, 0019, 0406", manufacturer: "Lumi", model: "DL15S", deviceJoinName: "LM-Z3"
} }
// simulator metadata // simulator metadata
@@ -41,9 +41,9 @@ metadata {
tiles(scale: 2) { tiles(scale: 2) {
multiAttributeTile(name:"switch", type: "lighting", width: 6, height: 4, canChangeIcon: true){ multiAttributeTile(name:"switch", type: "lighting", width: 6, height: 4, canChangeIcon: true){
tileAttribute ("device.switch", key: "PRIMARY_CONTROL") { tileAttribute ("device.switch", key: "PRIMARY_CONTROL") {
attributeState "on", label:'${name}', action:"switch.off", icon:"st.switches.light.on", backgroundColor:"#00A0DC", nextState:"turningOff" attributeState "on", label:'${name}', action:"switch.off", icon:"st.switches.light.on", backgroundColor:"#79b821", nextState:"turningOff"
attributeState "off", label:'${name}', action:"switch.on", icon:"st.switches.light.off", backgroundColor:"#ffffff", nextState:"turningOn" attributeState "off", label:'${name}', action:"switch.on", icon:"st.switches.light.off", backgroundColor:"#ffffff", nextState:"turningOn"
attributeState "turningOn", label:'${name}', action:"switch.off", icon:"st.switches.light.on", backgroundColor:"#00A0DC", nextState:"turningOff" attributeState "turningOn", label:'${name}', action:"switch.off", icon:"st.switches.light.on", backgroundColor:"#79b821", nextState:"turningOff"
attributeState "turningOff", label:'${name}', action:"switch.on", icon:"st.switches.light.off", backgroundColor:"#ffffff", nextState:"turningOn" attributeState "turningOff", label:'${name}', action:"switch.on", icon:"st.switches.light.off", backgroundColor:"#ffffff", nextState:"turningOn"
} }
} }
@@ -92,4 +92,4 @@ def configure() {
sendEvent(name: "checkInterval", value: 2 * 10 * 60 + 2 * 60, displayed: false, data: [protocol: "zigbee", hubHardwareId: device.hub.hardwareID]) sendEvent(name: "checkInterval", value: 2 * 10 * 60 + 2 * 60, displayed: false, data: [protocol: "zigbee", hubHardwareId: device.hub.hardwareID])
log.debug "Configuring Reporting and Bindings." log.debug "Configuring Reporting and Bindings."
zigbee.onOffRefresh() + zigbee.onOffConfig() zigbee.onOffRefresh() + zigbee.onOffConfig()
} }

View File

@@ -98,7 +98,7 @@ def motionHandler(evt) {
else { else {
state.motionStopTime = now() state.motionStopTime = now()
if(delayMinutes) { if(delayMinutes) {
runIn(delayMinutes*60, turnOffMotionAfterDelay, [overwrite: true]) runIn(delayMinutes*60, turnOffMotionAfterDelay, [overwrite: false])
} else { } else {
turnOffMotionAfterDelay() turnOffMotionAfterDelay()
} }

View File

@@ -125,19 +125,19 @@
if(allOk) { if(allOk) {
if(everyoneIsAway() && (state.sunMode == "sunrise")) { if(everyoneIsAway() && (state.sunMode == "sunrise")) {
log.debug("Home is Empty Setting New Away Mode") log.info("Home is Empty Setting New Away Mode")
def delay = (falseAlarmThreshold != null && falseAlarmThreshold != "") ? falseAlarmThreshold * 60 : 10 * 60 def delay = (falseAlarmThreshold != null && falseAlarmThreshold != "") ? falseAlarmThreshold * 60 : 10 * 60
runIn(delay, "setAway") runIn(delay, "setAway")
} }
if(everyoneIsAway() && (state.sunMode == "sunset")) { if(everyoneIsAway() && (state.sunMode == "sunset")) {
log.debug("Home is Empty Setting New Away Mode") log.info("Home is Empty Setting New Away Mode")
def delay = (falseAlarmThreshold != null && falseAlarmThreshold != "") ? falseAlarmThreshold * 60 : 10 * 60 def delay = (falseAlarmThreshold != null && falseAlarmThreshold != "") ? falseAlarmThreshold * 60 : 10 * 60
runIn(delay, "setAway") runIn(delay, "setAway")
} }
else { else {
log.debug("Home is Occupied Setting New Home Mode") log.info("Home is Occupied Setting New Home Mode")
setHome() setHome()
@@ -152,7 +152,7 @@
log.debug("Checking if everyone is away") log.debug("Checking if everyone is away")
if(everyoneIsAway()) { if(everyoneIsAway()) {
log.debug("Nobody is home, running away sequence") log.info("Nobody is home, running away sequence")
def delay = (falseAlarmThreshold != null && falseAlarmThreshold != "") ? falseAlarmThreshold * 60 : 10 * 60 def delay = (falseAlarmThreshold != null && falseAlarmThreshold != "") ? falseAlarmThreshold * 60 : 10 * 60
runIn(delay, "setAway") runIn(delay, "setAway")
} }
@@ -161,7 +161,7 @@
else { else {
def lastTime = state[evt.deviceId] def lastTime = state[evt.deviceId]
if (lastTime == null || now() - lastTime >= 1 * 60000) { if (lastTime == null || now() - lastTime >= 1 * 60000) {
log.debug("Someone is home, running home sequence") log.info("Someone is home, running home sequence")
setHome() setHome()
} }
state[evt.deviceId] = now() state[evt.deviceId] = now()
@@ -175,14 +175,14 @@
if(everyoneIsAway()) { if(everyoneIsAway()) {
if(state.sunMode == "sunset") { if(state.sunMode == "sunset") {
def message = "Performing \"${awayNight}\" for you as requested." def message = "Performing \"${awayNight}\" for you as requested."
log.debug(message) log.info(message)
sendAway(message) sendAway(message)
location.helloHome.execute(settings.awayNight) location.helloHome.execute(settings.awayNight)
} }
else if(state.sunMode == "sunrise") { else if(state.sunMode == "sunrise") {
def message = "Performing \"${awayDay}\" for you as requested." def message = "Performing \"${awayDay}\" for you as requested."
log.debug(message) log.info(message)
sendAway(message) sendAway(message)
location.helloHome.execute(settings.awayDay) location.helloHome.execute(settings.awayDay)
} }
@@ -192,19 +192,19 @@
} }
else { else {
log.debug("Somebody returned home before we set to '${newAwayMode}'") log.info("Somebody returned home before we set to '${newAwayMode}'")
} }
} }
//set home mode when house is occupied //set home mode when house is occupied
def setHome() { def setHome() {
sendOutOfDateNotification() sendOutOfDateNotification()
log.debug("Setting Home Mode!!") log.info("Setting Home Mode!!")
if(anyoneIsHome()) { if(anyoneIsHome()) {
if(state.sunMode == "sunset"){ if(state.sunMode == "sunset"){
if (location.mode != "${homeModeNight}"){ if (location.mode != "${homeModeNight}"){
def message = "Performing \"${homeNight}\" for you as requested." def message = "Performing \"${homeNight}\" for you as requested."
log.debug(message) log.info(message)
sendHome(message) sendHome(message)
location.helloHome.execute(settings.homeNight) location.helloHome.execute(settings.homeNight)
} }
@@ -213,7 +213,7 @@
if(state.sunMode == "sunrise"){ if(state.sunMode == "sunrise"){
if (location.mode != "${homeModeDay}"){ if (location.mode != "${homeModeDay}"){
def message = "Performing \"${homeDay}\" for you as requested." def message = "Performing \"${homeDay}\" for you as requested."
log.debug(message) log.info(message)
sendHome(message) sendHome(message)
location.helloHome.execute(settings.homeDay) location.helloHome.execute(settings.homeDay)
} }
@@ -329,4 +329,4 @@
sendNotification("Your version of Hello, Home Phrase Director is currently out of date. Please look for the new version of Hello, Home Phrase Director now called 'Routine Director' in the marketplace.") sendNotification("Your version of Hello, Home Phrase Director is currently out of date. Please look for the new version of Hello, Home Phrase Director now called 'Routine Director' in the marketplace.")
state.lastTime = (new Date() + 31).getTime() state.lastTime = (new Date() + 31).getTime()
} }
} }