Whilst it works creating timers using rules I wanted the opportunity to have a timer that I could modify from the UI rather than have to change scripts when I want to make small changes or enable/disable it. Also it seems a lot of effort is spent making timers work as people want within rules. As such I’ve created a new timer binding taking inspiration from this openhab1 trick: https://github.com/openhab/openhab1-addons/wiki/AlarmClock that I hope will make timers significantly easier.
This is a very early release and includes a Daily timer. With a daily timer you set an on time/an off time and the days the binding runs. It will then set a Timer_status switch to ON at the on time and OFF at the off time.You can also enable or disable the timer. You need to add the thing manually and then I envisage that you will set a rule that runs based on the timers status turning on/off. You can set this all up in the Paper UI.
The release can be found here: https://github.com/foxy82/openhab2-addons/releases/tag/Timer_Alpha1
To install it manually copy it to /usr/share/openhab2/addons. There is no other configuration - you just need to manually add a thing.
I’m going to extend it with other timers - these are the ones I’m thinking of at the moment let me know if there are others that would be of use:
- Monthly timer - Run on a certain day/hour/minute/second every month.
- Periodic - runs every 2 hours or every 2 minutes, or every 2 days
- Run once on a given day,month,year,hour,minute,second.
- Run once in 5 hours time