How to Set Up Sunrise Offset Automation in Home Assistant

Hey everyone, I’ve been diving into automating my home using Home Assistant and wanted to share a neat setup I recently configured. I’ve always loved waking up with the sunrise, but I wanted to add a personal touch by controlling exactly when my lights start dimming based on the sunrise time. Here’s how I did it!

1. Understanding the Goal
I wanted my bedroom lights to start dimming 15 minutes before sunrise. This way, I can wake up naturally without the abruptness of a fully lit room. Plus, it adds a cozy touch to mornings!

2. Setting Up the Input
I used the input_select integration to create a dropdown menu in the frontend. This allows me to easily adjust the offset time without digging into the configuration files. Here’s a snippet of how I set it up:

yaml
input_select:
sunrise_offset:
name: Sunrise Offset
description: Offset time before sunrise
options:
- label: 15 Minutes
value: “00:15:00”
- label: 30 Minutes
value: “00:30:00”
- label: 45 Minutes
value: “00:45:00”

3. Configuring the Automation
Next, I set up an automation that triggers at sunrise, adjusted by the selected offset. Here’s the blueprint I used:

yaml
trigger:
platform: sun
event: sunrise
offset: !input sunrise_offset

action:
service: light.turn_on
data:
entity_id: light.bedroom_lights
brightness: 50
transition: 300

4. Testing and Tweaking
After setting everything up, I tested it by manually changing the offset in the frontend. It worked like a charm! The lights now dim gradually based on the selected time before sunrise. I even added a small note in my morning routine automation to remind me to check the offset if I’m adjusting my sleep schedule.

5. Sharing the Setup
If you’re interested in replicating this setup, feel free to use the snippets above. I’d love to hear how you customize it for your space! Maybe you could add a scene that also adjusts your window shades or plays some calming music alongside the lights.

This project has been a delightful way to enhance my mornings, and I hope it inspires you to explore more with automations in Home Assistant. Happy tinkering! :sun_with_face: