Z2M Device Tracker

Alerts and notifications

When a check finds a new problem, or a device joins or leaves, the app sends an alert. Each alert goes to every channel you've turned on in Settings → Notifications (the gear at the top of the sidebar):

ChannelSettingNotes
Home Assistant notificationHome Assistant notificationsClears itself when the problem goes away.
Automation eventAutomation eventFires z2m_tracker_alert. On by default.
Notify actionMobile notificationsAny notify action, for example notify.mobile_app_your_phone.

Each channel is sent on its own, so one that fails doesn't stop the others. Send test notification sends one alert through every channel that's on, so you can check they work.

Which problems send alerts is set per check in Settings → Checks: Off, Show in Health, or Show and notify. See Health checks.

When alerts are sent

Hold repeated alerts

A reading that hovers at its limit (15 %, 16 %, 15 %) would alert each time it crosses. So once a Low battery, weak signal or signal drop alert has cleared, the same alert for that device isn't sent again for 24 hours. The problem still shows on Health the whole time.

Set the time in Settings → Thresholds → Hold repeated alerts for (alert_repeat_hours, 0 to 168). 0 sends it every time. Offline alerts are never held.

What a problem affects

A device with a problem lists the Home Assistant automations, scripts and scenes that use it. On Health, open Used by … under the problem's row (for example "Used by 2 automations, 1 script") to see them, each with a link to its editor. The same list shows in the device page's What to do block. Its alerts get a line such as "Used by: Hall lights at night, Leak shut-off (+2 more)", so you know what has stopped working before you open anything.

When a device alerts

offline_alert_minutes counts from the moment Zigbee2MQTT marks the device offline, not from its last message. Zigbee2MQTT only does that after its own availability timeout: by default 10 minutes for mains devices and 25 hours for battery devices, or a timeout set for the device in Zigbee2MQTT's configuration.yaml. So with the defaults, a mains device alerts about 70 minutes after it goes quiet (10 + 60), and a battery device about 26 hours later (25 h + 60 min).

The When it alerts card on each device's page shows its own steps: its last message, when Zigbee2MQTT marks it offline (its own timeout or the mains or battery default), the offline alert delay, and Expected reporting if you've set it. If Zigbee2MQTT availability is off for the device, only Not heard from applies, after 2 days.

To change the Zigbee2MQTT timeout, go to Zigbee2MQTT's Settings → Availability for all devices, or set availability → timeout under one device in its configuration.yaml. For a device that should report more often than that, set Expected reporting instead.

With ZHA, ZHA's own availability timeouts decide when a device is offline, and the offline alert delay applies on top. See ZHA and Matter.

Stopped reporting and the learned rhythm

The app learns how often each device reports, and how long it normally sleeps, by time of week. Once a device is learned (after 7 days and 30 reports), Stopped reporting only alerts when a silence is unusual for that device at that time. A device that reports only when something happens, like a button, isn't flagged for silence. This is on by default (learn_rhythm, Settings → Checks).

Normal for this device on a Stopped reporting alert accepts the current silence until the device reports again, then learns it for that time of week. See Health checks.

Router outages and power cuts

When a router goes offline, the devices that route through it often follow. The Offline check groups them. A device whose router in the last routing scan that saw it is offline (or that router's router, and so on) shows under that router on Health. The router gets one problem and one notification, for example "Router offline: Landing plug - 6 devices that route through it are offline too".

A power cut looks different: several mains devices in one room drop together, while the battery devices there carry on. When 3 or more mains devices in the same Home Assistant area go offline within 11 minutes of each other, and at least one battery device in that area is still online, they become one problem and one notification, for example "Power loss in Garage? - 4 mains devices in Garage went offline within 6 s of each other". If one of them is a critical device, it leads the alert, so the alert goes out on the critical device's shorter delay.

Devices already grouped under an offline router aren't counted again. Devices without an area, and devices whose Offline check is ignored, aren't grouped.

Expected outages

Some setups take the network down on a schedule: a nightly Zigbee2MQTT restart, a backup that stops it, a router that reboots at 03:00. When a network has gone offline for under two hours, starting within the same 90 minutes of the day, on at least 4 of the last 7 days, an outage that starts in that window is expected.

It's on by default. Set expected_outages to false to be alerted every time. See Configuration.

Pause alerts

Use ⋮ → Pause alerts before planned work, such as a Zigbee2MQTT upgrade, re-pairing or a power cut. Pick 30 min, 1 hour, 4 hours, until 08:00 (the app's time zone), or Until I resume. While alerts are paused:

The pause survives an app restart. ⋮ → Resume alerts ends it early. Changing an alert setting during a pause marks the problems already found as sent, the same as it does outside a pause.

With the integration, the actions z2m_tracker.pause_alerts and z2m_tracker.resume_alerts do the same from automations. See Integration and card.

Critical devices

Turn on Critical device in the About card on a device's page for devices that must never fail quietly: smoke and leak sensors, the freezer plug, the heating. A critical device:

Alerts to the notify action (Mobile notifications) for a critical device also carry the Companion app's high-priority data: priority: high and ttl: 0 (Android, delivered straight away), and push: interruption-level: time-sensitive (iOS, shown through Focus modes).

When you replace a critical device, the new one is critical too.

Buttons on phone alerts

Alerts sent to the notify action through the Home Assistant Companion app come with buttons:

ButtonWhat it doesOn
Mute 24 hMutes that check on that device for 24 hours, the same as muting it on the device page. On a router outage alert it mutes the router's Offline check, which also quiets the devices behind it.Device alerts
PingPings the device and sends the reply time, or that it didn't answer, as a second notification.Mains devices that can be pinged
Battery replacedRecords a battery change today, the same as Battery replaced on the device page (and in Battery Notes, if the device has it).Low battery and Battery running down alerts

Tapping the alert opens the device in the Zigbee Tracker. Alerts about a whole network, a group, joins and leaves, the quiet hours summary and the weekly summary have no buttons; tapping them opens the Zigbee Tracker.

Each alert's buttons carry a one-use code. A button works once, for 7 days, and only for the device and check the alert was sent for. Anything else is ignored and written to the app's log. The app hears the buttons through Home Assistant's mobile_app_notification_action event, so they work without the integration.

Alerts also carry a tag, so a repeat of the same alert replaces the old one on the phone.

The buttons are on by default. If your notify action isn't the Companion app and rejects the extra data, turn off alert_actions on the app's Configuration tab. See Configuration.

Quiet hours

Settings → Notifications with quiet hours on, and the pause banner

Turn on Quiet hours in Settings → Notifications and set From and to. Between those times, new problem alerts and Device joined, Device left and Interview failed alerts are held instead of being sent. The times are in the app's time zone and can cross midnight. Alerts for critical devices still go out straight away.

When quiet hours end, one notification sums up the night, titled "Zigbee overnight: N issues, M resolved". It lists:

Problems listed as still open count as alerted, so they aren't sent again one by one. If nothing happened, no summary is sent. Held alerts are kept in the app's data, so they survive a restart.

The options are quiet_hours, quiet_start and quiet_end. See Configuration.

Escalation

Turn on Escalate unanswered alerts in Settings → Notifications to send an alert again to a second person when nobody acts on it. Set Escalate after and Send to (a notify action). The repeat is titled "Unanswered: …".

The options are escalate_enabled, escalate_hours, escalate_service and escalate_critical_only. See Configuration.

Joins and leaves

Device joined, Device left and Interview failed alerts come from Zigbee2MQTT's own events. ZHA sends no join or leave events, so with ZHA a device appearing in ZHA's device list alerts as Device joined, and one going from it as Device left.

The z2m_tracker_alert event

Every alert fires this event (unless Automation event is off), with this data:

FieldExampleWhat it is
kindbattery_lowThe check key, or joined, left, interview failed, test, or digest for the quiet hours summary.
ieee0x00158d0001a2b3c4The device's IEEE address. For a network problem, network:<base topic>.
nameHall motionThe device's name.
titleZigbee: Hall motion - Low batteryThe notification title.
messageBattery at 12%.The notification text.
networkzigbee2mqttThe base topic of the device's network.
keybattery_low:0x00158d0001a2b3c4A unique key for this problem.
criticaltrueOnly there for a critical device. The title then starts with Critical:.
escalatedtrueOnly there when the alert is sent again by escalation, with service set to where it went.

Example: flash a light when a device goes offline

triggers:
  - trigger: event
    event_type: z2m_tracker_alert
    event_data:
      kind: offline
actions:
  - action: light.turn_on
    target:
      entity_id: light.hall
    data:
      flash: short

Example: sound the siren for a critical device

triggers:
  - trigger: event
    event_type: z2m_tracker_alert
    event_data:
      critical: true
actions:
  - action: siren.turn_on
    target:
      entity_id: siren.hall

Example: send only some alerts to your phone

Leave Mobile notifications empty and pick the alerts in an automation instead:

triggers:
  - trigger: event
    event_type: z2m_tracker_alert
conditions:
  - condition: template
    value_template: "{{ trigger.event.data.kind in ['offline', 'network_offline', 'joined'] }}"
actions:
  - action: notify.mobile_app_your_phone
    data:
      title: "{{ trigger.event.data.title }}"
      message: "{{ trigger.event.data.message }}"

Weekly summary

Once a week the app sends a short summary:

Turn it on or off with Send a weekly summary in Settings → Weekly summary, set the day and hour under When, or Send one now to see it. It goes to the same notification channels as alerts, and also fires a z2m_tracker_summary event with title and message, so you can send it anywhere:

triggers:
  - trigger: event
    event_type: z2m_tracker_summary
actions:
  - action: notify.mobile_app_your_phone
    data:
      title: "{{ trigger.event.data.title }}"
      message: "{{ trigger.event.data.message }}"

The options are weekly_summary, summary_day (0 is Monday) and summary_hour.

Daily summary

Turn on Send a daily summary in Settings → Weekly summary (daily_summary, off by default) for one short message a day at the same hour as the weekly one. It lists:

Batteries to buy are added when a message goes out anyway.

It goes to the same channels as the weekly summary, and fires the z2m_tracker_summary event with daily: true.