Create an automation with time and sunset?

Hi All, I’m trying to create an automation between a specific time and sunrise/sunset
(If motion is detected between 11pm and sunrise; turn on light)

I seems you have to select 2 specific times or between sunrise and sunset. Any workarounds to do this? Thanks

ask in the following thread if you can use the calendar functions to achieve the time(11pm) to sunrise using their Edge Driver.

Hi @ny_robert

It can’t be done with automation.

If your region has access to smartligting app you can use it and it will not disappear with groovy

I have asked for this function a few times. Having a set time to sunrise or from sunset to a certain time.


Thanks for confirming @Mariano_Colmenarejo & @eric182

I’ve created a work around by adding a virtual switch that turns on/off based on sunset/sunrise and included it in my if statement.

If it’s between 11PM & 8AM (choose an end time that will always be after sunrise)
and virtual switch is off
Then turn on light

A clunky way to do it but it works, so far

1 Like

what time frame is used for night in location mode?

For me night time starts at 10 pm and ends 1 hour before sunrise