Question about configuration and picture entities

Hi HA collegues,

I have weird thing going on or im missing something, does somebody know how i can fix this?

Scenario:

Made a sensor which makes a sensor based on a media.player its attribute:

  - platform: template
    sensors:
      htpc_source_slaapkamer:
        value_template: '{{ states.media_player.htpc_01.attributes["source"] }}'
        friendly_name: 'HTPC Source Slaapkamer'

This creates: [sensor.htpc_source_slaapkamer] which has as state the source of the htpc

i like to have Tiles on my screen to press buttons to start an activity but im stuck with the problem that when the state is not as example YouTube the card will grey out.

It works on my light so i tought i would make the change in the code from:

elements:
  - entity: light.group_tv_verlichtingen
    image: /local/images/tvlights.png?v=1
    state_filter:
      'on': brightness(120%) saturate(1.2)
    style:
      left: 50%
      top: 50%
      width: 100%
    tap_action:
      action: toggle
    type: image
image: /local/images/tvlights.png?v=1
type: picture-elements

to something like:

elements:
  - entity: sensor.htpc_source_slaapkamer
    image: /local/icons/activities/youtube.png?v=1
    state_filter:
      YouTube: brightness(100%) saturate(1.2)
    style:
      left: 50%
      top: 50%
      width: 100%
    tap_action:
      action: toggle
    type: image
image: /local/icons/activities/youtube.png?v=1
type: picture-elements

But in this example it doesnt grey out, only the brightness get lower:

I hope somebody has a working example and my post is understandable as my english is not my mothers language

I made a video to try to give a explainaition cause im not sure if mypost is clearly anough, again thank you

I solved it myself with the following code:

elements:
  - entity: sensor.htpc_source_slaapkamer
    image: /local/icons/activities/plex.png?v=1
    filter: brightness(50%)
    state_filter:
      Plex: brightness(200%) saturate(1.2)
    style:
      left: 50%
      top: 50%
      width: 100%
    tap_action:
      action: call-service
      service: script.start_plex
    hold_action:
      action: more-info
    type: image
image: /local/icons/activities/plex.png?v=1
type: picture-elements

and made a script for each activity:

start_plex:
  alias: Start Plex
  sequence:
  - service: media_player.select_source
    target:
      entity_id: media_player.htpc_01
    data:
      source: Plex
  - service: remote.turn_on
    target:
      entity_id: remote.skynet
    data:
      activity: '49023583'
  mode: single
1 Like