Turn on lights Sunset

Hi,

I want to bring lights on when sunset and turn them off at sunrise.

How would one do that?

I have created this

package org.openremote.controller.protocol

global org.openremote.controller.statuscache.CommandFacade execute;

global org.openremote.controller.statuscache.SwitchFacade switches;

rule “Turn garden lights on” when

Event( source == “Sunset”, value == “true” )

then

execute.command( “Tuinhuis Buiten ON” );

execute.command( “Achterdeur Light ON” );

end

rule “Turn garden lights off” when

Event( source == “Sunset”, value == “false” )

then

execute.command( “Tuinhuis Buiten OFF” );

execute.command( “Achterdeur Light OFF” );

``

Here is what I use for two switches on the outside of my house:
The Sensor and isNight command is a part of the datetime device.

/* ----------------------------------------------- OUTDOOR LIGHTS ----------------------------------------------- */

rule “Turn Outside Lights on at Sunset”

when

Event( source == “isNightSensor”, value == “true” )

then

execute.command( “Node 10 (ON)” );

execute.command( “Node 14 (ON)” );

end

rule “Turn Outside Lights off at Sunrise”

when

Event( source == “isNightSensor”, value == “false” )

then

execute.command( “Node 10 (OFF)” );

execute.command( “Node 14 (OFF)” );

end

``

got it.

Thanks you