[solved] Substract Minutes from Alarm Time
Posted: Monday 05 February 2018 0:01
Hi everyone,
I'm quite new to domoticz and so far I was able to figure out most things by reading in this forum and the domoticz wiki.
So far I have a Spirit-z thermostat and a domitech zBulb in my system and I try to take my WakeUp Scenario to the next level with the help of Lua.
With blockly I'm already able to heat up the bathroom before I wake up and to have the light in my sleeping room come up slowly.
However I want to use lua to substract 25 minutes from my alarm time in order to start the wake up procedure. At the moment I do this substraction manually.
To automize it I tried stuff like:
commandArray={}
commandArray['Variable:WakeUp_Begin'] = tostring(tonumber(uservariables["Alarm_Time"])-25)
return commandArray
which obviously doesn't work. I probably have to transform the "Alarm_Time" somehow, so I can do arithmetics with it. What do I have to do?
I would much appreciate if you guys could help me with this problem.
Thanks a lot in advance!
I'm quite new to domoticz and so far I was able to figure out most things by reading in this forum and the domoticz wiki.
So far I have a Spirit-z thermostat and a domitech zBulb in my system and I try to take my WakeUp Scenario to the next level with the help of Lua.
With blockly I'm already able to heat up the bathroom before I wake up and to have the light in my sleeping room come up slowly.
However I want to use lua to substract 25 minutes from my alarm time in order to start the wake up procedure. At the moment I do this substraction manually.
To automize it I tried stuff like:
commandArray={}
commandArray['Variable:WakeUp_Begin'] = tostring(tonumber(uservariables["Alarm_Time"])-25)
return commandArray
which obviously doesn't work. I probably have to transform the "Alarm_Time" somehow, so I can do arithmetics with it. What do I have to do?
I would much appreciate if you guys could help me with this problem.
Thanks a lot in advance!