I started with OpenHAB back in 1.6 something, and have most of the lights in my home connected to it. I also have a couple of towel heaters that are controlled by a z-wave relay. It is primarily around these towel heaters I base my use case around.
So a bit of background: The heaters where on a timer through rules, where I calculated and displayed the end time and let them be active for four hours after turn-on. When I updated to 2.x these rules where not ported because of various reasons. I was never really satisfied with them either.
What I wanted was a way of changing the time on the fly. Such timer would also be beneficial to other use cases as well.
I have proofed on concept and inserted into my OpenHAB at home a timer binding with the following features:
- Guaranteed to only running one timer per thing
- Time to timeout settable through channel (defaults back to item property)
- Timer remains modifiable during countdown
- Time left and calendar end time exposed as channels
- Create and bind timers to item channels purely through PaperUI
- Timer is activated by either channel change or timeout change
I still have timers in my rules, and they do have their uses. This binding does not replace them fully, nor should it. I do however think it have a place in more complex scenarios.
What do the community think about abstract bindings? I think I remember @Kai arguing against it. I do however think there is a place for such building blocks. Alternatively how should I implement it?
I am happy to explain more if someone wants to know more!
The code is at: https://github.com/Digers/openhab2-addons/tree/feature/timer/bundles/org.openhab.binding.timer
Disclaimer: It is not ready for review