WTH Add option to ignore "Unavailable" as "From State" in automations

I would like to allow a state change with any from state. For example: The “To” state of “Armed” and the “From” state of “Arming” or “Disarmed”, but must ignore “Unavailable” as a “From” state.
This will prevent missed events and also prevent a bunch of events when an integration goes offline or HA restarts.
If you need to detect “Unavailable” as a “From” state, it can then be specified in a dedicated automation.
An alternate solution would be to allow multiple “From” states.

allow multiple “From” states

You can have multiple from states. This is valid.

    - trigger: state
      id: master
      entity_id: alarm_control_panel.master
      to: disarmed
      from:
        - armed_home
        - armed_night
        - armed_away
        - armed_vacation
        - triggered

So is this.

    - trigger: state
      id: lock_code
      entity_id: 
        - sensor.back_door_lock_status
        - sensor.front_door_lock_status
        - sensor.side_door_lock_status
      to:
        - Locked (Jason)
        - Locked (Guest)
      not_from:
        - unknown
        - unavailable
1 Like

Thanks Jason. I figured there would be a coding solution for this. The newer GUI does so much, it makes one lazy to research a coding solution.

There is an open WTH asking for not_from / to to be added to the automaton editor you can vote for: WTH are not_from and not_to Missing from the UI for Automation State Triggers?

1 Like