HABApp is a Python rule engine for home automation. It has local items, an event bus and can integrate external systems, e.g. openHAB and MQTT. Rules can listen to events from the event bus. These events are generated by HABApp or by the external systems. Additionally there is a scheduler available that makes time based triggering very easy.
HABApp folder structure¶
Integration with openHAB¶
HABApp connects to the openhab event stream and automatically updates the local openhab items when an item in openhab changes. These item values are cached, so accessing and working with items in rules is very fast. The events from openhab are also mirrored to the internal event bus which means that triggering on these events is also possible.
When HABApp connects to openhab for the first time it will load all items/things from the openhab instance and create local items. The name of the local openhab items is equal to the name in openhab.
Posting updates, sending commands or any other openhab interface call will issue a corresponding REST-API call to change openhab.
Integration with MQTT¶
HABApp subscribes to the defined mqtt topics. For every MQTT message with the
retain flag HABApp will automatically
MqttItem so these values can be accessed later. The name of the created item is the the mqtt topic.
All other messages will not automatically create an item but still create an event on the event bus.
MqttItems created by rules will automatically be updated with the latest value once a message is received. These item values are cached, so accessing and working with items in rules is very fast.