I have two Vera 3 unit running; Vera_1 is the ZWave devices; and Vera_2 is the DSC Alarm Panel and Blue Iris interface. I have created a Heart beat system for each Vera to notify the other if it is running properly. Each Vera is plugged into a GE/Jasco outlet controlled by the “other” Vera. If Vera_1 does not Heartbeat Vera_2 every 90 seconds, Vera_2 will power cycle Vera_1 and vice. Because the Heartbeat process is contained in “LuaUPnP” if it fails to start the HB will not occur and the “other” Vera can power cycle the failing Vera.
The process is simple, every 90 seconds Vera_1 sends an HTTP command to set a MultiSwitch on Vera_2 which serves to trigger Vera_2 to restart a 5 minute PLEG selfRetrigger timer. If this timer expires it causes the power for Vera_1 to be switched off and then back on 30 seconds later. Vera_1 will then restart and hopefully return to normal operation. The same process works vice for Vera_2 and Vera_1
Trigger:
Vera2SemaphoreON Vera 2 State 2 Switch 1 is turned on false 2015-05-28 10:08:52.494 2015-05-28 10:08:52.889
Schedule Items:
Vera1SetSemaphoreTimer Interval 01:30 None Interval 00:00:05 None true 2015-05-28 10:09:57.100 2015-05-28 10:08:32.100
Vera2OFF_ONTimer Self Trigger None Interval 00:00:10 None false 2015-03-28 02:50:53.035 2015-03-28 02:51:08.005
Vera2PowerCycleTimer Self ReTrigger None Interval 00:05:00 None false 2015-04-01 10:57:42.479 2015-04-01 11:07:42.100
Conditions:
SetVera2Semaphore No Vera1SetSemaphoreTimer true 2015-05-28 10:09:57.181 2015-05-28 10:08:32.162
Vera2OK No Vera2SemaphoreON false 2015-05-28 10:08:52.602 2015-05-28 10:08:52.969
Vera2TimeOut No (Vera2PowerCycleTimer; !Vera2PowerCycleTimer) AND checkFirst false 0 0
Vera2PowerCycle No Vera2TimeOut AND Vera2Bypass == 0 false 0 0
Vera2PowerRestore No (Vera2OFF_ONTimer; !Vera2OFF_ONTimer) true 2015-04-03 09:27:03.769 2015-04-03 09:24:25.427
Actions for Condition: SetVera2Semaphore
LUA:
luup.inet.wget("http://192.168.15.116:3480/data_request?id=lu_action&DeviceNum=1633&serviceId=urn:dcineco-com:serviceId:MSwitch1&action=SetStatus1&newStatus1=1")
Actions for Condition: Vera2OK
(<><><> I believe the problem lies in here but i don’t see why)
LUA:
local checkFirst = NotFirst
NotFirst = TRUE
return (checkFirst ~= nil)
Device Actions:
Immediate
Device Action Arguments
. PLEG Common StartTimer timerName=Vera2PowerCycleTimer intervalTime=
[b]Actions for Condition: Vera2PowerCycle[/b]
Device Actions:
Immediate
Device Action Arguments
Vera 2 Power Control SetTarget newTargetValue=0
. PLEG Common StartTimer timerName=Vera2OFF_ONTimer intervalTime=
Actions for Condition: Vera2PowerRestore
Device Actions:
Immediate
Device Action Arguments
Vera 2 Power Control SetTarget newTargetValue=1
Actions for Condition: Vera2TimeOut
Device Actions:
Immediate
Device Action Arguments
Vera 2 State 2 SetStatus3 newStatus3=1
In addition, there are two variables created in “.PLEG Common”, NotFirst, set to “1” and checkFirst set to nul.
Right now everything works except the power cycle. I believe the problem lies in the LUA for the “checkfirst”, my guess is its in the wrong place in the process or there is an error in the logic. Rex Beckett suggested this as a way to prevent the timer from tripping the power cycle for Vera_1 as soon as Vera_2 started up. The idea was to force it to receive one update from the other Vera before it would start timing. But it isn’t happening, as it stands now it never power cycles the other Vera.
Any ideas?