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.
- Textual configuration of Things can be spread out over multiple files
- Extensive error messages and exception tracebacks with variable values
- Rework of MultiModeItem:
- moved into subpackage HABApp.util.multimode
- create_mode is deprecated, modes get added by add_mode and can be subclassed
- Added SwitchItemValueMode, a mode which can be enabled/disabled by a SwitchItem
- added functions to work with OH rest/links/ endpoint (thx snpz)
- added get_thing to the OpenhabInterface
- BaseValueItem can be used in calculations (and subsequently all other item types, too),
no more need to use the
val = NumberItem('item1') + NumberItem('item2')
is the same as
val = NumberItem('item1').value + NumberItem('item2').value
- First call for scheduler with time of day for workday/weekend could have been wrong
- ParamFiles get unloaded properly when file gets deleted