Smart Lighting Automation for Kids' Bedtime

I’ve been exploring ways to make bedtime smoother for my kids, and I think I’ve found a great solution using smart lighting and automation. Let me share my setup and some tips that might help others looking to do something similar!

First, I set up a bedtime routine that starts at 9:30 PM. The lights in their room dim gradually, signaling it’s time to wind down. By 10:00 PM, the lights turn off completely. But I wanted a way to handle those last-minute bathroom trips or quick story requests without manually turning the lights back on. Here’s how I tackled it:

I used two timers in my configuration. The first timer turns off the lights after 10 minutes of being on, ensuring no one forgets to turn them off. The second timer acts as a safeguard—if the lights are turned on again within 30 seconds, it cancels the automatic shutdown. This way, if someone quickly turns the lights on and off, the automation knows it’s just a short visit and doesn’t force the lights off prematurely.

Here’s a simplified version of what my config looks like:

yaml
automation:

  • id: bedtime_light_automation
    alias: Bedtime Light Automation
    trigger:
    • platform: state
      entity_id: switch.bedroom_light
      from: ‘off’
      to: ‘on’
      condition:
    • condition: time
      after: ‘22:00:00’
      before: ‘07:00:00’
      action:
    • service: timer.start
      entity_id: timer.sleep_light_timer
    • service: timer.start
      entity_id: timer.cancel_light_timer

This setup has been a lifesaver! It ensures the lights go off on time but still allows for quick adjustments. Plus, I added notifications to keep track of when the lights are turned on or off, which helps me monitor everything from my phone.

I’d love to hear how others handle bedtime routines or similar scenarios. Maybe there are even more efficient ways to achieve this! Let’s share ideas and make bedtime a little easier for everyone. :blush: