Is it possible to use and if template somehow for the icon? or any other possible way to fix it?
shortcuts:
columns: 4
column_height: 1
buttons:
- type: service
icon: |
[[[
if (states['input_boolean.pausa_badrum_musik'].state == 'off') {
return 'mdi:speaker-off';
} else {
return 'mdi:speaker-on';
}
]]]
id: input_boolean.toggle
data:
entity_id: input_boolean.pausa_badrum_musik
i also tried with a template sensor but no icon appers…
- icon: "{{ states('sensor.badrum_mute_icon') }}"
type: service
id: input_boolean.toggle
data:
entity_id: input_boolean.pausa_badrum_musik
- platform: template
sensors:
badrum_mute_icon:
friendly_name: ikea sensor mute icon
value_template: >
{% if is_state('input_boolean.pausa_badrum_musik', 'on') %}
'mdi:motion-sensor-off'
{% else %}
'mdi:motion-sensor'
{% endif %}