Presence detection not working

Hi
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
  trigger:
  - platform: state
    entity_id:
    - binary_sensor.dining_room_door
    - binary_sensor.garage_door
    - binary_sensor.sun_room_door
    from: 'off'
    to: 'on'
  condition:
  - condition: state
    entity_id: person.michael
    state: 'Not_Home'
  action:
  - service: notify.notify
    data_template:
      message: The {{ trigger.to_state.name }} door is open.
      title: Your {{ trigger.to_state.name }} door
    

Case sensitivity:

 condition:
  - 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.