Chromecast playing/inactive problems

I have an automation the triggers every time chromecast is set to playing but when it’s changing to the next episode it’s inactive for a few seconds and then back to playing witch triggers the automation again.
Is there a way to fix this?

What about showing us what you have done and get the formatting right plz

alias: 'soundbar: tv of cast aan sound on'
description: ''
trigger:
  - platform: device
    device_id: cfa1dc98b87ecd774dd66e2ba08c0c0c
    domain: media_player
    entity_id: media_player.mediabox_2
    type: playing
  - platform: state
    entity_id: media_player.woonkamer
    to: playing
condition: []
action:
  - service: remote.send_command
    target:
      entity_id: remote.broadlink_pro_remote
    data:
      device: soundbar_woonkamer
      command: stroom
mode: single

Making sure the media_player was off is probably what you need.

alias: 'soundbar: tv of cast aan sound on'
description: ''
trigger:
  - platform: device
    device_id: cfa1dc98b87ecd774dd66e2ba08c0c0c
    domain: media_player
    entity_id: media_player.mediabox_2
    type: playing
  - platform: state
    entity_id: media_player.woonkamer
    to: playing
condition: 
  - condition: template
    value_template: >-
    {{ trigger.from_state.state == "off"}}
action:
  - service: remote.send_command
    target:
      entity_id: remote.broadlink_pro_remote
    data:
      device: soundbar_woonkamer
      command: stroom
mode: single

Before it goes to playing It’s inactive

Then make the condition inactive then.

But is inactive really the off state of your media_player? Sounds strange to me…

its a google chromecast
it goes from off to inactief to playing
and when it goes to the next episode its inactief for a few seconds and then back to playing


big picture

In that case it should be as I posted in the first place. off