Anyone have any ideas how to make an icon for a media player in the room card show on/off status? Media players under developer tools â states, show
off, idle, standby, playing
But donât actually show an âonâ state, which I believe the room card relies on an on/off state
https://ui-lovelace-minimalist.github.io/UI/usage/cards/card_room/
- type: "custom:button-card"
template:
- card_room
- purple_no_state
name: Living Room
entity: light.couch_lamp_zha_group
icon: mdi:sofa
tap_action:
action: navigate
navigation_path: "living_room"
variables:
label_use_temperature: false
label_use_brightness: false
entity_1:
entity_id: light.couch_lamp_zha_group
templates:
- yellow_on
tap_action:
action: toggle
entity_2:
entity_id: media_player.living_room_nvidia_shield
templates:
- blue_on
tap_action:
action: call-service
service: media_player.turn_on
service_data:
entity_id: media_player.living_room_nvidia_shield
hold_action:
action: call-service
service: media_player.turn_off
service_data:
entity_id: media_player.living_room_nvidia_shield
Any tips would be appreciated, Iâve tried searching and am coming up dry.
EDIT:
I tried adding a template state - which also didnât work
entity_2:
state: >
{% set lrs = states('media_player.living_room_nvidia_shield') %}
{{ 'on' if lrs != 'off' else 'off' }}
entity_id: media_player.living_room_nvidia_shield
templates:
- blue_not_off
tap_action:
action: call-service
service: media_player.turn_on
service_data:
entity_id: media_player.living_room_nvidia_shield
hold_action:
action: call-service
service: media_player.turn_off
service_data:
entity_id: media_player.living_room_nvidia_shield
So I ended up going to here and making âblue_not_off.yamlâ template as well as one for green, yellow, pink, red, and purple
/config/custom_components/ui_lovelace_minimalist/__ui_minimalist__/ulm_templates/card_templates/colors/
example template
---
blue_not_off:
state:
- styles:
icon:
- color: "rgba(var(--color-blue),1)"
label:
- color: "rgba(var(--color-blue-text),1)"
name:
- color: "rgba(var(--color-blue-text),1)"
img_cell:
- background-color: "rgba(var(--color-blue), 0.2)"
card:
- background-color: "rgba(var(--color-background-blue), var(--opacity-bg))"
id: "not_off"
operator: template
value: >
[[[
return (entity.state != "off" )
]]]
# Legacy
blue:
template: "blue_not_off"