Hey everyone, I wanted to share my experience setting up a night mode in my home using motion sensors and automation. It’s been a game-changer for creating a relaxing and safe environment, especially with a newborn in the house. Let me walk you through how I did it and some tips I’ve picked up along the way.First, I started by identifying the key areas where night mode would be most beneficial—primarily the bedrooms and living areas. I decided to use motion sensors to detect when someone enters these spaces, as this would allow me to automate the lights and other devices accordingly.I chose the Aeotec Z-Wave Motion Sensor for its reliability and integration with my existing Z-Wave setup. These sensors are perfect because they can detect motion even in low-light conditions, which is essential for night mode. I placed them strategically near the doors and in the corners of the rooms to ensure comprehensive coverage.Next, I set up the automation rules in my Home Assistant configuration. The goal was to dim the lights slightly when motion is detected, providing enough illumination without being too harsh. I also wanted to ensure that the lights wouldn’t stay on indefinitely, so I added a delay to turn them off after a period of inactivity. Here’s a quick breakdown of how the automation works:1. Motion Detected: When the sensor detects motion, it triggers the automation.2. Dim Lights: The lights in the room dim to a preset level (I found 30% to be ideal for night mode).3. Set Timer: A timer is set to turn the lights off after 15 minutes of no further motion.4. Reset Timer: If motion is detected again before the timer runs out, the timer resets.One thing I struggled with initially was getting the lights to dim smoothly without flickering. After some research, I discovered that using a dimmable LED bulb was crucial for a seamless experience. I also learned that adjusting the transition time in the light settings could help prevent any sudden changes in brightness.Another feature I added was integrating the night mode with my smart thermostat. When the lights dim, the thermostat adjusts the temperature slightly to create a more comfortable environment. This might seem like a small detail, but it makes a big difference in overall comfort.I also wanted to ensure that the system was as user-friendly as possible. I created a scene in my Home Assistant setup called “Night Mode,” which allows me to manually trigger the automation if needed. This has been especially handy when I’m not sure if the sensors will detect motion correctly.One thing I’d like to improve is adding more granular control over the lights. For example, I’d love to have different brightness levels based on the time of night or the specific room. I’m also considering integrating sound effects, like soft background music, to enhance the calming atmosphere further.Overall, setting up this night mode system has been a fantastic project. It’s not only improved the comfort of my home but also given me a deeper appreciation for the capabilities of smart home automation. If you’re thinking about something similar, I highly recommend starting small and gradually adding features as you become more comfortable with your system.Thanks for reading, and feel free to share your own night mode setups or tips in the comments! I’d love to hear how others are tackling this challenge.