Hi all!
So I already have some under cabinet LED lights that I’ve built and integrated with home assistant, BUT! I feel like the solution isn’t all that clean and it has a few small bugs.
I wanted to see if there are any integrations that exist that basically do what I want, but in a better way.
My current setup is as such:
ESP8266 as the controller. It has a cheap PIR sensor attached to to automatically turn the lights on and off. It also has a transistor to PWM the LED strip to fade them on and off.
It does something a little special where it has a certain (hardcoded) brightness level for fade on when the sun is up and a different one for when the sun is down. Primarily for when I wake up at 2am to get water from the sink I don’t get blinded.
I also have an on off “switch” and a brightness slider in home assistant so I can manually control them if I’m cooking, have people over, etc. When I turn this switch on it overrides the lights and the brightness is set from HA. When I turn it off it resumes automatically fading on and off.
Are there any integrations that support auto on and off + manual on and off in one HA switch box? Even that would be kinda nice over what I currently have. I can handle the integration on the hardware side.
Here is my mediocre code on the ESP side: https://github.com/reportingsjr/cabinet_light_control/blob/master/firmware/firmware.ino
It is pretty much just a small state machine. The main things I want to change is the complete reliance on an internet connection and home assistant (if my computer dies I still want to have nice lights!). I’m going to add a physical on/off button to the ESP first though. I also want to clean up the logic. It has gotten a little hairy, particularly in the MQTT part of things.