Z2M Device Tracker

Integration and card

The integration is optional. It reads from the app every 15 seconds and adds summary sensors, battery and maintenance to-do lists and calendars, actions for automations, four dashboard cards and Repairs issues. The app keeps working, and keeps sending alerts, without it. See Installation to install it.

Connecting to the app

When you add the integration, it fills in the app's address for you if the app is installed from the App store. Leave API token empty.

The integration asks the app before it saves anything. A wrong address or token shows an error on the form:

Home Assistant Container (Docker)

Without the App store, the integration can't find the app by itself. Enter:

The cards link to the app at /app/..., which only exists with the App store. Set each card's panel option to the path of the Webpage dashboard that shows the app, for example /z2m-tracker. See The cards.

Changing the address or token

Go to Settings → Devices & services → Z2M Device Tracker → ⋮ → Reconfigure. The app is asked before the new address is saved, and the integration reloads. You can also change both under Configure.

The address looks like http://<app hostname>:8099; the default is http://local-z2m-tracker:8099. You might need to change it after reinstalling the app from a fork, for example.

With the App store, the app only answers Home Assistant itself and the sidebar, so the integration must run on the same Home Assistant as the app.

Options

Settings → Devices & services → Z2M Device Tracker → Configure has:

OptionDefaultWhat it does
App URLfound for youThe app's address.
API tokenemptyOnly for the app in plain Docker.
Show problems in Settings > RepairsonSee Repairs.
Battery and maintenance calendars and to-do listsonSee Turning the calendars and lists off.

The cards pick up option changes without a page reload.

Sensors

All five belong to a Z2M Device Tracker service device. They count Zigbee2MQTT, ZHA and Matter devices. The coordinator isn't counted, and neither are devices marked Not listened to.

SensorStateAttributes
Active devicesDevices on a network
Offline devicesActive devices Zigbee2MQTT reports unavailabledevices: their names
Removed devicesDevices no longer on any network
IssuesNumber of warningswarnings: up to 25, each with device, issue and detail; info_count: number of info items
Last eventThe latest event, for example joined: Hall motionThe full event: time, kind, ieee, name, instance, detail

They go unavailable if the app can't be reached.

The sensor names follow your Home Assistant language where a translation exists. The entity IDs stay the English ones, so automations keep working.

Example: a daily nudge if anything needs attention

triggers:
  - trigger: time
    at: "18:00:00"
conditions:
  - condition: numeric_state
    entity_id: sensor.z2m_device_tracker_issues
    above: 0
actions:
  - action: notify.mobile_app_your_phone
    data:
      title: "Zigbee: {{ states('sensor.z2m_device_tracker_issues') }} need attention"
      message: >
        {% for w in state_attr('sensor.z2m_device_tracker_issues', 'warnings') %}
        {{ w.device }}: {{ w.issue }}
        {% endfor %}

Check the sensor's real entity ID under the service device.

Battery to-do list

Zigbee batteries (todo.z2m_tracker_batteries) is the app's shopping list as a Home Assistant to-do list. Open it from To-do lists in the sidebar.

Tick an item when you've changed those batteries. That records a replacement, dated today, for every device in the item, the same as recording it on each device's Battery tab. The devices leave the list until they next report a battery level.

Replacements from the last 30 days show as completed items. To undo one, remove it from the device's Battery tab in the app; unticking it on the list doesn't work.

Battery calendar

Zigbee batteries (calendar.z2m_tracker_batteries) has an all-day event:

Use it in the calendar view, or as a calendar trigger in automations.

Installs from before 1.1.0 keep whatever entity IDs Home Assistant gave the list and calendar. Check them under the service device.

Maintenance to-do list

Zigbee maintenance (todo.z2m_tracker_maintenance) lists the maintenance tasks you've set on your devices.

Maintenance calendar

Zigbee maintenance (calendar.z2m_tracker_maintenance) has an all-day event on each task's next due date, and a Done: … event on the day it was last done.

The maintenance list and calendar need app 1.5.0 or newer.

Turning the calendars and lists off

Home Assistant adds Calendar and To-do lists to its sidebar while any integration provides them. If you don't use the tracker's, turn off Battery and maintenance calendars and to-do lists under Settings → Devices & services → Z2M Device Tracker → Configure.

That removes all four entities. Restart Home Assistant to remove the sidebar items too, unless another integration still provides a calendar or to-do list. Turning the option back on brings the entities back with the same IDs.

To keep the lists and only hide the sidebar items, long-press the Home Assistant title at the top of the sidebar.

Actions

The integration adds these actions for automations and scripts. Pick the device by name with device_id. In YAML, ieee takes an IEEE address instead.

Battery replaced, Mute device and Add note take Zigbee2MQTT, ZHA and Matter devices. Reconfigure and Firmware update list only Zigbee2MQTT devices, and say so if given another. See ZHA and Matter.

ActionWhat it doesFields
z2m_tracker.battery_replacedRecords a battery change. Also updates Battery Notes when it tracks the device.device_id; date (default today); battery_type, to save the type at the same time; brand, the brand of the new batteries (see Batteries)
z2m_tracker.mute_deviceStops the tracker flagging problems with a device, the same as Ignore in the app.device_id; checks (default all; any device check, such as late, lqi_stuck or router_hopping); duration (default until you unmute it in the app)
z2m_tracker.run_network_scanStarts a routing scan on a Zigbee2MQTT network.base_topic (default every network)
z2m_tracker.reconfigureReconfigures a Zigbee2MQTT device. Wake a battery device first.device_id
z2m_tracker.ota_updateInstalls a firmware update. Leave out the device to install every available update. Returns which devices were queued and which failed.device_id
z2m_tracker.add_noteAdds a line to the end of a device's note.device_id; text
z2m_tracker.pause_alertsPauses alerts, the same as ⋮ → Pause alerts in the app. Health still lists problems; those still there when the pause ends are sent once.minutes (1–43200; leave empty to pause until you resume)
z2m_tracker.resume_alertsEnds a pause now. Problems found during the pause that are still there are sent.none
z2m_tracker.import_historyScans Zigbee2MQTT's files and Home Assistant's registries again for older devices and names. The same as Settings → Import history in the app. See Backup and data. Returns devices_found, new_devices and new_events.none

Wrong input, such as a device the tracker doesn't know, stops the action with a message that says what was wrong. The actions are ready as soon as the integration starts, even while the app is slow to answer.

From 1.4.0 these actions, and ticking items on the battery to-do list, are for administrators. Automations and scripts can still call them. A user who isn't an administrator gets Unauthorized, and the cards show them the devices without notes or asset details.

Example: record a battery change by scanning a tag

Stick an NFC tag on the device, and scan it after changing the battery:

triggers:
  - trigger: tag
    tag_id: hall-motion
actions:
  - action: z2m_tracker.battery_replaced
    data:
      device_id: 4f1c9e0a7b2d4c6e8f01a2b3c4d5e6f7
      brand: Panasonic

brand is optional, and needs app 1.5.0 or newer. A brand that isn't on your list in the app yet is added to it.

Example: mute a device while it's unplugged

actions:
  - action: z2m_tracker.mute_device
    data:
      device_id: 4f1c9e0a7b2d4c6e8f01a2b3c4d5e6f7
      checks:
        - offline
      duration:
        days: 2

Example: pause alerts during Zigbee work

Turn a helper on before you work on Zigbee2MQTT, and off when you're done:

triggers:
  - trigger: state
    entity_id: input_boolean.zigbee_maintenance
    to: "on"
    id: start
  - trigger: state
    entity_id: input_boolean.zigbee_maintenance
    to: "off"
    id: stop
actions:
  - choose:
      - conditions:
          - condition: trigger
            id: start
        sequence:
          - action: z2m_tracker.pause_alerts
            data:
              minutes: 240
      - conditions:
          - condition: trigger
            id: stop
        sequence:
          - action: z2m_tracker.resume_alerts

The 4-hour limit means alerts come back even if you forget to turn the helper off.

The cards

The integration loads the cards for you; there's no dashboard resource to add. Add them from the card picker or in YAML. Each one has a visual editor. Tapping a device opens it in the Zigbee Tracker sidebar.

All four take an optional panel option, the page they link to. With the App store, leave it out: the cards find the sidebar page themselves. With the app in Docker, set it to the path of your Webpage dashboard, for example panel: /z2m-tracker. Only a path inside Home Assistant works, not a full web address.

The cards update on their own when anything changes, and after you change the integration's options.

The cards follow your Home Assistant profile language, in the same languages as the sidebar (see Configuration). They fill in issue text the same way the sidebar does. Where a language file lacks a piece, that piece shows in English. They read the app's translation files through the integration, so they need app 1.2.0 or newer as well. With an older app they stay in English.

Cards added before 1.2.0 saved an English title in their settings. To get the translated title, open the card's editor and clear the Title field. The defaults in the tables below are the English titles.

Summary card

Picker name: Zigbee Tracker summary.

type: custom:z2m-tracker-card
title: Zigbee devices
max_items: 5
show_community: false
OptionDefaultWhat it does
titleZigbee devicesThe card's heading.
max_items5How many problems to list before "and N more" (1 to 50).
show_communityfalseShow community ratings: lists your models that other users rate Avoid or Mixed. See Community ratings.

The card shows:

Battery card

Picker name: Zigbee Tracker batteries. Battery devices, lowest first, each with its battery type, the days left and its area. Bars turn red at the app's low-battery threshold (battery_alert_percent), and amber below twice that (or 30%, whichever is higher).

type: custom:z2m-tracker-battery-card
title: Batteries
max_items: 8
show_all: false
OptionDefaultWhat it does
titleBatteriesThe card's heading.
max_items8How many devices to list before "and N more" (1 to 50).
show_allfalseList every battery device and ignore max_items.

Health card

Picker name: Zigbee Tracker health. How many devices need attention, are worth a look or are fine, then the top issues.

type: custom:z2m-tracker-health-card
title: Zigbee health
max_items: 5
show_info: true
OptionDefaultWhat it does
titleZigbee healthThe card's heading.
max_items5How many issues to list before "and N more" (1 to 50).
show_infotrueInclude "worth a look" items. Off lists only devices that need attention.

Network card

Picker name: Zigbee Tracker network. Devices, routers, offline devices and weak spots (single-point-of-failure routers), then for each network its channel and whether it overlaps your Wi-Fi, the coordinator backup's age and the last routing scan.

type: custom:z2m-tracker-network-card
title: Zigbee network
show_weak_spots: true
OptionDefaultWhat it does
titleZigbee networkThe card's heading.
show_weak_spotstrueList each single point of failure under the counts.

Repairs

The integration copies the app's warnings, and every check you've set to Show and notify, into Settings → Repairs, next to the rest of your system's issues. Each one is titled Zigbee: <device> - <problem> and links to the Zigbee Tracker. It clears itself when the problem is fixed.

Repairs stays empty while Send alerts or Show problems in HA Repairs is off in the app's settings. When a router goes offline, the devices behind it are grouped under the router's issue, the same as in the app. See Alerts and notifications.

A critical device that goes offline gets its own issue, <device> is offline (critical device). It closes itself when the device comes back.

Fixing a problem from Repairs

A device's problem has a Fix button. It offers the fixes that suit the problem:

ProblemFixes offered
Binding lostRestore the binding, or The binding was removed on purpose
Low battery, Battery running down, Battery draining fastBattery replaced today
Frozen readingReconfigure the device
Firmware updateInstall the firmware update
Every device problemMute this check for 24 hours, or Mute this check until I unmute it

Muting only affects that check on that device. Restore the binding lists the bindings it will re-create; wake a battery device first.

After a battery change or a binding restore, the problem stays out of Repairs for a while (a day for a battery, 10 minutes for bindings), so it doesn't come straight back before the device reports again.

A critical device's offline issue offers only the two mute fixes.

Network-wide problems, such as Zigbee2MQTT offline or Coordinator backup problem, have no Fix button. They close themselves when the problem is fixed.

Turning Repairs off

It's on by default. To turn it off, go to Settings → Devices & services → Z2M Device Tracker → Configure and turn off Show problems in Settings > Repairs. Turning it off removes the issues it created.

Diagnostics

If you report a problem, attach the integration's diagnostics: Settings → Devices & services → Z2M Device Tracker → ⋮ → Download diagnostics.

The file has the integration and app versions, the app's settings, a summary of each network (Zigbee2MQTT and coordinator versions, channel, and device, router and offline counts), problem counts by type, the last 25 event types, and a line per device (model, signal, battery, status and problems). It reads fresh data from the app, or the last data it had if the app can't be reached.

These are removed from the file: IEEE addresses, device names (Zigbee2MQTT and Home Assistant), notes, asset details, problem details, your notify action, your MQTT broker's host and user, Zigbee2MQTT panel links, the PAN ID, the API token, and the host part of the app's address.