Sunrise/Sunset condition

It seems some has changed to cause evaluation for sunset and sunrise to error.

This is my defined condition,
Sunrise/Sunset: between -180 mins after sunset and +60 mins before sunrise

And here is the error associated to it,
2021-07-02 11:33:27: FAILED: [string “–[[…”]:3533: attempt to perform arithmetic on a nil value
I confirmed it because when the condition is removed things see to work.

I have tried,

  1. restarting vera
  2. restarting the reactor device

Any ideas as to how to solve this?

Please post a Logic Summary for the ReactorSensor (Tools tab, follow the posting instructions for the summary carefully to preserve its formatting/readability).

attached log,

debug.zip (9.6 KB)

Logic Summary, please. Not log file.

sorry,

*************************************************** REACTOR LOGIC SUMMARY REPORT ***************************************************
   Version: 3.8-20262 config 20190 cdata 20045 ui 20190 pluginDevice 309 LuaXP 1.0.2enh
    System: Vera version 1.7.5186 (7.31) on Sercomm G450 ID 36 (Vera Plus); loadtime 1625257930/1625257955; systemReady 1625257960
       Env: Lua 5.1; JSON dkjson 1.2; UnsafeLua=nil/true
Local time: 2021-07-02T19:42:15-0500; DST=1; Headingley, Manitoba Canada; formats %d/%m/%Y %H:%M:%S
House mode: plugin 1; system 1; tracking on
  Sun data: { "source": "int", "civdawn": null, "nautdawn": null, "sunset": null, "nautdusk": null, "stamp": 2021183, "latitude": -97.3304, "astrodusk": 1625282498, "longitude": -97.409, "civdusk": null, "astrodawn": 1625219130, "sunrise": null }
  Geofence: not running
        RS: 1625176031,1625201020,1625224882,1625238905,1625238978,1625242624,1625252499,1625252605,1625252896,1625257955
        NS: 1617632705:D,1617641040:U,1618128605:D,1618156980:U,1618921650:D,1618923060:U,1619110500:D,1619112900:U,1620978930:D,1620990000:U
************************************************************************************************************************************
ScareCrow (#393) TROUBLE
    Version 20045.110 07/02/21 11:39:11
    Message/status: Starting...
    Variable/expressions
       0: number                   random(1,7) [last (no value)(nil)]
       1: timeOn                   random(300,600) [last (no value)(nil)]
       2: timeOff                  random(900,1200) [last (no value)(nil)]
       3: seed                     randomseed() [last (no value)(nil)]
    Condition group "CheckTime" (AND)  false as of n/a <root>
      &-?-sun bet sunset+180,sunrise-60 [nil at n/a; F/F as of n/a/n/a] <cond182rezme>
      &-?-var number = 3 [nil at n/a; F/F as of n/a/n/a] <cond182riifm>
      &-?-housemode in 2,3,4 [nil at n/a; F/F as of n/a/n/a] <condz7hqdai>
      &-?-group "Randomness" (NUL)  false as of n/a <grpz7gej3s>
      |     Z-?-interval 00h:14m relative to ,01,00 [nil at n/a; F/F as of n/a/n/a] <condz7gfx59>
    Activity root.false
        Delay {timeOn} start
        Notify method SD nid 3: message "lights off"; hostip="192.168.0.101"; index="2"; severity="6"; facility="5"
        Device Rear Garage Light (423) action urn:upnp-org:serviceId:SwitchPower1/SetTarget( newTargetValue="0" )
        Device Deck Switch (419) action urn:upnp-org:serviceId:SwitchPower1/SetTarget( newTargetValue="0" )
        Device Frt Outdoor Lights (426) action urn:upnp-org:serviceId:SwitchPower1/SetTarget( newTargetValue="0" )
    Activity root.true
        Notify method SD nid 2: message "Lights on"; hostip="192.168.0.101"; index="1"; severity="6"; facility="5"
        Device Rear Garage Light (423) action urn:upnp-org:serviceId:SwitchPower1/SetTarget( newTargetValue="1" )
        Device Frt Outdoor Lights (426) action urn:upnp-org:serviceId:Dimming1/SetLoadLevelTarget( newLoadlevelTarget="10" )
        Device Deck Switch (419) action urn:upnp-org:serviceId:SwitchPower1/SetTarget( newTargetValue="1" )
    Events
        2021-07-02 15:32:35: Reactor startup (Luup reload)
        2021-07-02 15:32:35: Starting (Luup Startup/Reload)
        2021-07-02 15:32:36: Sensor update starting
        2021-07-02 15:32:36: Variable number value set to 1
        2021-07-02 15:32:36: Variable timeOn value set to 473
        2021-07-02 15:32:36: Variable timeOff value set to 1052
        2021-07-02 15:32:36: Variable seed value set to 1625257956
        2021-07-02 15:32:36: FAILED: [string "--[[..."]:3533: attempt to perform arithmetic on a nil value
    Devices
        ZWave (1) urn:schemas-micasaverde-com:device:ZWaveNetwork:1 (19/0); parent 0; plugin -; mfg  model ; dev D_ZWaveNetwork.xml impl 
        Frt Outdoor Lights (426) urn:schemas-upnp-org:device:DimmableLight:1 (2/3); parent 1; plugin -; mfg Leviton model DZ6HD; dev D_DimmableLight1.xml impl 
        Deck Switch (419) urn:schemas-upnp-org:device:BinaryLight:1 (3/3); parent 1; plugin -; mfg Leviton model DZ15S; dev D_BinaryLight1.xml impl 
        Rear Garage Light (423) urn:schemas-upnp-org:device:BinaryLight:1 (3/3); parent 1; plugin -; mfg Leviton model DZ15S; dev D_BinaryLight1.xml impl 
    Watches
        Device #393 ScareCrow service urn:toggledbits-com:serviceId:ReactorSensor variable cdata
        Device #393 ScareCrow service urn:toggledbits-com:serviceId:ReactorSensor variable TestHouseMode
        Device #393 ScareCrow service urn:toggledbits-com:serviceId:ReactorSensor variable TestTime

Your location data is invalid. Latitude of -97.3304? Has to be between -90 and 90 (not inclusive).

I contacted vera support about my outside temp being out by 5 or more degrees … they must of messed something up.

Latitude/Longitude of my location is,
https://www.google.com/search?channel=fs&client=ubuntu&q=headingly+longatude

lat:49.8763° N
long:97.4077° W

vera support has somehow locked in the wrong latitude. I have tried changing it through the web interface and it doesn’t change behind the scenes.

If you’ve been going direct to the unit’s local IP and hitting Settings > Location without first logging in through the portal (home.getvera.com), try logging in through the portal first and then changing the settings.

If that doesn’t get it, try running this in Apps > Develop apps > Test Luup Code (Lua):

luup.attr_set( 'latitude', 49.8763, 0 )
luup.attr_set( 'longitude', -97.4077, 0 )
luup.reload()

Otherwise, open a ticket with support (again)…

1 Like

Thanks. Nothing worked that you suggested. Waiting for support to fix the issue.

Would this also cause an issue where I can not set variables (not in drop down)? I pulled the sunrise/sunset logic out and used specific times instead? I have one variable called “watered” in a different reactor device.

*************************************************** REACTOR LOGIC SUMMARY REPORT ***************************************************
Version: 3.8-20262 config 20190 cdata 20045 ui 20190 pluginDevice 309 LuaXP 1.0.2enh
System: Vera version 1.7.5186 (7.31) on Sercomm G450 ID 36 (Vera Plus); loadtime 1625492700/1625492725; systemReady 1625492730
Env: Lua 5.1; JSON dkjson 1.2; UnsafeLua=nil/true
Local time: 2021-07-05T08:54:28-0500; DST=1; Headingley, Manitoba Canada; formats %d/%m/%Y %H:%M:%S
House mode: plugin 1; system 1; tracking on
Sun data: { “source”: “int”, “civdawn”: null, “nautdawn”: null, “sunset”: null, “nautdusk”: null, “stamp”: 2021183, “latitude”: -97.3304, “astrodusk”: 1625282498, “longitude”: -97.409, “civdusk”: null, “astrodawn”: 1625219130, “sunrise”: null }
Geofence: not running
RS: 1625284318,1625313073,1625344355,1625356831,1625400578,1625400750,1625424211,1625430754,1625483796,1625492725
NS: 1617632705:D,1617641040:U,1618128605:D,1618156980:U,1618921650:D,1618923060:U,1619110500:D,1619112900:U,1620978930:D,1620990000:U


WaterGarden (#446)
Version 20045.90 07/05/21 08:54:25
Message/status: Not tripped
Variable/expressions
0: watered 1 [last 1(number)]
Condition group “WaterConditions” (AND) false as of 08:51:23
&-T-service MSW-Wind (444) urn:micasaverde-com:serviceId:GenericSensor1/CurrentLevel < 7; output follow, delay reset for 1800s [3.1 at 08:51:23; T/T as of 08:51:23/08:51:23]
&-T-service MSW-Precipitation (445) urn:micasaverde-com:serviceId:GenericSensor1/CurrentLevel = 0 [0 at 08:51:23; T/T as of 08:51:23/08:51:23]
&-F-trange bet ,3,0,6,0 [1625493083 => 1625493265 at 08:54:25; F/F as of 08:51:23/08:51:23]
&-T-weekday { “id”: “cond162heu7n”, “type”: “weekday”, “value”: “1,2,3,4,5,6,7”, “operator”: “” } [2 at 08:51:23; T/T as of 08:51:23/08:51:23]
&-F-var watered isfalse nil [1 at 08:51:23; F/F as of 08:51:23/08:51:23]
Activity root.false
Device Faucet-back (49) action urn:upnp-org:serviceId:SwitchPower1/SetTarget( newTargetValue=“0” )
Delay 21600 inline
Activity root.true
Device Faucet-back (49) action urn:upnp-org:serviceId:SwitchPower1/SetTarget( newTargetValue=“1” )
Notify method nil nid 1: sid 78 users 1652881 message “Watering the garden for 30 mins.”; index=“2”
Delay 1800 start
Events
2021-07-05 08:45:25: Reactor startup (Luup reload)
2021-07-05 08:45:25: Starting (Luup Startup/Reload)
2021-07-05 08:45:26: Sensor update starting
2021-07-05 08:45:26: Sensor update completed; 0.289s
2021-07-05 08:45:39: Configuration changed!
2021-07-05 08:45:39: Sensor update starting
2021-07-05 08:45:39: Sensor update completed; 0.023s
2021-07-05 08:48:09: Configuration changed!
2021-07-05 08:48:09: Sensor update starting
2021-07-05 08:48:09: Variable test value changed from “0” to “0”
2021-07-05 08:48:09: Sensor update completed; 0.050s
2021-07-05 08:51:04: Configuration changed!
2021-07-05 08:51:04: Sensor update starting
2021-07-05 08:51:04: Sensor update completed; 0.068s
2021-07-05 08:51:12: Configuration changed!
2021-07-05 08:51:12: Sensor update starting
2021-07-05 08:51:12: Sensor update completed; 0.062s
2021-07-05 08:51:22: Restart action invoked; clearing state and restarting ReactorSensor
2021-07-05 08:51:22: Restarting
2021-07-05 08:51:23: Sensor update starting
2021-07-05 08:51:23: Variable watered value set to 1
2021-07-05 08:51:23: Condition cond0 test state changed from (nil) to true
2021-07-05 08:51:23: Condition cond0 evaluation state changed from (nil) to true
2021-07-05 08:51:23: Condition cond162h5ihe test state changed from (nil) to true
2021-07-05 08:51:23: Condition cond162h5ihe evaluation state changed from (nil) to true
2021-07-05 08:51:23: Condition cond162h6grp test state changed from (nil) to false
2021-07-05 08:51:23: Condition cond162h6grp evaluation state changed from (nil) to false
2021-07-05 08:51:23: Condition cond162heu7n test state changed from (nil) to true
2021-07-05 08:51:23: Condition cond162heu7n evaluation state changed from (nil) to true
2021-07-05 08:51:23: Condition cond16exiv1b test state changed from (nil) to false
2021-07-05 08:51:23: Condition cond16exiv1b evaluation state changed from (nil) to false
2021-07-05 08:51:23: Group WaterConditions test state changed from (nil) to false
2021-07-05 08:51:23: Group WaterConditions evaluation state changed from (nil) to false
2021-07-05 08:51:23: Preparing WaterConditions.false (root.false) activity
2021-07-05 08:51:23: Launching scene/activity root.false
2021-07-05 08:51:23: Starting “root.false” group 1
2021-07-05 08:51:23: Delaying scene root.false group 2 actions until 14:51:23
2021-07-05 08:51:23: Changing RS tripped state to false
2021-07-05 08:51:23: Sensor update completed; 0.124s
2021-07-05 08:54:25: Configuration changed!
2021-07-05 08:54:25: Stopping activity “root.false”
2021-07-05 08:54:25: Sensor update starting
2021-07-05 08:54:25: Sensor update completed; 0.022s
Devices
MSW-Precipitation (445) urn:schemas-rboer-com:device:WeatherMetric:1 (12/0); parent 439; plugin -; mfg model ; dev D_MsWeatherMetric.xml impl
Faucet-back (49) urn:schemas-upnp-org:device:BinaryLight:1 (3/0); parent 1; plugin -; mfg model ; dev D_BinaryLight1.xml impl
ZWave (1) urn:schemas-micasaverde-com:device:ZWaveNetwork:1 (19/0); parent 0; plugin -; mfg model ; dev D_ZWaveNetwork.xml impl
MSW-Wind (444) urn:schemas-rboer-com:device:WeatherMetric:1 (12/0); parent 439; plugin -; mfg model ; dev D_MsWeatherMetric.xml impl
Multi Weather Statio (439) urn:schemas-rboer-com:device:Weather:1 (25/-1); parent 0; plugin 9326; mfg model ; dev D_MsWeather.xml impl I_MsWeather.xml
Watches
Device #446 WaterGarden service urn:toggledbits-com:serviceId:ReactorSensor variable TestHouseMode
Device #445 MSW-Precipitation service urn:micasaverde-com:serviceId:GenericSensor1 variable CurrentLevel
Device #444 MSW-Wind service urn:micasaverde-com:serviceId:GenericSensor1 variable CurrentLevel
Device #446 WaterGarden service urn:toggledbits-com:serviceId:ReactorSensor variable cdata
Device #398 Hallway service urn:micasaverde-com:serviceId:ZWaveDevice1 variable AgiInfo
Device #408 Bathroom Light service urn:upnp-org:serviceId:SwitchPower1 variable Status
Device #446 WaterGarden service urn:toggledbits-com:serviceId:ReactorSensor variable TestTime

You can only “Set Variable” on expression-less variables. A variable with an expression (and even a constant such as “0” is an expression) is driven by that expression, only.