Control Outdoor lightning - with newbie questions

Still the same use case than before: control lights in two occasions during the day, from 06:15 to civil dawn+30min and from civil dusk-30min until midnight, and all this with minimum light on time of 10min. If civil dawn+30min is before 6:15 or civil dusk-30min is after midnight the lights should not be set on i.e. from 00:00 to 06:15 no lights.

So if my expression based solution with time() is not working, I would be happy to hear if there is other solution.

How about the question about times being now “one day ahead”? Dusk here was today around 0:38 but civdusk is now pointing to dusk happening tomorrow 0:40.

OK. So it was never considered in your original description that civil dawn may come well before 6:15, I think. Likewise civil dusk coming after midnight.

So, let’s look at this another way. Look at it backwards. When do you want the lights OFF.

  1. They should be off from midnight to 6:15am at all times of year.
  2. They should be off from civil dawn+30 to civil dusk-30 at all times of year.
  3. If neither of the foregoing conditions are met, the lights should be on.

There will be overlap between 1 and 2, and that’s what we want.

So your Light_OFF group should be an OR group with TWO conditions:

  • time between 00:00 and 06:15
  • sunrise/sunset between civdawn+30 and civdusk-30

Your Light_OFF.true activity should have:

  • Delay 600
  • Device Action: light off

Your Light_OFF:false activity should have:

  • Device Action: light on

There should be no Light_ON group–the “on” function is taken care of exclusively by the Light_OFF group’s false activity (i.e. when the light isn’t supposed to be off, turn it on).

These questions were answered in my second reply (items 1 and 4+5) so I won’t rehash.

OK, I see now that “between” condition is different that it can “span a day” (reading Reactor wiki…) and not equivalent of combining “after” and “before” conditions.

So using two between conditions and taking into account the 10min delay the logic becomes:

INSTRUCTIONS: When pasting this report into the Vera Community forums, please include ALL lines below this one. The next and last lines will ensure proper formatting and must not be removed!
*************************************************** REACTOR LOGIC SUMMARY REPORT ***************************************************
   Version: 3.2 config 301 cdata 19082 ui 19143 pluginDevice 42
    System: Vera version 1.7.4452 on Sercomm NA301; loadtime 1560447539; systemReady 1560447551; Lua 5.1
Local time: 2019-06-17T21:27:10+0300; DST=1
House mode: plugin 1; system 1; tracking off
  Sun data: { "stamp": 2019168, "civdawn": 1560726213, "nautdawn": null, "sunset": 1560800977, "nautdusk": null, "latitude": 60.2052, "astrodusk": null, "longitude": 24.6522, "civdusk": 1560807653, "astrodawn": null, "sunrise": 1560732890 }
  Geofence: not running
====================================================================================================================================
YardLightControl2 (#45) tripped
    Version 19082.55 06/17/19 21:14:16
    Message/status: Tripped
    Condition group "YardLightControl2" (OR) TRUE as of 01-17.23:50:00 <root>
      |-F-trange bet ,,,23,50,,,,6,15 [1560795662 => 1560795991 at 21:26:31; F/F as of 21:21:02/21:21:02] <condegt5q53>
      |-T-sun bet civdawn+20,civdusk-30 [1560795662 => 1560795991 at 21:26:31; T/T as of 21:14:18/21:14:18] <condegt65of>
    Activity root.false
        Device 41 (Driveway_lights) action urn:upnp-org:serviceId:SwitchPower1/SetTarget( newTargetValue="1" )
    Activity root.true
        Delay 600 start
        Device 41 (Driveway_lights) action urn:upnp-org:serviceId:SwitchPower1/SetTarget( newTargetValue="0" )
    Events
        06/17/19 21:09:42 configchange: 
        06/17/19 21:09:42 condchange: newState=true, cond=condegwggbb
        06/17/19 21:09:42 evalchange: newState=true, cond=condegwggbb
        06/17/19 21:09:42 condchange: newState=false, cond=condegwh37e
        06/17/19 21:09:42 evalchange: newState=false, cond=condegwh37e
        06/17/19 21:11:43 action: action=Restart
        06/17/19 21:11:44 start: 
        06/17/19 21:11:45 condchange: newState=false, cond=condegt65of, oldState=true
        06/17/19 21:11:45 evalchange: newState=false, cond=condegt65of, oldState=true
        06/17/19 21:11:45 condchange: newState=true, cond=condegwh37e, oldState=false
        06/17/19 21:11:45 evalchange: newState=true, cond=condegwh37e, oldState=false
        06/17/19 21:14:17 configchange: 
        06/17/19 21:14:17 configchange: 
        06/17/19 21:14:17 configchange: 
        06/17/19 21:14:17 configchange: 
        06/17/19 21:14:17 configchange: 
        06/17/19 21:14:17 configchange: 
        06/17/19 21:14:17 configchange: 
        06/17/19 21:14:17 configchange: 
        06/17/19 21:14:17 configchange: 
        06/17/19 21:14:17 configchange: 
        06/17/19 21:14:17 configchange: 
        06/17/19 21:14:17 configchange: 
        06/17/19 21:14:17 configchange: 
        06/17/19 21:14:17 configchange: 
        06/17/19 21:14:17 configchange: 
        06/17/19 21:14:17 configchange: 
        06/17/19 21:14:17 configchange: 
        06/17/19 21:14:17 configchange: 
        06/17/19 21:14:17 configchange: 
        06/17/19 21:14:17 configchange: 
        06/17/19 21:14:17 configchange: 
        06/17/19 21:14:17 configchange: 
        06/17/19 21:14:17 configchange: 
        06/17/19 21:14:17 configchange: 
        06/17/19 21:14:17 configchange: 
        06/17/19 21:14:18 condchange: newState=true, cond=condegt65of, oldState=false
        06/17/19 21:14:18 evalchange: newState=true, cond=condegt65of, oldState=false
        06/17/19 21:14:24 action: action=Restart
        06/17/19 21:14:24 start: 
        06/17/19 21:14:43 action: action=Restart
        06/17/19 21:14:43 start: 
        06/17/19 21:14:44 condchange: newState=true, cond=condegt5q53, oldState=false
        06/17/19 21:14:44 evalchange: newState=true, cond=condegt5q53, oldState=false
        06/17/19 21:21:01 action: action=Restart
        06/17/19 21:21:01 start: 
        06/17/19 21:21:02 condchange: newState=false, cond=condegt5q53, oldState=true
        06/17/19 21:21:02 evalchange: newState=false, cond=condegt5q53, oldState=true
        06/17/19 21:26:30 action: action=Restart
        06/17/19 21:26:30 start: 

Reversing the logic should then also work to have lights switched on at true:

INSTRUCTIONS: When pasting this report into the Vera Community forums, please include ALL lines below this one. The next and last lines will ensure proper formatting and must not be removed!
*************************************************** REACTOR LOGIC SUMMARY REPORT ***************************************************
   Version: 3.2 config 301 cdata 19082 ui 19143 pluginDevice 42
    System: Vera version 1.7.4452 on Sercomm NA301; loadtime 1560447539; systemReady 1560447551; Lua 5.1
Local time: 2019-06-17T21:31:24+0300; DST=1
House mode: plugin 1; system 1; tracking off
  Sun data: { "stamp": 2019168, "civdawn": 1560726213, "nautdawn": null, "sunset": 1560800977, "nautdusk": null, "latitude": 60.2052, "astrodusk": null, "longitude": 24.6522, "civdusk": 1560807653, "astrodawn": null, "sunrise": 1560732890 }
  Geofence: not running
====================================================================================================================================
YardLightControl2 (#45)
    Version 19082.57 06/17/19 21:30:41
    Message/status: Not tripped
    Condition group "YardLightControl2" (AND) false as of 21:29:49 <root>
      &-T-trange nob ,,,23,50,,,,6,15 [1560796242 => 1560796279 at 21:31:19; T/T as of 21:29:49/21:29:49] <condegt5q53>
      &-F-sun bet civdusk-30,civdawn+20 [1560796242 => 1560796279 at 21:31:19; F/F as of 21:29:49/21:29:49] <condegt65of>
    Activity root.false
        Delay 600 start
        Device 41 (Driveway_lights) action urn:upnp-org:serviceId:SwitchPower1/SetTarget( newTargetValue="0" )
    Activity root.true
        Device 41 (Driveway_lights) action urn:upnp-org:serviceId:SwitchPower1/SetTarget( newTargetValue="1" )
    Events
        06/17/19 21:29:48 configchange: 
        06/17/19 21:29:48 configchange: 
        06/17/19 21:29:48 configchange: 
        06/17/19 21:29:48 configchange: 
        06/17/19 21:29:48 configchange: 
        06/17/19 21:29:48 configchange: 
        06/17/19 21:29:48 configchange: 
        06/17/19 21:29:48 configchange: 
        06/17/19 21:29:48 configchange: 
        06/17/19 21:29:49 condchange: newState=true, cond=condegt5q53, oldState=false
        06/17/19 21:29:49 evalchange: newState=true, cond=condegt5q53, oldState=false
        06/17/19 21:29:49 condchange: newState=false, cond=condegt65of, oldState=true
        06/17/19 21:29:49 evalchange: newState=false, cond=condegt65of, oldState=true
        06/17/19 21:29:49 condchange: newState=false, cond=root, oldState=true
        06/17/19 21:29:49 evalchange: newState=false, cond=root, oldState=true
        06/17/19 21:29:49 sensorstate: state=false
        06/17/19 21:29:49 startscene: scene=root.false, sceneName=root.false
        06/17/19 21:29:49 runscene: scene=root.false, sceneName=root.false, group=1, notice=Starting scene group 1
        06/17/19 21:29:49 endscene: scene=root.false, sceneName=root.false
        06/17/19 21:30:41 configchange: 
        06/17/19 21:30:41 configchange: 
        06/17/19 21:30:41 configchange: 
        06/17/19 21:30:41 configchange: 
        06/17/19 21:30:41 configchange: 
        06/17/19 21:30:41 configchange: 
        06/17/19 21:30:41 configchange: 
        06/17/19 21:30:41 configchange: 
        06/17/19 21:30:41 configchange: 
        06/17/19 21:30:41 configchange: 
        06/17/19 21:30:41 configchange: 
        06/17/19 21:30:41 configchange: 
        06/17/19 21:30:41 configchange: 
        06/17/19 21:30:41 configchange: 
        06/17/19 21:30:41 configchange: 
        06/17/19 21:30:41 configchange: 
        06/17/19 21:30:41 configchange: 
        06/17/19 21:30:41 configchange: 
        06/17/19 21:30:41 configchange: 
        06/17/19 21:30:41 configchange: 
        06/17/19 21:30:41 configchange: 
        06/17/19 21:30:41 configchange: 
        06/17/19 21:30:41 configchange: 
        06/17/19 21:30:41 configchange: 
        06/17/19 21:30:41 configchange: 
        06/17/19 21:30:41 configchange: 
        06/17/19 21:30:41 configchange: 
        06/17/19 21:30:41 configchange: 
        06/17/19 21:30:41 configchange: 
        06/17/19 21:31:18 action: action=Restart
        06/17/19 21:31:18 start: 

Still bothered about the calculated times not being within the current day. For this light control it does not matter but maybe there are some other cases where it does.

And lastly very tiny possible bug in Reactor UI: in the Tools tab there is an instruction saying " then go back to the “Control” tab", this probably should be “then go back to the “Status” tab”