Hi,
I already have this working (fan is red and rotating) :
type: picture-elements
elements:
- type: state-icon
entity: climate.airco_living
icon: mdi:fan
tap_action:
action: call-service
service: script.airco_togglen
data:
entity_id: climate.airco_living
use_last_modus: "on"
target: {}
state_color: false
style:
top: 10.5%
left: 6%
"--paper-item-icon-color": red
card_mod:
style:
state-badge:
$:
ha-state-icon:
$:
ha-icon:
$: |
ha-svg-icon {
{% if is_state('binary_sensor.airco_living_is_on', 'on') %}
animation: rotation 2s linear infinite;
{% endif %}
}
@keyframes rotation {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
image: /local/images/floorplan/downstairs/a downstairs floorplan.png
But when I put this code in a conditional card, it is not rotating anymore :
type: picture-elements
elements:
- type: conditional
conditions:
- condition: state
entity: input_boolean.toggle_airco_living_actief
state: "on"
- condition: state
entity: binary_sensor.airco_living_is_on
state: "off"
elements:
- type: state-icon
entity: climate.airco_living
icon: mdi:fan-off
tap_action:
action: call-service
service: script.airco_togglen
data:
entity_id: climate.airco_living
use_last_modus: "on"
target: {}
state_color: false
style:
top: 17.5%
left: 6%
"--paper-item-icon-color": white
- type: conditional
conditions:
- condition: state
entity: input_boolean.toggle_airco_living_actief
state: "on"
- condition: state
entity: binary_sensor.airco_living_is_on
state: "on"
elements:
- type: state-icon
entity: climate.airco_living
icon: mdi:fan
tap_action:
action: call-service
service: script.airco_togglen
data:
entity_id: climate.airco_living
use_last_modus: "on"
target: {}
state_color: false
style:
top: 17.5%
left: 6%
"--paper-item-icon-color": red
card_mod:
style:
state-badge:
$:
ha-state-icon:
$:
ha-icon:
$: |
ha-svg-icon {
{% if is_state('binary_sensor.airco_living_is_on', 'on') %}
animation: rotation 2s linear infinite;
{% endif %}
}
@keyframes rotation {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
- type: state-icon
style:
left: 6%
top: 50%
entity: sensor.sfeer_avond
icon: mdi:air-filter
image: /local/images/floorplan/downstairs/a downstairs floorplan.png
What am I missing here ?