MQTT Device Tracker automation: "required key not provided @ data['zone']"

Hi,
I tried to use GitHub - awilliams/wifi-presence: Presence detection on OpenWrt routers using connect/disconnect events of WiFi clients. Events are published to MQTT with Home Assistant integration. for presence detection in HA. Within the dashboard the sensor is shown correctly:
grafik

But when I try to use it in an automation I get required key not provided @ data['zone'], an example for the automation is:

description: ""
mode: single
trigger:
  - platform: device
    device_id: 359ea2b372a7ba57017a2876043faadc
    domain: device_tracker
    entity_id: ea02bfafa53f97a0c2f4e3497f4eda45
    type: leaves
condition: []
action: []

As I didn’t configure any stuff of the device tracker manually I’m now confused what is to blame for the incorrect config.

How did you even create that trigger… the UI editor automatically includes all the required keys for the event type you choose. As the error states, you are missing the zone key, which is required.

description: ""
mode: single
trigger:
  - platform: device
    device_id: 359ea2b372a7ba57017a2876043faadc
    domain: device_tracker
    entity_id: ea02bfafa53f97a0c2f4e3497f4eda45
    type: leaves
    zone: zone.home
condition: []
action: []

I created the trigger via the UI, the “Home” zone was selected via it’s radio button:


But it was not added into the yaml.

This is a bug and has been logged

this issue is reported fixed in version 2024.6 releasing 05Jun24