Hi, I am looking for a LED ceiling light for the hallway, with PIR motion sensor and Wifi or Zigbee connection to use with HA.
I have no switches in hallway, just a single 230V cable in the middle of the ceiling.
I know there are ceiling lights with PIR sensor, but I couldn’t find any with some kind of connectivity.
Also I would like to avoid the option of having separate battery powered Zigbee PIR sensor and using Wifi ceiling light as I would like this to work even if HA or network go down.
Does anyone know about such a light? I could hack some standard PIR ceiling light by adding ESP and a relay, but first if there is some ready made solution, it would be hassle free.
I actually ended up doing what I said in the original post, bought a cheap ceiling light from Aliexpress, then I added ESP, micro power supply, relay, PIR sensor, light sensor and also some WS2812LEDs to server as night light so the full panel doesn’t burn your eyes out in the night. You can get a lot of lights with PIR, and lights with either wifi or zigbee, but I didn’t find any that has both.
I know you have already found a solution, however in case you @InToSSH have another need or some else @Kaizen28 does. I have successfully been using several of the TUYA MCU based lights for almost two years now with 100% local WiFi control via the Open Beken project. You can now install espHome firmware on these as well. While I have not added a light sensor to this particular Tuya device, I have hardware ‘augmented’ other devices where I have replaced the firmware with Open Beken. The specific Taloya device I have worked with is 120 volt USA power, however I am pretty sure they sell the same device with 220 volt RoW support.
I think there are several I/O pins unused and available on this device, see picture below.
The light control uses, note pin number are logical not physical:
P9 PWM 1 Red
P24 PWM 2 Green
P26 PWM 3 Blue
P8 PWM 4 Cool White
P6 PWM 5 Warm White
Link below is for the units I have used. Video below is a good intro to converting these Tuya devices to 100% local control. The two pictures below might give you an idea of the physical space you have available to work with. This specific model requires a physical connection to the Tuya MCU in order to replace the firmware, some other devices can be converted using a software only method, known as ‘Tuya Cloud Cutter’, github link below. However, since you need to open the device to add a light sensor, you are there anyway.
Just make sure you do all of your flashing and experimenting with the light physically disconnected from the mains power! Also, this specific device needs a strong 3.3 volt power input during the flashing, so some USB to serial adapters do not push thru enough power.
Thank you for a great tutorial. This light looks really nice, I like the RGB ambient feature which would replace the night light mode I have in my light. Too bad it also doesn’t have a PIR sensor, but I guess I could always place an external zigbee PIR in the room. Also thanks for the Open Beken project, I didn’t know about this project and I have a few Tuya devices with those new chips.
I should have expanded more on my point. While I have not done this hook up specifically, I am fairly sure you could physically add a BH1750 light sensor (or similar with a form factor that might work differently/better, there is lots of unused room inside this light, and I think the power supply is more than capable) (and maybe also one of the new fancy radar based people sensors) via I2C to the micro controller on the light and then program your functions using espHome. Good hunting!
No I think you explained it well and as you mentioned it should have some free GPIOs I was thinking about the same, however the light sensor needs specific placement to not be affected by the light coming from the lamp itself, so it would require some tinkering with the cover.
I also have those radar modules, they would be suitable, however one issue with them I found is that since our hall is rather narrow, the radar gets activated even through walls and doors, which results in the light being turned on even if I move in my bed, thats why I didn’t even use the radar on the light I currently have, even though it would be much simpler without the “bulb” sticking out.
Depending on the placement of the actual LED board/strip inside the light it could still be possible to drill a hole in the middle of the light and put a standard PIR sensor inside and connect it to those GPIOs.