Zigbee2mqtt revisited: No more ugly transformations

Here is an example how to monitor presence of the Zigbee-bridge - similar to the network-binding (ping to detect presence).
What you get:
Zigbee01_sitemap
Find everything here (rename to zip): zigbee-bridge_monitoring.zip.pdf (3.3 KB)

If you take a look at the MQTT-Explorer, the bridge has a state (online / offline):
Zigbee02_MQTT-Explorer
This requires some mappings and renamed icons.

things-file:

Bridge mqtt:broker:MyMQTTBroker [host="localhost", secure=false] {

// Texas Instruments ZigBee to MQTT board
Thing topic bridge "TI ZigBee Bridge " @ "Your Room" {
        Channels:
            Type contact : state "state"            [ stateTopic = "zigbee2mqtt/bridge/state", off="offline", on="online" ] // online=on=open, offline=off=closed       
    }

items-file:

    // TI ZigBee to MQTT board
        Contact ZigBeeBridge_state "ZigBee Bridge (TI CC1352P) [MAP(contact_online.map):%s]" <myswitch> {channel="mqtt:topic:MyMQTTBroker:bridge:state"} // use modified switch-icon for contact with open/closed

transformation-file (contact_online.map)

CLOSED=OFFLINE
OPEN=ONLINE
NULL=undefiniert
-=Hyphen

sitemap-file

sitemap default label="Home" {
Frame label="Network Monitoring" {
        Text item=WiFi_AP                   icon=switch  // just as an example for a ping-device
        Text item=PhilipsHUE_ZigBeeBridge   // just as an example for a ping-device
        Default item=ZigBeeBridge_state // use myswitch icon
    }

This nicely detects unplugging the bridge from USB-port (and its re-connect). Very fast.
Can be used in a section together with ping-devices (same icon / status-text appearance).

6 Likes