State Automation Not Triggering

Hi Guys,

I have an automation that switches a boolean ON and another OFF, the former works and the latter does not, they are identical but opposite, but the other has a time delay. The

This is the working one:

- alias: big_pape_home
  hide_entity: true
  trigger:
  - platform: state
    entity_id: device_tracker.14_9d_09_81_20_b9
    to: "home"
  action:
  - service: input_boolean.turn_on
    data:
      entity_id: input_boolean.big_pape
  - service: mqtt.publish
    data:
      topic: 'location/nmp/bigpape'
      payload: 'home'

This does not work

- alias: big_pape_away
  hide_entity: true
  trigger:
  - platform: state
    entity_id: device_tracker.14_9d_09_81_20_b9
    from: "Home"
    to: "Away"
    for: 
      minutes: 5
  action:
  - service: input_boolean.turn_off
    data:
      entity_id: input_boolean.big_pape
  - service: mqtt.publish
    data:
      topic: 'location/nmp/bigpape'
      payload: 'away'

What could be the problem, I have tried to attack the second one from various angles but still it never triggers…

Go to Developer Tools > States page and examine the valid states for device_tracker.14_9d_09_81_20_b9.

Its states will probably be:
home
not_home

as opposed to:
Home
Away

That’s why your second automation never triggers because the device_tracker is never in a state called Home nor does it change to a state called Away.

BTW, an entity’s states displayed in the Lovelace UI may not be the ones seen in the States page. For automation purposes, use the ones shown in the States page.

That worked like a charm, the hours I spent debugging, thank you very much, I need the automation to smoothen a rather erratic Nmap presence detection, this should do it
:woman_facepalming:t6::woman_facepalming:t6: