Hi Patrick et all!
Not sure what I’m doing wrong here (I’ll include my logic summary). But I have 2 reactor sensors, each that trip whenever I or the wife are at home, (one for each of us). They seem to be working fine… They stay tripped when we enter the geofence, and untrip when we exit.
So… I’ve setup a 3rd reactor sensor that is designed to “trip” for 30 seconds based on the state of the 2 sensors above. I do this by setting up 4 expressions… two of the expressions check the “lasttrip” time of the sensors above that determine if we’re home or not.
The 3rd expression checks the current time,
the 4th expression calculates the time that has lasped between “now” and the “lasttrip” time.
I use this 4th expression as a condition, so that my reactor sensor only stays “tripped” for the 30 seconds past lasttrip time.
Problem is, I’ve noticed the expression that calculates the current time “tnow” doesn’t seem to refresh. If I hit the “reset” button on the reactor sensor, it refreshes, but otherwise it just displays static number.
Is there a prescribed time interval that expressions are evaluated? or how can I get the tnow variable to refresh properly so my condition goes false (and the sensor untrips) after 30 seconds has lapsed?
logic summary for 3rd sensor
*************************************************** REACTOR LOGIC SUMMARY REPORT ***************************************************
Version: 3.2 config 301 cdata 19082 ui 19143 pluginDevice 23
System: Vera version 1.7.4453 on Sercomm G450; loadtime 1560218556; systemReady 1560218572; ALTUI v2.43; Lua 5.1
Local time: 2019-06-11T07:18:08-0600; DST=1
House mode: plugin 1; system 1; tracking off
Sun data: { "stamp": 2019162, "civdawn": 1560249419, "nautdawn": 1560245325, "sunset": 1560311300, "nautdusk": 1560318136, "latitude": 50.80855, "astrodusk": null, "longitude": -113.9485, "civdusk": 1560314042, "astrodawn": null, "sunrise": 1560252161 }
Geofence: running in quick mode, last update 05:48:00, data version 2
User 2342071 ishome=1 inlist= since=20:04:00
| 1 "40 Norris Coulee Trail, De Winton, AB T0L 0X0, Canada De Winton" type="home" status="" since=05-14.06:35:00
User 2338371 ishome=0 inlist= since=05:48:00
| 4 "40 Norris Coulee Trail, De Winton, AB T0L 0X0, Canada De Winton" type="home" status="out" since=05-15.19:34:00
Raw: { "updated": 1560259080, "users_settings": [ { "id": 2338371, "ishome": 0 }, { "id": 2342071, "ishome": 1 } ], "mode": 1 }
====================================================================================================================================
GeoTrigger Entry (#88)
Version 19082.39 06/11/19 07:02:41
Message/status: Not tripped
Variable/expressions
0: ConnorLastTrip getstate( 42, "urn:micasaverde-com:serviceId:SecuritySensor1", "LastTrip" )*1 [last 1560253681(number)] (exported)
1: PookyLastTrip getstate( 87, "urn:micasaverde-com:serviceId:SecuritySensor1", "LastTrip" )*1 [last 1560218641(number)] (exported)
2: tnow time() [last 1560258191(number)] (exported)
3: SeondsSinceTrip tnow - max(ConnorLastTrip, PookyLastTrip) [last 4510(number)] (exported)
Condition group "Reactor Sensor 13" (AND) false as of 05:48:02 <root>
&-F-service GeoTrigger Entry (88) urn:toggledbits-com:serviceId:ReactorValues/SeondsSinceTrip <= 30; delay reset for 1s [4504 => 4510 at 07:03:11; F/F as of 07:00:44/07:00:45] <conde7e5kt7>
&-T-group "grpe80unq0" (OR) TRUE as of 07:02:43 <grpe80unq0>
| |-F-service Connor is Home? (42) urn:toggledbits-com:serviceId:ReactorGroup/GroupStatus_root istrue [1 => 0 at 05:48:02; F/F as of 05:48:02/05:48:02] <conde7e6ew2>
| |-T-service Pooky is Home ? (87) urn:toggledbits-com:serviceId:ReactorGroup/GroupStatus_root istrue [1 at 07:02:43; T/T as of 07:02:43/07:02:43] <conde80v3hz>
Activity grpe788u5q.true
Device 88 (GeoTrigger Entry) action urn:toggledbits-com:serviceId:ReactorSensor/Reset( )
Device 88 (GeoTrigger Entry) action urn:toggledbits-com:serviceId:ReactorSensor/Reset( )
Device 88 (GeoTrigger Entry) action urn:toggledbits-com:serviceId:ReactorSensor/Restart( )
Events
06/10/19 22:18:02 condchange: newState=true, cond=conde7e6ew2, oldState=false
06/10/19 22:18:02 evalchange: newState=true, cond=conde7e6ew2, oldState=false
06/10/19 22:18:02 condchange: newState=true, cond=root, oldState=false
06/10/19 22:18:02 evalchange: newState=true, cond=root, oldState=false
06/10/19 22:18:02 devicewatch: device=88, old="0", name=GeoTrigger Entry, var=urn:toggledbits-com:serviceId:ReactorGroup/GroupStatus_root, new="1"
06/10/19 22:18:02 devicewatch: device=88, old="1560223552", name=GeoTrigger Entry, var=urn:micasaverde-com:serviceId:SecuritySensor1/LastTrip, new="1560226682"
06/10/19 22:18:02 sensorstate: state=true
06/10/19 22:18:03 variable: oldval=1560226682, variable=tnow, newval=1560226683
06/10/19 22:18:03 variable: oldval=1, variable=SeondsSinceTrip, newval=2
06/11/19 05:48:01 devicewatch: device=42, old="1", name=Connor is Home?, var=urn:toggledbits-com:serviceId:ReactorGroup/GroupStatus_root, new="0"
06/11/19 05:48:01 devicewatch: device=42, old="1560226681", name=Connor is Home?, var=urn:micasaverde-com:serviceId:SecuritySensor1/LastTrip, new="1560253681"
06/11/19 05:48:01 devicewatch: device=42, old="1", name=Connor is Home?, var=urn:micasaverde-com:serviceId:SecuritySensor1/Tripped, new="0"
06/11/19 05:48:02 variable: oldval=1560226681, variable=ConnorLastTrip, newval=1560253681
06/11/19 05:48:02 variable: oldval=1560226683, variable=tnow, newval=1560253682
06/11/19 05:48:02 variable: oldval=2, variable=SeondsSinceTrip, newval=1
06/11/19 05:48:02 condchange: newState=false, cond=conde7e6ew2, oldState=true
06/11/19 05:48:02 evalchange: newState=false, cond=conde7e6ew2, oldState=true
06/11/19 05:48:02 condchange: newState=false, cond=root, oldState=true
06/11/19 05:48:02 evalchange: newState=false, cond=root, oldState=true
06/11/19 05:48:02 devicewatch: device=88, old="1", name=GeoTrigger Entry, var=urn:toggledbits-com:serviceId:ReactorGroup/GroupStatus_root, new="0"
06/11/19 05:48:02 devicewatch: device=88, old="1560226682", name=GeoTrigger Entry, var=urn:micasaverde-com:serviceId:SecuritySensor1/LastTrip, new="1560253682"
06/11/19 05:48:02 sensorstate: state=false
06/11/19 05:48:03 variable: oldval=1560253682, variable=tnow, newval=1560253683
06/11/19 05:48:03 variable: oldval=1, variable=SeondsSinceTrip, newval=2
06/11/19 07:00:43 action: action=Reset
06/11/19 07:00:43 devicewatch: device=88, old="1560253682", name=GeoTrigger Entry, var=urn:micasaverde-com:serviceId:SecuritySensor1/LastTrip, new="1560258043"
06/11/19 07:00:43 sensorstate: state=false
06/11/19 07:00:44 variable: oldval=1560253683, variable=tnow, newval=1560258044
06/11/19 07:00:44 variable: oldval=2, variable=SeondsSinceTrip, newval=4363
06/11/19 07:00:44 condchange: newState=false, cond=conde7e5kt7, oldState=true
06/11/19 07:00:45 variable: oldval=1560258044, variable=tnow, newval=1560258045
06/11/19 07:00:45 variable: oldval=4363, variable=SeondsSinceTrip, newval=4364
06/11/19 07:00:45 evalchange: newState=false, cond=conde7e5kt7, oldState=true
06/11/19 07:02:42 configchange:
06/11/19 07:02:43 variable: oldval=1560258045, variable=tnow, newval=1560258163
06/11/19 07:02:43 variable: oldval=4364, variable=SeondsSinceTrip, newval=4482
06/11/19 07:02:43 condchange: newState=true, cond=conde80v3hz
06/11/19 07:02:43 evalchange: newState=true, cond=conde80v3hz
06/11/19 07:02:43 condchange: newState=true, cond=grpe80unq0
06/11/19 07:02:43 evalchange: newState=true, cond=grpe80unq0
06/11/19 07:03:04 action: action=Reset
06/11/19 07:03:04 devicewatch: device=88, old="1560258043", name=GeoTrigger Entry, var=urn:micasaverde-com:serviceId:SecuritySensor1/LastTrip, new="1560258184"
06/11/19 07:03:04 sensorstate: state=false
06/11/19 07:03:05 variable: oldval=1560258163, variable=tnow, newval=1560258185
06/11/19 07:03:05 variable: oldval=4482, variable=SeondsSinceTrip, newval=4504
06/11/19 07:03:10 action: action=Reset
06/11/19 07:03:10 devicewatch: device=88, old="1560258184", name=GeoTrigger Entry, var=urn:micasaverde-com:serviceId:SecuritySensor1/LastTrip, new="1560258190"
06/11/19 07:03:10 sensorstate: state=false
06/11/19 07:03:11 variable: oldval=1560258185, variable=tnow, newval=1560258191
06/11/19 07:03:11 variable: oldval=4504, variable=SeondsSinceTrip, newval=4510