Brief background, I have a Sonoff ifan02 connected to ceiling fan, and a Sonoff T1 wall switch.
Both flashed with EspHome.
I want to be able to increment the fan speed when pressing a button on T1, and ultimately switch it off.
Off>Low>Medium>High>Off, alternatively toggle between Off and Low.
It’s easy enough to use the home assistant service fan.set_percentage to turn it on, but my lack of knowledge on templates/lambdas (I assume that’s what I should use) and HA in general keep me from achieving the goal.
wall_switch - yaml binary_sensor: - platform: gpio pin: number: GPIO9 mode: input: true pullup: true inverted: true id: button_2 on_press: - homeassistant.service: service: fan.set_percentage data: #don't know how to change and check for existing fan state, and toggle as required percentage: '6' entity_id: fan.study_fan # then: # - light.toggle: light_2
I will also be using this in 4 other rooms, as well as a central NSPanel.
Thanks in advance for any assistance