When I turn on fan with “switch.kitchen_hood_fan_on_off” fan always start on speed 2.
Automation must first start fan and decrise speed to 1 when I move slider from 0 to 1. Then must increse/decrese speed when I move slider 1-5. When I put it back to 0 must turn off fan.
There is working automation for IR FAN SPEED CHANGE:
- alias: Set fan speed 0.0 to 1.0
trigger:
platform: state
entity_id: input_number.kitchen_hood_fanspeed
# Optional
from: '0.0'
# Optional
to: '1.0'
action:
- service: switch.turn_on
entity_id: switch.kitchen_hood_fan_on_off
- service: switch.turn_on
entity_id: switch.kitchen_hood_fan_down
- alias: Set fan speed 1.0 to 0.0
trigger:
platform: state
entity_id: input_number.kitchen_hood_fanspeed
# Optional
from: '1.0'
# Optional
to: '0.0'
action:
service: switch.turn_on
entity_id: switch.kitchen_hood_fan_on_off
- alias: Set fan speed 1.0 to 2.0
trigger:
platform: state
entity_id: input_number.kitchen_hood_fanspeed
from: '1.0'
to: '2.0'
action:
- service: switch.turn_on
entity_id: switch.kitchen_hood_fan_up
- alias: Set fan speed 2.0 to 1.0
trigger:
platform: state
entity_id: input_number.kitchen_hood_fanspeed
from: '2.0'
to: '1.0'
action:
service: switch.turn_on
entity_id: switch.kitchen_hood_fan_down
- alias: Set fan speed 2.0 to 3.0
trigger:
platform: state
entity_id: input_number.kitchen_hood_fanspeed
from: '2.0'
to: '3.0'
action:
- service: switch.turn_on
entity_id: switch.kitchen_hood_fan_up
- alias: Set fan speed 3.0 to 2.0
trigger:
platform: state
entity_id: input_number.kitchen_hood_fanspeed
from: '3.0'
to: '2.0'
action:
service: switch.turn_on
entity_id: switch.kitchen_hood_fan_down
- alias: Set fan speed 3.0 to 4.0
trigger:
platform: state
entity_id: input_number.kitchen_hood_fanspeed
from: '3.0'
to: '4.0'
action:
- service: switch.turn_on
entity_id: switch.kitchen_hood_fan_up
- alias: Set fan speed 4.0 to 3.0
trigger:
platform: state
entity_id: input_number.kitchen_hood_fanspeed
from: '4.0'
to: '3.0'
action:
service: switch.turn_on
entity_id: switch.kitchen_hood_fan_down
- alias: Set fan speed 4.0 to 5.0
trigger:
platform: state
entity_id: input_number.kitchen_hood_fanspeed
from: '4.0'
to: '5.0'
action:
- service: switch.turn_on
entity_id: switch.kitchen_hood_fan_up
- alias: Set fan speed 5.0 to 4.0
trigger:
platform: state
entity_id: input_number.kitchen_hood_fanspeed
from: '5.0'
to: '4.0'
action:
service: switch.turn_on
entity_id: switch.kitchen_hood_fan_down
But I have two problems. If I move slider up and down for one step at the time automation working. If I move fast from 1 to 5 nothing hepend. And I fan is manualy turned on and left on eg. speed 3 automation can’t check if fan is on or off and what speed is (this problem can’t be solved because of fan is ir I cen live with that or I can put some power meter before fan). But first problem probably can be solved somehow? Can automation like this be shorter?