Hello,
I am trying to set state icons for different fan speed with image condition to show different fan speed animations (slow, medium and fast spinning fan) . I made 3 state icons ( speed 1 -20%, 2 - 45% and 3- 70’% and here I put just one example for speed 1 - 20%):
type: state-icon
icon: mdi:fan-speed-1
tap_action:
action: perform-action
perform_action: fan.turn_on
target:
device_id: 35e966f77d69905cb47824990424c8c2
data:
percentage: 20
state_color: true
entity: fan.fan_fan
title: fan speed 1
style:
left: 53.5%
top: 60%
and here is the code for condition to change animations based on pressed fan speed icons. I really don’t know how to set state_image (I also tried with 0.2, 0.45, 0.70 and with state icon titles) and whatever icon I pressed it just wan’t show the animation. If I put state “on” then will show only slow spinning fan animation (speed 1) regardless of speed. Please help me.
type: conditional
conditions:
- condition: state
entity: fan.fan_fan
state: “”
elements:
- type: image
style:
left: 44.5%
top: 62.7%
width: 14.5%
image: /local/fan_speed_1.gif
state_image:
“20%”: /local/fan_speed_1.gif
“45%”: /local/fan_speed_2.gif
“70%”: /local/fan_speed_3.gif