Hey everyone, I wanted to share my recent experience setting up a smart lighting automation system using Node-Red. It’s been a fantastic journey, and I’m thrilled with the results!
The Goal
I’ve always wanted my lights to automatically adjust based on motion and time of day. After some research, I decided to use Node-Red to create a custom automation flow. The idea was simple: when motion is detected, the lights should turn on to 100% during the day and 10% at night. After 5 minutes of no motion, the lights should turn off. Additionally, if the motion automation is turned off, the lights should stay off after 30 minutes of inactivity.
The Setup
I started by setting up an input boolean to control the motion automation. This allows me to easily toggle the automation on or off. I then connected this to a time of day boolean to determine whether it’s day or night. Using Node-Red’s built-in functions, I created a flow that checks for motion, evaluates the time of day, and adjusts the light levels accordingly.
The Challenges
Initially, I faced some issues with the timing and ensuring the automation worked seamlessly. For instance, I had to make sure that the 5-minute delay didn’t interfere with the 30-minute override when the automation was turned off. After some trial and error, I realized that using a combination of delay nodes and state checks was the key to getting everything to work smoothly.
The Results
I’m thrilled to say that the system works perfectly now! During the day, the lights brighten up the room when motion is detected, and at night, they provide just enough light to navigate without being too harsh. The automation also ensures that the lights turn off after a period of inactivity, which is great for energy efficiency.
Tips for Others
If you’re looking to set up something similar, here are a few tips:
- Start with a simple flow and gradually add complexity.
- Use debug nodes to troubleshoot and ensure everything is working as expected.
- Don’t hesitate to experiment with different timing settings to find what works best for your lifestyle.
This project has been a fantastic way to dive deeper into Node-Red and smart home automation. It’s amazing how much you can customize and automate with the right tools!
Happy automating everyone! ![]()