Building a Custom Smart Night Light for My Son, With MQTT and Home Assistant

Overall this project was a lot of fun to put together and my son really enjoys his new night light.

Building a Custom Smart Night Light for My Son, With MQTT and Home Assistant

Recently my mom moved the location of her business and in doing so we needed to remove the old signage above the entrance. As we were working I came up with an idea to repurpose one of the letter to the sign, I could build a night light for my two year old son Lincoln. Of course I couldn't just put some lights in it and call it a day, I had to find a way to connect it to Home Assistant.

The Original Sign the Letter Came From

I got the giant letter "L" home and started working on cleaning it up and taking it apart. I started by removing the LED lights that were currently installed. My next step was to start digging through all of my miscellaneous parts I had for my development boards. As I dug up new LEDs and resistors I came up with a plan.

Pico Powered Night Light

Using a Raspberry Pi Pico W I had laying around I started to build my project. First I needed to program my Pico to turn the lights on and off, once I was satisfied with how many LEDs I needed I started laying them out in the sign.

To be honest this was a quickly put together project and I didn't have time to look for a new way to fasten the LEDs into the sign, so duct tape will have to do.


Building the Automation

After getting the LED lights installed to my liking I programmed the Raspberry Pi Pico to connect to my WiFi and MQTT broker. Programming it to listen for the topic "nightlight" I can now send it commands to turn on and off.

Now fully assembled and programmed it was time to come up with some automations I can use in Home Assistant. I decided that I want the night light to turn on and off automatically when my sons door is closed at night between a certain time frame. Using a Zigbee door sensor I set up an automation to turn the light on only if it was after 8pm and his door was closed. Next I created another automation to turn the night light off if his door was opened after 6am. So far this has been working really well, allowing the light to turn on at night when he goes to bed and off again when he gets up in the morning.


The finished Project

Overall this project was a lot of fun to put together and my son really enjoys his new night light. In the future I may try to mount it on the wall and run a power source through the wall for it, but for now it's working great where its at.