DVCSMP-2659 Reduce Hello Home Phrase Detector Logs

This commit is contained in:
Aaron Miller
2017-05-18 09:56:17 -05:00
parent 01c2968f91
commit f0de2f1a19

View File

@@ -125,19 +125,19 @@
if(allOk) { if(allOk) {
if(everyoneIsAway() && (state.sunMode == "sunrise")) { if(everyoneIsAway() && (state.sunMode == "sunrise")) {
log.info("Home is Empty Setting New Away Mode") log.debug("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.info("Home is Empty Setting New Away Mode") log.debug("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.info("Home is Occupied Setting New Home Mode") log.debug("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.info("Nobody is home, running away sequence") log.debug("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.info("Someone is home, running home sequence") log.debug("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.info(message) log.debug(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.info(message) log.debug(message)
sendAway(message) sendAway(message)
location.helloHome.execute(settings.awayDay) location.helloHome.execute(settings.awayDay)
} }
@@ -192,19 +192,19 @@
} }
else { else {
log.info("Somebody returned home before we set to '${newAwayMode}'") log.debug("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.info("Setting Home Mode!!") log.debug("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.info(message) log.debug(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.info(message) log.debug(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()
} }
} }