Morning Automation with Sunrise Consideration

I’ve been trying to perfect my morning routine automation, and I thought I’d share my journey and some tips in case others are tackling similar challenges. Here’s what I’ve been working on:

The Goal:
I wanted my lights to turn on automatically at 6:30 AM, but only if the sun hasn’t risen yet. This way, I don’t end up with bright lights shining through my curtains on those lazy summer mornings when the sun comes up much earlier!

The Setup:
I’ve configured an automation using the time trigger at 6:30 AM, and I’ve set a condition to check the sun’s elevation. If the sun is still below the horizon, the lights come on. It’s been working most days, but I noticed an issue today when the sun rose at 6:20 AM. The automation still triggered, which wasn’t what I wanted.

The Puzzle:
I’m a bit puzzled about the sun elevation value. What’s the magic number I should use to ensure the lights only come on when it’s still dark? I’ve been using -2, but maybe that’s not precise enough. I’d love to hear from others who’ve tackled similar automations—what values do you use for sunrise/sunset considerations?

Bonus Tip:
I also wanted to make sure the lights turn off right before sunrise again. I set up another automation with a numeric state condition, but I’m not entirely sure how the above/below logic works with positive and negative numbers. If anyone has a clear explanation or a go-to formula, I’d be grateful!

The Journey So Far:
It’s been a bit of a trial and error process, but I’ve learned a lot about how to fine-tune these automations. The best part is seeing how small tweaks can make a big difference in daily comfort. I’d love to hear how others have optimized their morning routines or dealt with similar challenges!

Cheers to all the tinkerers out there—let’s keep those automations running smoothly! :sun_with_face: