I am somewhat new to home assistant and I want to create an automation that when I press the power on button on my zwave switch, if the ceiling fan is already on, it increases the speed of the fan. If its already on high it goes to the lowest speed.
I created an automation but its not triggering for some reason
alias: Master Fan Speed
description: Set fan speed when the fan is already on
trigger:
- platform: device
type: turned_on
device_id: 23cae5913868b362bf111063cb198941
entity_id: fan.gezwavemasterfan
domain: fan
condition:
- condition: device
device_id: 23cae5913868b362bf111063cb198941
domain: fan
entity_id: fan.gezwavemasterfan
type: is_on
action:
- if:
- condition: numeric_state
entity_id: fan.gezwavemasterfan
above: 1
below: 50
attribute: fan.percentage
then:
- service: fan.set_percentage
target:
entity_id:
- fan.gezwavemasterfan
data:
percentage: 66
- if:
- condition: numeric_state
entity_id: fan.gezwavemasterfan
above: 51
below: 75
attribute: fan.percentage
then:
- service: fan.set_percentage
target:
entity_id:
- fan.gezwavemasterfan
data:
percentage: 99
- if:
- condition: numeric_state
entity_id: fan.gezwavemasterfan
above: 76
below: 100
attribute: fan.percentage
then:
- service: fan.set_percentage
target:
entity_id:
- fan.gezwavemasterfan
data:
percentage: 33
mode: single
I can see messages in the console
ge-zwave-master-fan turned on triggered by service fan.set_percentage