Hi all,
I’ve got a script that runs on a time of day, at a certain time of day, (midnight), it sends a message to display on my TV and then starts a 10 second timer to turn off the TV and then a 5 minute timer, (to allow the user to get upstairs etc), before doing all the other night time bits, turn down thermostat, turn on cameras etc.
rule "End of Day routine (Alexa / vTimeOfDay / Switch - Should Only run if vPresent = ON)"
when
Item aEndofDay changed
then
if(aEndofDay.state == ON)
{
logInfo(logName, "End of Day routine - started")
TV_LG_Toast.sendCommand("Switching on cameras in 5 minutes - Goodnight!")
*Turn Down Thermostat*
createTimer(now.plusSeconds(10),
[
*Turn Off TV command*
createTimer(now.plusMinutes(5),
[
*Turn On Cameras command*
logInfo(logName, "End of Day Routine ON - Cameras ON")
])
])
}
else
{
logInfo(logName, "End of Day routine - ended")
vIFTTTArlo_ONOFF.sendCommand(OFF)
logInfo(logName, "End of Day Routine OFF - Cameras OFF")
}
end
Now, this works absolutely perfectly so no problems there, but the wife is getting annoyed when we are still up after midnight on a weekend and she has to turn on the TV and cancel the cameras etc…
So, I’m thinking of having an Alexa command, (we use Alexa - and the openhab Alexa binding - extensively in our house), where someone can ‘Alexa, cancel goodnight’ within the 10 seconds before the TV turns off, (I may also extend the 10 seconds to 30 or something to give us more time), which will set a dummy variable to ON and then this will stop the timer.
However, I’ve never had to stop a timer on Openhab once I’ve started one so is this possible?
Ideally I’d like to delay the timer - or start a new one - so that the night time routine happens later and doesn’t need to be manually called.
Any thoughts, ideas or methods greatfully received…