I love reading before bed, but I always forget the time and have to find the right button to turn off the bedside lamp. This is one of those tiny annoyances that’s perfect for home automation.
The beauty of this solution is its simplicity: the Kindle only connects to Wi-Fi when you turn it on, making it a perfect trigger for automation.
When you activate your Kindle, it connects to your Wi-Fi network. Home Assistant detects this through a device tracker and starts a 10-minute timer. After the timer expires, your bedroom lights gradually fade out.
I added a time condition to prevent the lights from turning off too early in the evening - nobody wants their lights to go out at 7 PM just because they picked up their Kindle.
Create an automation with the following configuration:
1alias: "Bedroom: Turn off night lamp after 10 minutes of reading" 2description: "" 3mode: single 4triggers: 5 - entity_id: 6 - device_tracker.kindle 7 to: home 8 trigger: state 9conditions:10 - condition: time11 before: "23:59:58"12 after: "21:00:01"13actions:14 - delay:15 hours: 016 minutes: 1017 seconds: 018 milliseconds: 019 - data:20 transition: 521 target:22 area_id: bedroom23 action: light.turn_off
Important: Replace bedroom with your bedroom area ID, or use specific entity IDs if you haven’t configured areas in Home Assistant.
The transition: 5 parameter gradually dims the lights over 5 seconds, preventing the jarring experience of sudden darkness when you’re likely already half asleep.
If your Kindle doesn’t appear as a device tracker yet, you’ll need to add it:
device_tracker.kindle)That’s it! A simple automation that makes bedtime just a little bit better.
You might find these related articles helpful or interesting, make sure to check them out!
I hope you found this article useful! 😊.