Automation: cancel if state is changed

I have a Sonos Playbar with two One’s. In one automation I want to make I want to power off the back speakers with a Sonoff. When you change a input channel or change a radio station, the Sonos will trigger a ‘paused’ and ‘playing’ right next to eachother.

Can I use a delay somewhere to tackle this to prevent the speakers going off and on again within a second? I tried delaying the Action, but then it just delays the action (duhh). The automation should only run if the ‘paused’ state is longer then 1 minute or something like that. Delay is not provided in the Trigger section.

You’re using a state trigger yeah?

Look into the ‘For’ argument/parameter in your trigger.

Phone posting at the moment so a little light on detail sorry!

Yes, that was it!

For someone looking for the answer;

- id: 'xxx'
  alias: Sonos erker uit
  - entity_id: media_player.woonkamer
    for: '5'
    from: playing
    platform: state
    to: paused
  condition: []
  - data:
      message: Sonos erker uit
    service: notify.ios_iphone_van_xx