Automation trigger from either of 2 specific states to any other state except those 2. How to?

I had some nice automations running that turned on/off speakers automatically when I spotify connect to a certain Google Cast device. Now recently either something on Spotify or my network changed or the “buffering” state has only been recently added to spotify/google cast in Hass. This buffering state messes up my automations. So for example the current turn off speakers automation is this:

alias: Turn off eetkamer speakers
description: Turn off eetkamer speakers after 5 minutes idle
trigger:
  - platform: state
    entity_id: media_player.eetkamer_speaker
    id: eetkamer_speakers_stopped_playing
    from: playing
    for: "00:05:00"
condition: []
action:
  - service: switch.turn_off
    target:
      entity_id: switch.on_off_plug_speakers_eetkamer
    data: {}
mode: single

So this should now change to something like:
from: “playing” or “buffering”
to: any state except “playing” or “buffering”

Similarly for the turn on automation it should not just be a trigger with to: “playing”
but something like to: “playing” or “buffering”

Thanks!!

Oops, never mind, RTFM :stuck_out_tongue:

It’s possible to give a list of from states or to states:

1 Like

There’s also not_to and not_from

1 Like

Apparently I indeed also need these, because it still triggers when I have:
from:

  • playing
  • buffering

and state goes from buffering to playing :frowning: