Z2M Device Tracker

Home Assistant entities

The app adds a few entities to each Zigbee2MQTT device Home Assistant already knows, so they appear on that device's page and can be used in automations. They're created through MQTT discovery, so you don't need the integration for them.

Turn them on or off with Settings → Home Assistant entities → Add entities to Zigbee devices (ha_entities). Turning it off removes them.

Which devices get them

The entities attach to the device Zigbee2MQTT created in Home Assistant, so only Zigbee2MQTT devices get them. These don't:

A stored device keeps its entities. Its checks are off, so Needs attention stays off while it's stored.

Per-device entities

EntityTypeEnabled by defaultFor
Needs attentionBinary sensor (problem)YesAll devices. On when the device has a warning. The issues attribute lists every current problem, warnings and info.
Reading frozenBinary sensor (problem)YesDevices with monitored readings (temperature, humidity and so on). On when a reading is frozen.
ReconfigureButtonYesAll devices. Same as Reconfigure in the tracker.
Battery replacedButtonYesBattery devices. Records a battery replacement dated today.
Battery last replacedSensor (date)YesBattery devices.
Signal (24 h avg)SensorNoAll devices. Average link quality over the last 24 hours.
Uptime (30 days)Sensor (%)NoAll devices. See Health checks.
Battery days leftSensor (days)NoBattery devices. See Batteries. Unknown until there's enough data.
Battery typeSensorNoBattery devices.
Connected viaSensorNoEnd devices. The router it connected through in the last routing scan.

Enable the ones that are off by default from the device's page, under the entity's settings. Settings → Home Assistant entities shows how many entities are published.

The entities become unavailable when the app stops, and come back when it starts.

Mesh score sensor

Each Zigbee2MQTT network also gets a Mesh score sensor (0 to 100), on a device named after its base topic. The first network's is sensor.zigbee2mqtt_mesh_score. Its attributes hold the parts of the score: devices_online, devices, average_link_quality, devices_with_backup_route, devices_in_routing_scan, open_problems and score_a_week_ago. See Health checks for how the score is worked out.

Examples

Notify when anything needs attention in one room

triggers:
  - trigger: state
    entity_id:
      - binary_sensor.kitchen_motion_needs_attention
      - binary_sensor.kitchen_door_needs_attention
    to: "on"
actions:
  - action: notify.mobile_app_your_phone
    data:
      message: >
        {{ state_attr(trigger.entity_id, 'friendly_name') }}:
        {{ state_attr(trigger.entity_id, 'issues') | join(', ') }}

Reconfigure a sensor automatically when its reading freezes

triggers:
  - trigger: state
    entity_id: binary_sensor.bedroom_climate_reading_frozen
    to: "on"
actions:
  - action: button.press
    target:
      entity_id: button.bedroom_climate_reconfigure

Entity IDs follow your device names, so check the real ones on the device's page.

Leftover devices

A device removed from Zigbee2MQTT can stay in Home Assistant with all its entities unavailable. The app lists these under Leftover in Home Assistant and can remove them for you. It uses Home Assistant's newer remove command when only the MQTT integration owns the device, and the older one on older Home Assistant versions. See Health checks.

How it works

The app publishes discovery messages under homeassistant/<component>/z2m_tracker/<ieee>_<key>/config, and each device's state as JSON on z2m_tracker/<ieee>. The entities attach to the existing device using Zigbee2MQTT's own identifier (zigbee2mqtt_<ieee>). Each network's mesh score is on z2m_tracker/network/<base topic>. Availability is on z2m_tracker/status. The buttons send PRESS to z2m_tracker/<ieee>/reconfigure and z2m_tracker/<ieee>/battery_replaced.

State is refreshed every minute. Nothing is sent while the broker is away; everything is published again when the app reconnects.