Chromecast Play Automation

Hello, somebody can tell me what i do wrong with this automation?

- alias: Chromecast Play
  trigger:
    - platform: template
      value_template: "{{ is_state('media_player.living_room_tv.app_name', 'YouTube') }}"
  condition:
    - condition: state
      entity_id: sun.sun
      state: 'above_horizon'
  action:
  - service: scene.turn_on
    entity_id: scene.LivingRoom_Movie
  - service: cover.close_cover
    entity_id: cover.curtains

Something is wrong with:

    - platform: template
      value_template: "{{ is_state('media_player.living_room_tv.app_name', 'YouTube') }}"

Try this:

    - platform: template
      value_template: "{{ is_state_attr('media_player.living_room_tv', 'app_name', 'YouTube') }}"