Sun Elevation rule to control outside wall lights

I am currently using the Astro item Day/Night switch to turn on and off my outdoor garden lights. I would like to instead use the Sun_Elevation item to create a rule to switch on and off my lights.

The reason for this is when the Night switch is activated via the sun elevation getting to 0 it turns the lights on but outside is still not dark for around 30 minutes.

I am no good at rule creating and was wondering if someone could help me create a rule to turn on my lights when the Sun Elevation is below -10 for instance?

Thank you in advance

There are several different options built in to astro I think I use Nautic Dusk

I was trying to do similar, in my case like a 15 min offset from Sunset (or whatever, I don’t recall now, it’s been a while).

Read many threads on the subject, some people say they got it working, but I never seemed to be able to.

I was following Rich’s “time of day” design pattern, but I think you have to fiddle with creating a separate item/thing for “sunset with offset” but as I said I never got it to work.


Number nSunElevation "Sun Elevation" { channel="astro:sun:local:position#elevation" }


Something like (untested)

rule "Sun below -10 degrees"
    Item nSunElevation changed
    if((nSunElevation.state as Number) <= -10){
        //Do something here

I would highly recommend implementing Rick’s Time of day design patern:

It doesn’t take much time to implement it (just follow the steps and copy the config files).
After you have this running you can take any action you want based on the time of day and whether the sun is going down / coming up etc.

Out of the box you can use it to turn on your outside lights 30 minutes before sundown and turn them off on the moring. Once implemented you can do so much more with it!