Simple Day or Night entity for Sun integration

I would like to see a simple is it day or night entity as part of the Sun integration.
My first automation was turning a light on only at night.
I tried to use the Sun integration.
For a condition
“Confirm sun after sunset before sunrise” did not work as expected.
I expected it to only pass at night.
It was not simple to do in the GUI.

Then you probably did something wrong because it’s easy to determine if it’s currently day (above_horizon) or night (below_horizon).

Here’s the equivalent of your Feature Request; use a State Condition configured as shown below.

2 Likes

Can you share your yaml?

See the two examples in the documentation: Conditions - Home Assistant

To the novice this is not an obvious answer.
I will try this method
Thanks

The idea is to do this from the GUI.

For a novice, I don’t imagine much is obvious in this menu:

You’re saying that the following Sun Condition failed to confirm that the time at which the automation ran was between sunset and sunrise?

image

Post the automation, in YAML format, that contains the Sun Condition you claim failed to work correctly.

Also, how did you test the automation? Did you wait for it to be triggered or did you try to test it by executing its Run command?

If you you used the Run command, it skips the automation’s triggers and conditions and simply executes the automation’s actions.

Reference
Troubleshooting your automation.

And double check that your location, height above sea level and time zone are set correctly.

It works today.
I do believe it did not work when I made that first automation a year ago.
I had to seperate the two conditions.
BUT
My request is about the future of Home Assistant.
As new users, using the GUI, try to get an automation working, the options should be very clear.
sun above or below the horizon is clear to me now, but was not back when I was trying to get a light to only come on at night.
SO
My feature request “Simple” may still be valid.
Thanks to everyone for the replys.

Simple and effective.

Given Home Assistant’s rapid evolution, a “year ago” is an eternity.

It’s already simple with a Sun Condition, or a State Condition.

The simple solution is to create a condition for your automation that uses the (add condition) > time like this.


Dusk and dawn get very close to when it is dark outside.
Much better than sunrise and sunset in the “Sun” condition.