Turn on lights Sunset

42 views
Skip to first unread message

Geert Verbist

unread,
Nov 8, 2017, 5:36:19 AM11/8/17
to OpenRemote
Hi,

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

How would one do that? 

Geert Verbist

unread,
Nov 8, 2017, 5:45:43 AM11/8/17
to OpenRemote
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" );


Nathan Fettinger

unread,
Nov 17, 2017, 2:35:43 PM11/17/17
to OpenRemote

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





Geert Verbist

unread,
Nov 22, 2017, 4:27:07 PM11/22/17
to OpenRemote
got it.

Thanks you
Reply all
Reply to author
Forward
0 new messages