Dim lights when playing media - Only works with Youtube, not Plex?

    automation:
  - alias: "Media player paused/stopped"
    trigger:
      - platform: state
        entity_id: media_player.stue
        from: 'playing'
        to: 'paused'
    action:
        service: scene.turn_on
        entity_id: scene.livingroom_normal

  - alias: "Media player playing"
    trigger:
      - platform: state
        entity_id: media_player.stue
        to: 'playing'
        from: 'paused'
    action:
        service: scene.turn_on
        entity_id: scene.livingroom_dim

That’s the code i have. It works as intended when i cast Youtube to the Chromecast, but not with Plex? With plex it only dims the lights, it does not turn the brightness up again when i pause.

Thanks.

Check the state of media_player.stue on the States page when pausing Plex. Is it ‘paused’, or something else?

EDIT: Actually, if the dimming works, then it must be going from ‘paused’ to ‘playing’. If it’s not turning up the lights, then maybe it’s not going directly from ‘playing’ to ‘paused’. Maybe it’s going to some intermediate state between them, in which case the trigger would not fire. Try removing the from: 'playing' option from the trigger. Then it wouldn’t matter what state it is in before ‘pause’, and whenever it transitions to ‘pause’ it should work.