Can't trigger automation with Nmap tracker state


I’m trying to turn on my RF alarm when I leave home. So far I have everything else working but this. I can see in the History tab that my device changes state from “Home” to “Away” when I connect and disconnect my smartphone. The smartphone is sometimes “Unavailable” but I guess I will deal with that later.
Everything I have read so far deals with setting up the device tracker integration, person tracking and multiple services at the same time but not one example of using the nmap device state directy.

Thanks in advance.

- id: '1642618526014'
  alias: state test
  description: ''
  - platform: state
    entity_id: device_tracker.xiaomi_communications_ff_44_ea
    to: 'Home'
  condition: []
  - service: persistent_notification.create
      message: home
  mode: single

change the state to home not Home on the to line of your trigger.

Your states will always be lowercase. Check the state using the developer tools and the states tab. Often (binary sensors are a common one) will report something different on the frontend/UI than what the actual state is depending on the device class. A door open/closed is often actually on/off for the actual state.

Yeap, that was it.

The developer tools show the correct states: “home” and “not_home” as opossed to “Home” and “Away” which is how they show up in the History log.