Zigbee devices monitoring using OpenHab

This is interesting - thanks for posting and sharing! A few thoughts:

  1. Is there any reason that you’re not using the availability topic which zigbee2mqtt sends for each device? This is a topic which is available to me when using the attribute output of zigbee2mqtt, rather than the json output. As soon as the device disappears, the message offline is sent on the availability topic, which I subscribe to with openHAB and can then act upon.
  2. Did you know that this is possible? If you used this profile feature, you could get rid of your transformationPattern JS transformation altogether.
  3. Did you know that you can use friendly-name in your zigbee2mqtt configuration.yaml? It would make your openHAB configurations, and MQTT topics, a bit more human-readable, as it would remove 0x00158d0001c2cc22 and use whatever you specified as friendly-name!

Obviously, it’s working for you, so no need to change anything really!

Oooh, and one more thing: you can also monitor (and control) the status of your bridge (CC2531 USB stick, for example)!