I’ve looked at every example for PWM control of an ledc, triggered by a binary motion sensor. This yaml code works but motion turns it on and off WITHOUT PWM. If I use the buttons in Overview they preempt the binary trigger and turn on and off ledc WITH PWM. My ledc output circuitry is capable of driving a very powerful LED array, and PWM control is critical.
How can I get the ledc output to use PWM when triggered by the motion sensor?
Ive tried both “Esp32-S3-Devkitc-1”, and “adafruit_qtpy_esp32s3_nopsram”, both behave the same.
I am planning of making a second cut of my Light Controller PCB, and I would be happy to accept advice on pin-out changes for compatibility, or any reasonable features to add. Currently I’ve included a Panasonic motion sensor, CDS photo-resistor light sensor, touch pad inputs, and the MOSFET has been upgraded to be able to control over 800 Watts with only a 7 degree rise above ambient. The light sensor was moved to GPIO9 (A2) because of a conflict with WiFi using bank ADC2 channels.
As an amendment to my original post, I understand there might be a variable.value exchange code process, that could treat a separate configuration of a binary motion sensor to trigger an ledc type light as a separate config target device, that could be triggered via WiFi delay back & forth, is arguably satisfactory, but I must disagree on shear local hardware signal efficiency grounds.
Please forgive me as a double-E, who is weak on software, but a target device (PWM ledc) should be available for PWM on/off control from a binary motion sensor resident on the same hardware!
I don’t reach out very often, but I consider Home Assistant as a very worthy pursuit!
Thank you in advance!
I found a very close example that has pretty much solved my programming weakness. I would like to thank Wojtek80, truglodite, and Klops.
The following works well, the PIR motion sensor now controls the ledc (output_componet1) with smooth PWM, and now the buttons in the overview turn the ledc on and off without PWM, but that is OK. If I ever develop an “alarm state” automation then turning on/off these light without PWM is a good warning signal!
Next is to calibrate the cadmium photo-resistor for Lux output, and choose a level where I don’t want the light turned on, or have it turn on dimly, as I stumble around the house at night, when I don’t want bright lights!
Again, thanks go to Wojtek80, Truglodite, and Klops!!!