Multiple states for single entity in automation Trigger

I am looking to use an entity state to trigger a scene, but the entity could be in one of two states. I can get it to work in YAML by writing it this way:

platform: state
entity_id: binary_sensor.closet_door_sensor
from: 
- 'off'
- 'unavailable'
to: 'on'

and it works, but if I save and reopen in the UI, it reformats to

platform: state
entity_id: binary_sensor.closet_door_sensor
from: 'off,unavailable'
to: 'on'

and if I resave it, it stops working. Is there a better way to do this, or do I just need to reformat it in YAML every time I save?

I’m no expert at any of this (just getting started myself), but you could always add two triggers, one for each state change. I do this for a few of my automations and it works like a charm.

Interested to see if there’s a way like you are trying to do though!

Edit: spelling

I just ran across this bug, it still exists today. seems like a small thing, but it breaks my automation every time i go back into the UI and make a change…

so the Trigger goes from a single:

entity_id: media_player.media_room_tv_sys
platform: state
to:
  - idle
  - playing
from: 'off'

to 2 triggers:

trigger:
  - entity_id: media_player.media_room_tv_sys
    platform: state
    to: idle
    from: 'off'
  - platform: state
    entity_id: media_player.media_room_tv_sys
    to: playing