I have a ZWave light bulb and a ZWave 4-button wall switch, both connected to Domoticz installed on a Raspberry Pi.
I'd like the following scenarios :
- Button 1 : lamp on for 30 minutes
- Button 2 : lamp off
- Button 3 : lamp always on
- Button 4 : summon Cthulhu
Each buttons overrides the previous action (Button 3 -> Button 1 = on for 30 minutes)
Wiring and programming the buttons is easy, but now, how about the timer ? I'd like to avoid creating a homemade service because I'm afraid of messing with
I have 3 possibilities :
Domoticz dummy switch
Domoticz allows to create a dummy switch which can change states after some time given in an interface :
- off-the-shelf timer!
- I can interact quite quickly between my wall switch and the lamp
- although Domoticz handles MQTT, there will be a lot of LUA script and "blocky" to interconnect devices
- time might not be easily configurable...
at is a linux command to plan an action in time, as simple as
at [when] < [what]
- multi-timer service
- easy to use and call
- at only gives an unique ID, unless parsing the planned command I can't give a name to the job (unless with a magic linux command...)
- therefore I need to code/implement a job matcher using a database
Crontab is a linux service to plan repetitive tasks. In my case it will be a simple
# check every minute * * * * * /path/checktimer.sh
- Reliable time trigger
- Cannot manage seconds...
- Still forced to maintain somewhere a job matcher
To my question :
- Did you have to manage timers like this kind?
- Did I miss other more reliable/configurable solutions?
- Do you have a preference with on the solutions above?