banner-card
banner-card copied to clipboard
Icons for switch and light is not working
Banner card version: 0.13.0 Home Assistant version: 2021.4.3
Card configuration:
type: 'custom:banner-card'
heading:
- Kitchen
background: '#81559B'
entities:
- entity: light.kitchen
name: Light
value: 'mdi:ceiling-light'
- entity: switch.kitchen_tv
value: 'mdi:television'
name: TV
Result:
Solution is simple. Overwrite with domain: sensor
See sample:
- entity: switch.switch
name: Is it on?
domain: sensor
value: mdi:star
color: black
map_state:
"on":
color: yellow
An issue with this solution is that when using domain: sensor
to force the icons, the switch no longer responds to a single click to toggle the light, and instead opens the details panel for the entity.
Is there a way around this? I would normally expect a press
to toggle an entity, and a hold
to open the details panel.
EDIT: I got it sorted. I didn't realise you could call services discretely from Lovelace cards themselves! I always thought they needed to be defined in config - but there you go, I learned something great today.
- entity: light.lounge
domain: sensor
action:
service: light.toggle
entity_id: light.lounge
name: Room Light
value: mdi:ceiling-light
color: white
map_state:
'on':
color: yellow
Interestingly, though, when using the action
property, the icons lose their hover mouse-cursor. Not a huge deal since we're mostly using HA on the phone, but worth pointing out.
Thank you guys for the workaround, I got my icons working again since downgrading from extended-banner-card, after it broke in 2021.11. Is there any chance we could get the icons working without having to change the domain to sensor and add an action that calls a service in this card? Thanks!