ZWave>MQTT Best Practice Logging

Currently have:

  • OH2 running on Ubuntu AMD64.
  • Aeotec Z-Stick configured and working.
  • Z-Wave & MQTT bindings installed and configured.
  • Z-Wave items configured via HABMin and outputting data correctly in event.log.
  • MQTT binding is connected to broker.

I have had MQTT/InfluxDB/Grafana on my network for other reasons, what I’m attempting to do is log data that OpenHab generates (for the case of this example, a Z-Wave motion sensor) onto MQTT so I can use existing infrastructure to log/graph.

From the documentation this looks like exactly what I need:


Number garageTemp {mqtt=">[mybroker:openhab/garage/temp:state:*:default]"}

The problem is I’ve created the items I want to log in HABMin, they were automatically created when I added the Z-Wave device, so the item files don’t exist in /etc/openhab2/items. So couple of queries:

  1. Is that the best way long term to create Z-Wave items?
  2. Can I edit the files that HABMin creates to add the appropriate MQTT commands? If so, where is that file?
  3. Is there a better way to get data generated from OpenHab2 to my MQTT broker?

Just an update - I’ve created the items manually with the MQTT string, eg:

Number      GarageHumidity               "Humidity [%.1f %%]"      <humidity>          { mqtt=">[mybroker:openhab/garage/humidity:state:*:default]" }

And then I’ve “linked” them via HABMin. This appears to be working fine. I’ve also realised I can just find the zwave node string easily enough and configure the whole lot manually.

Just after pros/cons really, I don’t want to get 6 months in building something and then have to rewrite it…