Setting ESPhome LEDC PWM duty cycle in a scene

Hi,

I’m new to HA and ESPhome but slowly trying to figure out a green house watering system. I am almost there but have one final stumbling point I cant figure out. I have managed to get my head around hardware, ESP32 electronics and a PWM motor control for a fertilizer dosing pump. I used the LEDC output control to set the PWM to 70% on odd days and 0% (off) on even days. (water every day and fertilise every other). I created 2 scenes; one “water only”: (pump+greenhouse valve ON, LEDC PWM 0% off) the other “fertilise”: (pump+greenhouse valve ON, LEDC PWM 70%). The 2 scenes are called each day alternately at 7PM. When I set up the 2 scenes, it seems however that the 70% setting is transferred between the two, which is not what’s needed. When I move the slider on one scene it affects the other. I am looking for something like a bit of YAML (with output.set_level:) for the scene that I can set the “fertilise” scene to 70% but can’t figure how to do this. Grateful for any help. Please ask if I need to clarify anything. Thanks, Ian.

Stop using scenes, start using automations or scripts.

After last night’s tinkering session, that was dawning on me. Thanks for the steer. Will have another go later.

1 Like