have this template binary_sensor:
- platform: template
sensors:
family_home:
friendly_name: 'Family home'
value_template: >
{{ is_state('group.family', 'home') }}
icon_template: >
{% if is_state('sensor.family_home','0') %} mdi:account-off
{% elif is_state('sensor.family_home','1') %} mdi:account
{% elif is_state('sensor.family_home','2') %} mdi:account-multiple
{% elif is_state('sensor.family_home','3') %} mdi:account-multiple-check
{% else %} mdi:account-group
{% endif %}
All is well, except the icon doesn’t show at all. I know the template is fine, and all entities exist etc, because in the dev-template this is the result:
we’re 4 at home now, so for testing purposes I changed the first elif to be set a 4:
should work…
still a no show in the frontend:
have a further customization set on the sensor, hence the ‘Occupied’ and icon_color (now invisible…):
binary_sensor.family_home:
show_last_changed: true
templates:
icon_color: >
if (state === 'on') return 'rgb(251, 210, 41)';
return 'rgb(54, 95, 140)';
_stateDisplay: >
if (state === 'on') return 'Occupied';
return 'Home alone';
some other sensors and groups:
tab/view:
so, if anyone had a eagle’s eye, id be glad to hear from you…
thx