Every house needs a Service Bus

After all, now that we have wireless thermostats, door locks, outlets, dimmers, alarms, garage doors, and motion sensors, it only makes sense to publish events onto a Service Bus. In my case I used Mosquitto in a FreeBSD jail as my broker.

My home controller is a HomeSeer. There are MQTT plugins available, but I preferred to use my own hsClient library which is a Java wrapper for the HomeSeer JSON API. I ended up writing hsMQTT, an MQTT bridge for HomeSeer which polls the HomeSeer API and publishes JSON messages onto an MQTT topic when device values change.

Typical change messages look like these:

{"deviceRef":107,"value":0.0,"lastChange":1594530001541,"location":"Living Room","location2":"Main Floor","name":"Living Room Dimmer","status":"Off","type":"Z-Wave Switch"}
{"deviceRef":111,"value":0.0,"lastChange":1590035156557,"location":"Study","location2":"Upstairs","name":"Study Light","status":"Off","type":"Z-Wave Switch"}
{"deviceRef":104,"value":18.88888888888889,"lastChange":1594534463932,"location":"Kitchen","location2":"Main Floor","name":"Furnace Thermostat Heating  Setpoint","status":"18.9 C","type":"Z-Wave Heating  Setpoint"}

You can download the source here

Leave a Reply