Automation Trigger "State" + "For" doesn't work

Hey,

I got automation set up to control my alarm. I would like the alarm to automatically turn on if me and my so are gone for an hour. I thought I would be able to use the state trigger and use the for condition to trigger it but that simply doens’t work. If both people are gone for an hour simply nothing happens. Anyone know why?

That’s what I’ve currently got set up:

description: ""
trigger:
  - platform: state
    entity_id:
      - person.me
    for:
      hours: 1
      minutes: 0
      seconds: 0
    to: not_home
    id: alarm_einschalten_me_abwesend
    from: home
  - platform: state
    entity_id:
      - person.so
    to: not_home
    for:
      hours: 1
      minutes: 0
      seconds: 0
    id: alarm_einschalten_so_abwesend
    from: home
condition: []
action:
  - choose:
      - conditions:
          - condition: state
            entity_id: person.me
            for:
              hours: 1
              minutes: 0
              seconds: 0
            state: ""
          - condition: state
            entity_id: person.so
            for:
              hours: 1
              minutes: 0
              seconds: 0
            state: ""
            enabled: false
          - condition: state
            entity_id: alarm_control_panel.xiaomi_gateway_alarm
            state: disarmed
          - condition: or
            conditions:
              - condition: trigger
                id: alarm_einschalten_me_abwesend
              - condition: trigger
                id: alarm_einschalten_so_abwesend
        sequence:
          - device_id: 6ef22ac0XXXXXXXXXXXXXXXXXXXXX
            domain: alarm_control_panel
            entity_id: alarm_control_panel.xiaomi_gateway_alarm
            type: arm_away

Thanks for your help!

In your choose action, the third condition is superfluous. One of the triggers is always going to be true.

In the choose action first two state conditions you have not supplied a state for either condition.

This will do what you want:

description: ""
trigger:
  - platform: state
    entity_id: 
      - person.me
      - person.so
    from: home
    to: not_home
    for:
      hours: 1
      minutes: 0
      seconds: 0
condition:
  - condition: state
    entity_id: person.me
    state: not_home
    for:
      hours: 1
      minutes: 0
      seconds: 0
  - condition: state
    entity_id: person.so
    state: not_home
    for:
      hours: 1
      minutes: 0
      seconds: 0
action:
  - service: alarm_control_panel.alarm_arm_away
    target:
      entity_id: alarm_control_panel.xiaomi_gateway_alarm

Either person being away for an hour will trigger the automation but the conditions wont pass unless both persons have been away for an hour (so the second person that is away for an hour will trigger the action).

Lol sorry, I completly forgot about that, what a dumb mistake. Thanks for your help!