Presence detection not working

I’ve an automation that sends an alert when a door or window is opened and it works really well.
I added a condition to only alert when I’m not home but now it does not work at all.
What have I done wrong please?

- id: '8675309'
  alias: Alert Door
  description: alert when door opened
  - platform: state
    - binary_sensor.dining_room_door
    - binary_sensor.garage_door
    - binary_sensor.sun_room_door
    from: 'off'
    to: 'on'
  - condition: state
    entity_id: person.michael
    state: 'Not_Home'
  - service: notify.notify
      message: The {{ }} door is open.
      title: Your {{ }} door

Case sensitivity:

  - condition: state
    entity_id: person.michael
    state: 'not_home'
1 Like

thanks I’ve tried all lower case but it still does not work.

Then you need to use the states tab of the developer tools to examine what your person is switching between.
The home / not_home states are fairly standard so you need to check your presence state history and possibly your logs for what is actually happening.