How Homey implements SUNSET and SUNRISE?

Good question, the difference is between dawn/dusk and sunset/sunrise. Let me explain;

After sunrise and after sunset are based on the exact moment the sun crosses the horizon.
So:

  • After sunrise = from the moment the sun rises until it sets
  • After sunset = from the moment the sun sets until it rises again

That’s purely based on the sun being above or below the horizon, being 0°.

Daytime is slightly different. That one is based on civil twilight (civiele schemering in Dutch :wink: ). Homey defines daytime as the period between dawn and dusk, where dawn is when the sun is 6° below the horizon in the morning, and dusk is when it’s 6° below the horizon in the evening.

That means:

  • Daytime starts a bit before the actual sunrise
  • Daytime ends a bit after the actual sunset

So “daytime” is always slightly longer than the period between sunrise and sunset.

In practice:
If you want something to follow the exact sun-up / sun-down moment, use sunrise/sunset.
If you want it to follow when there’s already (or still) natural light outside, daytime is usually the better choice.

I hope that explains it!

4 Likes