Why does the sun get its own domain?

We’re all used to the never-changing sun.sun entity in Home Assistant. But when you want to add the moon phase, it doesn’t come up as moon.phase, but as sensor.moon_phase.

So this got me thinking. What is the actual reason for the sun getting its own domain, rather than being a sensor like everything else?

Should the sun domain be deprecated and the sun entity be moved into the sensor domain?

I think there is a movement the other way around (generic → dedicated domain). MQTT sensors used to be created in the sensor domain, now MQTT has it’s own domain. Same for command_line.

2 Likes

Probably not as it has some pretty specific events baked into the conditions and triggers of Home Assistant.

Would your rather use a sunrise trigger or a sun elevation trigger?

Unless you are a lycanthrope you probably don’t have a use for a moon-rise trigger.

I may or may not be a lycanthrope (yeah, had to look that one up) but there are uses for moonrise and moonset when planning for a cruise. It’s amazing how much you can see by the light of the moon, out on the water. Or how really disorienting it can be without it. Campers and anyone working outdoors at night might also be interested. And of course astronomers or just ordinary stargazers need this information.

Some vampires are also sensitive to the sunlight reflected by the moon. I know many that depend heavily on the moon phase states.