since I started with it has always been puzzling to me how hard it is to write automation rules in openHAB.
Things got a little bit better with the jsr223 integration and I think @steve1 contributed some great ideas.
But with openHAB2 and the new API things got worse again and unfortunately even after long hours I did not manage to migrate my jython rules. Also jython has lots of drawbacks and is syntactically python2.
I even tried HomeAssistant because and even though it has lots of pros thanks to the great Z-Wave work of @chris I am back on the openHAB track (if someone is interested I can write a small comparison of openHAB and HomeAssistant).
But whilst trying HomeAssistant I managed to get some fresh ideas and point of views and I still really wanted to create my rules in Python.
This is why created HABApp.
It is a multithreaded, asyncIO based automation framework which allows easy and fast creation of rules.
HABApp connects to openHAB through the Rest-API and therefore allows quick and seamless integration and transition.
This approach has the great benefit that any python library can be easy loaded and integrated into the automation rules.
HABApp is currently still in beta, but I think this approach is interesting to more people.
It would be nice if I could get some feedback on the idea in general and on the current implementation status.
- Added native support for sunrise/sunset
- Added support for ThingStatus events
- Updated documentation and added getting started sectio
- Internal Timestamps are all utc now
- Added location config
- Added fixes and tests for QuantityType
The scheduler allows now more complex statements out of the box:
# run the function on sunrise ret = self.run_on_sun('sunrise', self.on_sunrise) # trigger will not be earlier than 7:30 ret.earliest(time(7, 30)) # trigger will not be later than 9:00 ret.latest(time(9, 00)) # add a 1h offset to the calculated sunrise time ret.offset(timedelta(h=1)) # add a random value in the interval +- 300 secs to sunrise time ret.jitter(300)