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.