Repository navigation
OpenHAB Configuration
The openhab configuration excerpt from the configuration files are in the repository
#Bindings In the file Home.items the interesting stuff are the bindings and the maps.
The binding for the alarm is
mqtt="<[mysensor:mysensors/50/2/V_TRIPPED:state:MAP(contactFromMqtt.map)]"
The wiki section about the Arduino code mention the MySensors node-id = 50, the CHILD_ID_ALARM = 2 and the message sub-type V_TRIPPED. The map translates 1 and 0 values of V_TRIPPED to OPEN and CLOSED, as expected of an OpenHAB contact type. The contactFromMqtt.map is placed in the transform folder. The mqtt binding require that mqtt is configured in openhab.config.
#Heater status and graph For the status the definition is:
Number HeaterStatus "Fyret er [MAP(PBMonitor.map):%s]" <heating> (gHeater) { mqtt="<[mysensor:mysensors/50/1/V_VAR1:state:default]" }
The PBMonitor.map translates the run states mentioned in the Arduino code to text, that can be displayed at understood (if you read danish).
The HeaterStatus above is persisted using rrd4j, the configuration is here. That makes it possible possible to graph the status in OpenHAB. I use a 24 hour graph defined in default.sitemap.

The sitemaps define the other items to show as well.
#Alarm rule The rule for pushing a notification using Pushover is defined in heater.rules The preconfition is that Pushover is set up in openhab.config
#Rules for start time and run time The Arduino only send events when the burner status changes. To determine the time it takes to start, and how long time the burner is running the rules in heaterState.rules is used. The rules must be running for this to work, it will not update start- or run time, if you restart OpenHAB or reload the rules while the burner is running. The events are timestamped, and the time difference is found. Since OpenHAB does not have the notion of a time interval, a time type is used instead. While not conceptually correct, it is an easy way to display a time (interval). The rules update StartTimeInterval and RunTimeInterval defined in Home.items