Nic0205
(Nic0205)
April 29, 2017, 6:30am
1
Hey there,
I´ve created a sensor template for a shutter:
sensor:
- platform: template
sensors:
wz_v:
value_template: '{% if(states.cover.KEQ0879052.attributes.current_position > 0) %} offen {% else %} zu {% endif %}'
friendly_name: 'WZ vorn'
I´d like to colorize or switch an icon instead of using the strings “offen” or “zu”.
I know I can add an custm icon, but this icon does not change the color if the state/level changes.
Is there a possibility to do this? The cover Icon in a group works great, but how could i get the same mechanism to the badge?
Greetings Dominic
Hi @Nic0205 , you can use the device class of a binary sensor to change the icon, but not the color.
Nic0205
(Nic0205)
May 1, 2017, 8:43am
3
Hi @VDRainer
thank you for replying.
Changing the icon would last for me, but if I use the binary sensor, then there are a lot of device classes, but none for roller shutters - or am I missing something?
Greetings
Nic
Nic0205
(Nic0205)
May 6, 2017, 8:47pm
4
Nobody here who had the same problem?
You can change the icon in a template_sensor: https://home-assistant.io/components/sensor.template/#change-the-icon .
Sorry, missed that in my first post.
Nic0205
(Nic0205)
May 7, 2017, 10:23am
6
@VDRainer thanks again.
I tried it but in the badge appears just the Text and no Icon at all?
Am i doing something wrong?
Seems like this doesn’t work for badges, only for grouped sensors on cards .