Dimming lights when plex is playing

I have a question on the coding for automated lighting here what i have:

  • action:
    • alias: Lights on
      data:
      brightness_pct: ‘25’
      entity_id: light.smart_dimmer_level
      transition: ‘3’
      service: light.turn_on
      alias: Plex cast Playing to Paused
      condition:
    • condition: template
      value_template: states.media_player.living_room.attributes.app_name = Plex

value-template: ‘{{ states.media_player.cr_chromecast.attributes.app_name == “Plex” }}’
even replacing the vakue doesn’t work. Im using the automation template under configuration.

I don’t see a trigger, and your formatting is off - can you read the large blue box at the top please, and then edit your post and mark the YAML with </> so that we can see the actual spacing, etc.

- action:
  - alias: Lights on
    data:
      brightness_pct: '25'
      entity_id: light.ge_15294_inwall_smart_dimmer_level
      transition: '3'
    service: light.turn_on
  alias: Plex cast Playing to Paused
  condition:
  - condition: template
    value_template: states.media_player.living_room.attributes.app_name = Plex
  id: '1508825255892'
  trigger:
  - entity_id: media_player.living_room
    from: playing
    platform: state
    to: paused

The problem is with your template, it’s not a template :wink:

It should be:

value_template: '{{ states.media_player.living_room.attributes.app_name == "Plex" }}'

or

value_template: '{{ is_state_attr("media_player.living_room", "app_name", "Plex") }}'

Ill give that a shot

Seems to work now after an update. thanks