PLEG gets out of sync with devices due to restart

I have occasional restarts, and sometimes if these happen during PLEG actions, the devices, mostly z-wave, get out of sync with their states in PLEG.

So right now my Third Floor Thermostat is in energy mode both in VERA and on the thermostat , but PLEG is convinced it is in normal mode. Polling the device doesn’t update PLEG - is there a way to sync short of just changing the state and changing it back?

ThirdFloorNormalMode Third Floor Thermostat set to normal true 2014-11-06 10:01:28.752 2014-11-06 08:31:08.238
ThirdFloorSavingsMode Third Floor Thermostat set to energy false 2014-11-06 08:31:08.239 2014-11-06 10:01:28.752

I think your problem is more in the thermostat/Vera side then in PLEG. I know there has been some issues with energy mode not switching or working right in VERA.

Have you noticed anything else having problems?

When you poll you say there is no change but, when you manually flip it on and off it updates in PLEG?

These battery powered thermostates?

What UI are you on?

[quote=“integlikewhoa, post:2, topic:183969”]Have you noticed anything else having problems?

When you poll you say there is no change but, when you manually flip it on and off it updates in PLEG?

These battery powered thermostates?

What UI are you on?[/quote]

It is not just thermostats. Right now I have a light switch in the same scenario. The light is on, but PLEG thinks it is off. PLEG turned the light on at 10:15am, but as you can see below the PLEG state does not reflect that nor was it logged by EventWatcher. That is likely due to a restart at roughly 10:16am.

FirstFloorHallLightsOff First Floor Hall is turned off true 2014-11-06 08:31:42.058 2014-11-06 08:28:39.688
FirstFloorHallLightsOn First Floor Hall is turned on false 2014-11-06 08:28:39.688 2014-11-06 08:31:42.05

Yes, if I cycle them to energy saving and back, or on and then off in the case of a light switch, then it updates and stays in sync with PLEG - as long as no restarts during an associated PLEG action.

Everything in question is line powered. UI5…

I don’t have a solution to your problem, but one thing is for sure you need to fix this rebooting problem.

Can you post the full status report!
Also what type of error is causing the reboot … it sounds like Vera is NOT writing out the most recent device state when it crashes … it is supposed to …
But it might be crashing trying to save the device state.

Everything is in sync right now, but I will post when it happens again. Thanks!

The 1st to 2nd Stair Lights are out of sync. Rebooted when turning them off. PLEG shows them as being on while Vera shows them off. Status report:

2014-11-10 20:51:15.608

Registration

Installed: Tue Nov 26 2013. You have 1 license, which allows a total of 4 PLEG and/or PLTS plugins.
Your license key is: ####
Triggers

Name	Description	State	Last True	Last False
BackDoorClosed	Back Door Sensor armed is not tripped	true	2014-11-10 20:02:03.678	2014-11-10 20:01:57.677
BackDoorOpened	Back Door Sensor armed is tripped	false	2014-11-10 20:01:57.677	2014-11-10 20:02:03.679
BackDoorUnlocked	Back Door Deadbolt is opened	false	2014-11-10 20:01:57.898	2014-11-10 20:02:04.318
BedroomClosetLightsOff	Bedroom Closet Lights is turned off	true	2014-11-10 18:35:57.486	2014-11-10 18:33:54.257
BedroomClosetLightsOn	Bedroom Closet Lights is turned on	false	2014-11-10 18:33:54.257	2014-11-10 18:35:57.487
BedroomClosetOccupancy	Bedroom Closet Occupancy armed is tripped	false	2014-11-10 18:33:53.889	2014-11-10 18:35:57.102
CatFeederOn	Cat Feeder is turned on	false	2014-11-10 19:03:00.346	2014-11-10 19:06:00.445
FirstFloorHallLightsOff	First Floor Hall is turned off	false	2014-11-10 20:04:06.875	2014-11-10 20:50:42.465
FirstFloorHallLightsOn	First Floor Hall is turned on	true	2014-11-10 20:50:42.466	2014-11-10 20:04:06.876
FrontDoorClosed	Front Door Sensor armed is not tripped	true	2014-11-10 18:17:29.798	2014-11-10 18:17:22.295
FrontDoorOpened	Front Door Sensor armed is tripped	false	2014-11-10 18:17:22.295	2014-11-10 18:17:29.798
FrontDoorUnlocked	Front Door Deadbolt is opened	false	2014-11-10 18:17:21.941	2014-11-10 18:17:52.870
GarageDoorOpened	Garage Door Sensor armed is tripped	false	2014-11-10 18:16:41.497	2014-11-10 18:18:35.127
IsNight	Day or Night indicates Night time.	true	2014-11-10 16:28:58.104	2014-11-10 07:22:53.103
KitchenOccupancy	Kitchen Occupancy is tripped	false	2014-11-10 10:39:11.951	2014-11-10 10:41:13.102
Lights1stto2ndOff	1st to 2nd Stair Lights is turned off	false	2014-11-10 18:15:56.737	2014-11-10 18:17:12.777
Lights1stto2ndOn	1st to 2nd Stair Lights is turned on	true	2014-11-10 18:17:12.777	2014-11-10 18:15:56.737
Lights2ndto3rdOff	2nd to 3rd Stair Lights is turned off	true	2014-11-10 19:08:14.966	2014-11-10 19:06:11.096
Lights2ndto3rdOn	2nd to 3rd Stair Lights is turned on	false	2014-11-10 19:06:11.096	2014-11-10 19:08:14.966
LRLampOff	Living Room Lamp is turned off	false	2014-11-09 22:19:54.271	2014-11-10 16:28:58.687
LRLampOn	Living Room Lamp is turned on	true	2014-11-10 16:28:58.687	2014-11-09 22:19:54.272
LRMotion	Second Floor Motion armed is tripped	false	2014-11-10 20:51:01.930	2014-11-10 20:51:03.432
LROccupancy	Living Room Occupancy armed is tripped	false	2014-11-10 20:50:27.863	2014-11-10 20:52:29.101
Occupancy1stto2nd	1st to 2nd Stairs Occupancy armed is tripped	true	2014-11-10 20:50:42.093	2014-11-10 20:03:49.101
Occupancy2ndto3rd	2nd to 3rd Stairs Occupancy armed is tripped	false	2014-11-10 19:06:10.673	2014-11-10 19:08:14.104
OfficeFanLightsOff	Office Fan Lights is turned off	false	2014-11-10 20:13:06.456	2014-11-10 20:51:03.896
OfficeFanLightsOn	Office Fan Lights is turned on	true	2014-11-10 20:51:03.896	2014-11-10 20:13:06.456
OfficeOccupancy	Office Occupancy is tripped	true	2014-11-10 20:51:03.173	2014-11-10 20:04:39.102
PatioLightsOn	Patio Lights is turned on	false	2014-11-05 21:12:00.253	2014-11-05 21:23:05.510
Schedules

Name	On Type	On Time	On Days	Random On Delay	Off After Type	Off Time	Off Days	Random Off Delay	State	Last On	Last Off
BlindsCloseNight	Weekly	+00:15:00t	1,2,3,4,5,6,7	None	Weekly	-00:19:59r	1,2,3,4,5,6,7	None	true	2014-11-10 17:43:58.100	2014-11-10 06:33:01.355
BlindsOpenDay	Weekly	-00:20:00r	1,2,3,4,5,6,7	None	Weekly	+00:14:59t	1,2,3,4,5,6,7	None	false	2014-11-10 06:32:53.103	2014-11-10 17:43:57.101
LREveningLampSchedule	Weekly	-01:00:00t	1,2,3,4,5,6,7	None	Weekly	23:00:00	1,2,3,4,5,6,7	None	true	2014-11-10 16:28:58.320	2014-11-09 23:00:00.102
Device Properties

Name	Device Name	Device Variable	Value	Last Change	Previous Change
AlarmArmMode	Main Alarm	DetailedArmMode	Ready	2014-11-10 20:02:03.828	2014-11-10 20:01:58.176
Conditions

Name	Repeat	Expression	State	Last True	Last False
AlarmArmedAway	No	AlarmArmMode eq 'Armed'	false	2014-11-10 08:35:33.471	2014-11-10 17:07:17.910
FrontDoorOpenTooLong	No	FrontDoorOpened AND (FrontDoorOpened; NOW > 15:00)	false	2014-06-04 19:19:32.103	2014-06-04 19:46:07.062
BackDoorOpenTooLong	No	BackDoorOpened AND (BackDoorOpened; NOW > 15:00)	false	2014-11-06 14:18:33.108	2014-11-06 14:18:47.347
FrontDoorNeedstoBeLocked	No	(FrontDoorUnlocked AND (FrontDoorUnlocked; NOW > 15:00) AND FrontDoorClosed AND (FrontDoorClosed; NOW > 15:00))	false	2014-11-06 14:43:33.112	2014-11-06 14:43:38.213
BackDoorNeedstoBeLocked	No	(BackDoorUnlocked AND (BackDoorUnlocked; NOW > 15:00) AND BackDoorClosed AND (BackDoorClosed; NOW > 15:00))	false	2014-11-10 08:27:17.139	2014-11-10 08:27:22.329
FrontDoorNeedsLights	No	FrontDoorOpened AND IsNight	false	2014-11-10 18:17:22.312	2014-11-10 18:17:29.816
GarageDoorOpenTooLong	No	GarageDoorOpened AND (GarageDoorOpened; NOW > 60:00)	false	2014-10-23 18:02:21.119	2014-10-23 18:46:03.830
GarageNeedsLights	No	GarageDoorOpened AND IsNight	false	2014-11-10 18:16:41.538	2014-11-10 18:18:35.146
LRNeedsLampOn	No	LRLampOff AND LREveningLampSchedule and NOT (LREveningLampSchedule; LRLampOff)	false	2014-11-10 16:28:58.358	2014-11-10 16:28:58.709
LRLampAutoOn	No	LRNeedsLampOn; LRLampOn < 30	true	2014-11-10 16:28:58.710	2014-11-10 16:28:58.364
LRNeedsLampOff	No	LRLampOn and (LRLampAutoOn OR (LRLampOn; LREveningLampSchedule)) and (LRMotion; Now > 30:00) and (LROccupancy; Now > 30:00) and (NOT LREveningLampSchedule)	false	2014-11-08 00:37:16.141	2014-11-08 00:37:31.750
Stairs1stto2ndNeedsLightsOn	No	BackDoorOpened or FrontDoorOpened or (Occupancy1stto2nd and NOT AlarmArmedAway)	true	2014-11-10 20:50:42.126	2014-11-10 20:03:49.134
Stairs1stto2ndNeedsLightsOff	No	BackDoorClosed and (BackDoorClosed; Now > 2:00) and FrontDoorClosed and (FrontDoorClosed ; Now > 2:00) and NOT Occupancy1stto2nd	false	2014-11-10 20:04:06.149	2014-11-10 20:50:42.133
Lights1stto2ndOffViaAuto	No	(Lights1stto2ndAutoOff; Lights1stto2ndOff < 30)	true	2014-11-06 18:46:11.535	2014-11-06 13:59:35.318
Lights1stto2ndAutoOnDay	No	Stairs1stto2ndNeedsLightsOn and Lights1stto2ndOff and (Lights1stto2ndOffViaAuto or (Lights1stto2ndOff; Now > 60:00)) and NOT IsNight	false	2014-11-10 08:33:54.614	2014-11-10 08:33:55.114
Lights1stto2ndAutoOnNight	No	Stairs1stto2ndNeedsLightsOn and Lights1stto2ndOff and (Lights1stto2ndOffViaAuto or (Lights1stto2ndOff; Now > 60:00)) and IsNight	false	2014-11-10 18:17:12.327	2014-11-10 18:17:12.824
Lights1stto2ndOnViaAuto	No	(Lights1stto2ndAutoOnNight; Lights1stto2ndOn < 30) OR (Lights1stto2ndAutoOnDay; Lights1stto2ndOn < 30)	true	2014-11-10 18:17:12.827	2014-11-10 18:17:12.337
Lights1stto2ndAutoOff	No	Lights1stto2ndOn and Stairs1stto2ndNeedsLightsOff and (Lights1stto2ndOnViaAuto or (Lights1stto2ndOn; Now > 60:00))	false	2014-11-10 20:04:06.190	2014-11-10 20:50:42.149
FirstFloorHallLightsOffViaAuto	No	(FirstFloorHallLightsAutoOff; FirstFloorHallLightsOff < 30)	true	2014-11-06 21:59:21.897	2014-11-06 20:51:22.512
FirstFloorHallLightsAutoOn	No	Stairs1stto2ndNeedsLightsOn and FirstFloorHallLightsOff and (FirstFloorHallLightsOffViaAuto or (FirstFloorHallLightsOff; Now > 60:00))	false	2014-11-10 20:50:42.154	2014-11-10 20:50:42.524
FirstFloorHallLightsOnViaAuto	No	(FirstFloorHallLightsAutoOn; FirstFloorHallLightsOn < 30)	true	2014-11-10 20:50:42.526	2014-11-10 20:50:42.161
FirstFloorHallLightsAutoOff	No	FirstFloorHallLightsOn and Stairs1stto2ndNeedsLightsOff and (FirstFloorHallLightsOnViaAuto or (FirstFloorHallLightsOn; Now > 60:00) )	false	2014-11-10 20:04:06.227	2014-11-10 20:04:06.939
BackDoorNeedsLights	No	BackDoorOpened and (IsNight or NOT GarageDoorOpened)	false	2014-11-10 20:01:57.744	2014-11-10 20:02:03.745
OfficeFanLightsOffViaAuto	No	(OfficeNeedsFanLightsOff; OfficeFanLightsOff < 30)	true	2014-11-03 18:00:17.565	2014-11-03 13:23:25.820
OfficeNeedsFanLightsOn	No	OfficeOccupancy and NOT AlarmArmedAway and OfficeFanLightsOff and (OfficeFanLightsOffViaAuto or (OfficeFanLightsOff ; Now > 60:00))	false	2014-11-10 20:51:03.247	2014-11-10 20:51:04.155
OfficeFanLightsOnViaAuto	No	(OfficeNeedsFanLightsOn; OfficeFanLightsOn < 30)	true	2014-11-10 20:51:04.157	2014-11-10 20:51:03.254
OfficeNeedsFanLightsOff	No	OfficeFanLightsOn and (OfficeFanLightsOnViaAuto or (OfficeFanLightsOn ; Now > 60:00)) and (OfficeOccupancy ; Now > 10:00)	false	2014-11-10 20:13:06.175	2014-11-10 20:13:06.538
PatioNeedsLightsOff	No	PatioLightsOn and (PatioLightsOn ; Now > 04:00:00)	false	2014-09-28 03:43:21.184	2014-09-28 03:43:21.604
BedroomClosetLightsOffViaAuto	No	(BedroomClosetNeedsLightsOff; BedroomClosetLightsOff < 30)	true	2014-11-03 17:54:34.001	2014-11-03 13:23:24.068
BedroomClosetNeedsLightsOn	No	BedroomClosetLightsOff and BedroomClosetOccupancy and (BedroomClosetLightsOffViaAuto or (BedroomClosetLightsOff ; Now > 60:00))	false	2014-11-10 18:33:53.978	2014-11-10 18:33:54.345
BedroomClosetLightsOnViaAuto	No	(BedroomClosetNeedsLightsOn; BedroomClosetLightsOn < 30)	true	2014-11-10 18:33:54.347	2014-11-10 18:33:53.985
BedroomClosetNeedsLightsOff	No	BedroomClosetLightsOn and (BedroomClosetLightsOnViaAuto or (BedroomClosetLightsOn ; Now > 60:00)) and NOT BedroomClosetOccupancy	false	2014-11-10 18:35:57.193	2014-11-10 18:35:57.584
Lights2ndto3rdOffViaAuto	No	(Stairs2ndto3rdNeedsLightsOff; Lights2ndto3rdOff < 30)	true	2014-11-10 00:05:21.586	2014-11-09 22:58:42.076
Stairs2ndto3rdNeedsLightsOn	No	Occupancy2ndto3rd and Lights2ndto3rdOff and IsNight and (Lights2ndto3rdOffViaAuto or (Lights2ndto3rdOff ; Now > 60:00))	false	2014-11-10 19:06:10.768	2014-11-10 19:06:11.280
Lights2ndto3rdOnViaAuto	No	(Stairs2ndto3rdNeedsLightsOn; Lights2ndto3rdOn < 30)	true	2014-11-10 19:06:11.282	2014-11-10 19:06:10.774
Stairs2ndto3rdNeedsLightsOff	No	Lights2ndto3rdOn and (Lights2ndto3rdOnViaAuto or (Lights2ndto3rdOn ; Now > 60:00)) and NOT Occupancy2ndto3rd	false	2014-11-10 19:08:14.307	2014-11-10 19:08:15.066
CatFeederNeedsOff	No	CatFeederOn and (CatFeederOn; Now > 01:00:00)	false	2014-11-01 19:24:06.220	2014-11-01 19:24:06.718
BlindsNeedClosing	No	BlindsCloseNight	true	2014-11-10 17:43:58.257	2014-11-10 06:33:01.473
BlindsNeedOpeningHome	No	BlindsOpenDay and NOT AlarmArmedAway	false	2014-11-10 17:07:18.022	2014-11-10 17:43:57.214
BlindsNeedOpeningAway	No	BlindsOpenDay and AlarmArmedAway	false	2014-11-10 08:35:33.589	2014-11-10 17:07:18.027
Startup LUA

function MoveQMotionShades(ParamString)

	local shadeChar,openAmtChar = string.match(ParamString,"(%d+),(%d+)")
	local shadeNum = tonumber(shadeChar)
	local openAmtNum = tonumber(openAmtChar)
	local CommandtoSend

	if shadeNum == 1 then
		if openAmtNum == 100 		then CommandtoSend= string.char(0x01,0x07,0x00,0x05,0x01,0x01,0x01,0x00,0xFC) -- Channel 1 Up
		elseif openAmtNum == 75 	then CommandtoSend= string.char(0x01,0x07,0x00,0x05,0x01,0x01,0x04,0x00,0xF9) -- Channel 1 75% Up
		elseif openAmtNum == 50	then CommandtoSend= string.char(0x01,0x07,0x00,0x05,0x01,0x01,0x08,0x00,0xF5) -- Channel 1 50% Up
		elseif openAmtNum == 25	then CommandtoSend= string.char(0x01,0x07,0x00,0x05,0x01,0x01,0x0C,0x00,0xF1) -- Channel 1 25% Up
		elseif openAmtNum == 0 	then CommandtoSend= string.char(0x01,0x07,0x00,0x05,0x01,0x01,0x02,0x00,0xFF) -- Channel 1 Down
		end
	elseif shadeNum == 2 then
		if openAmtNum == 100 		then CommandtoSend= string.char(0x01,0x07,0x00,0x05,0x01,0x02,0x01,0x00,0xFF) -- Channel 1 Up
		elseif openAmtNum == 75 	then CommandtoSend= string.char(0x01,0x07,0x00,0x05,0x01,0x02,0x04,0x00,0xFA) -- Channel 1 75% Up
		elseif openAmtNum == 50	then CommandtoSend= string.char(0x01,0x07,0x00,0x05,0x01,0x02,0x08,0x00,0xF6) -- Channel 1 50% Up
		elseif openAmtNum == 25	then CommandtoSend= string.char(0x01,0x07,0x00,0x05,0x01,0x02,0x0C,0x00,0xF2) -- Channel 1 25% Up
		elseif openAmtNum == 0 	then CommandtoSend= string.char(0x01,0x07,0x00,0x05,0x01,0x02,0x02,0x00,0xFC) -- Channel 1 Down
		end
	elseif shadeNum == 3 then
		if openAmtNum == 100 		then CommandtoSend= string.char(0x01,0x07,0x00,0x05,0x01,0x03,0x01,0x00,0xFE) -- Channel 1 Up
		elseif openAmtNum == 75 	then CommandtoSend= string.char(0x01,0x07,0x00,0x05,0x01,0x03,0x04,0x00,0xFB) -- Channel 1 75% Up
		elseif openAmtNum == 50	then CommandtoSend= string.char(0x01,0x07,0x00,0x05,0x01,0x03,0x08,0x00,0xF7) -- Channel 1 50% Up
		elseif openAmtNum == 25	then CommandtoSend= string.char(0x01,0x07,0x00,0x05,0x01,0x03,0x0C,0x00,0xF3) -- Channel 1 25% Up
		elseif openAmtNum == 0 	then CommandtoSend= string.char(0x01,0x07,0x00,0x05,0x01,0x03,0x02,0x00,0xFD) -- Channel 1 Down
		end
	elseif shadeNum == 4 then
		if openAmtNum == 100 		then CommandtoSend= string.char(0x01,0x07,0x00,0x05,0x01,0x04,0x01,0x00,0xF9) -- Channel 1 Up
		elseif openAmtNum == 75 	then CommandtoSend= string.char(0x01,0x07,0x00,0x05,0x01,0x04,0x04,0x00,0xFC) -- Channel 1 75% Up
		elseif openAmtNum == 50	then CommandtoSend= string.char(0x01,0x07,0x00,0x05,0x01,0x04,0x08,0x00,0xF0) -- Channel 1 50% Up
		elseif openAmtNum == 25	then CommandtoSend= string.char(0x01,0x07,0x00,0x05,0x01,0x04,0x0C,0x00,0xF4) -- Channel 1 25% Up
		elseif openAmtNum == 0 	then CommandtoSend= string.char(0x01,0x07,0x00,0x05,0x01,0x04,0x02,0x00,0xFA) -- Channel 1 Down
		end
	end


	-- Connect and Send Command

	local socket = require("socket")
	host = "192.168.0.123"
	c = assert(socket.connect(host, 4999))
	c:settimeout(5)

	local sres, serr = c:send(CommandtoSend)
	print("Send:", sres, serr)
	local data, rerr = c:receive(5)
	luup.log (data)
	print ("Receive:", data, rerr)

	c:close()

end
Actions

Actions for Condition: BackDoorNeedsLights

Device Actions:

Immediate

Device	Action	Arguments
Garage Light	SetTarget	newTargetValue=1
Delay 05:00

Device	Action	Arguments
Garage Light	SetTarget	newTargetValue=0
Actions for Condition: BackDoorNeedstoBeLocked

Device Actions:

Immediate

Device	Action	Arguments
Back Door Deadbolt	SetTarget	newTargetValue=1
Actions for Condition: BedroomClosetNeedsLightsOff

Device Actions:

Immediate

Device	Action	Arguments
Bedroom Closet Lights	SetTarget	newTargetValue=0
Actions for Condition: BedroomClosetNeedsLightsOn

Device Actions:

Immediate

Device	Action	Arguments
Bedroom Closet Lights	SetTarget	newTargetValue=1
Actions for Condition: BlindsNeedClosing

LUA:

MoveQMotionShades("1,0")
MoveQMotionShades("2,0")
MoveQMotionShades("3,0")
MoveQMotionShades("4,0")

luup.call_delay("MoveQMotionShades",10,"1,0")
luup.call_delay("MoveQMotionShades",20,"2,0")
luup.call_delay("MoveQMotionShades",30,"3,0")
luup.call_delay("MoveQMotionShades",40,"4,0")
Actions for Condition: BlindsNeedOpeningAway

LUA:

luup.call_delay("MoveQMotionShades",40,"1,0")
luup.call_delay("MoveQMotionShades",50,"2,0")
luup.call_delay("MoveQMotionShades",60,"3,25")
luup.call_delay("MoveQMotionShades",70,"4,25")
Actions for Condition: BlindsNeedOpeningHome

LUA:

luup.call_delay("MoveQMotionShades",40,"1,50")
luup.call_delay("MoveQMotionShades",50,"2,50")
luup.call_delay("MoveQMotionShades",60,"3,100")
luup.call_delay("MoveQMotionShades",70,"4,100")
Actions for Condition: CatFeederNeedsOff

Device Actions:

Immediate

Device	Action	Arguments
Cat Feeder	SetTarget	newTargetValue=0
Actions for Condition: FirstFloorHallLightsAutoOff

Device Actions:

Immediate

Device	Action	Arguments
First Floor Hall	SetTarget	newTargetValue=0
Actions for Condition: FirstFloorHallLightsAutoOn

Device Actions:

Immediate

Device	Action	Arguments
First Floor Hall	SetTarget	newTargetValue=1
Actions for Condition: FrontDoorNeedsLights

Device Actions:

Immediate

Device	Action	Arguments
Front Yard Lights	SetTarget	newTargetValue=1
Delay 05:00

Device	Action	Arguments
Front Yard Lights	SetTarget	newTargetValue=0
Actions for Condition: FrontDoorNeedstoBeLocked

Device Actions:

Immediate

Device	Action	Arguments
Front Door Deadbolt	SetTarget	newTargetValue=1
Actions for Condition: GarageNeedsLights

Device Actions:

Immediate

Device	Action	Arguments
Garage Light	SetTarget	newTargetValue=1
Back Yard Lights	SetTarget	newTargetValue=1
Delay 10:00

Device	Action	Arguments
Back Yard Lights	SetTarget	newTargetValue=0
Garage Light	SetTarget	newTargetValue=0
Actions for Condition: Lights1stto2ndAutoOff

Device Actions:

Immediate

Device	Action	Arguments
1st to 2nd Stair Lights	SetLoadLevelTarget	newLoadlevelTarget=0
Actions for Condition: Lights1stto2ndAutoOnDay

Device Actions:

Immediate

Device	Action	Arguments
1st to 2nd Stair Lights	SetLoadLevelTarget	newLoadlevelTarget=90
Actions for Condition: Lights1stto2ndAutoOnNight

Device Actions:

Immediate

Device	Action	Arguments
1st to 2nd Stair Lights	SetLoadLevelTarget	newLoadlevelTarget=50
Actions for Condition: LRNeedsLampOff

Device Actions:

Immediate

Device	Action	Arguments
Living Room Lamp	SetTarget	newTargetValue=0
Actions for Condition: LRNeedsLampOn

Device Actions:

Immediate

Device	Action	Arguments
Living Room Lamp	SetTarget	newTargetValue=1
Actions for Condition: OfficeNeedsFanLightsOff

Device Actions:

Immediate

Device	Action	Arguments
Office Fan Lights	SetLoadLevelTarget	newLoadlevelTarget=0
Actions for Condition: OfficeNeedsFanLightsOn

Device Actions:

Immediate

Device	Action	Arguments
Office Fan Lights	SetLoadLevelTarget	newLoadlevelTarget=70
Actions for Condition: PatioNeedsLightsOff

Device Actions:

Immediate

Device	Action	Arguments
Patio Lights	SetLoadLevelTarget	newLoadlevelTarget=0
Actions for Condition: Stairs2ndto3rdNeedsLightsOff

Device Actions:

Immediate

Device	Action	Arguments
2nd to 3rd Stair Lights	SetLoadLevelTarget	newLoadlevelTarget=0
Actions for Condition: Stairs2ndto3rdNeedsLightsOn

Device Actions:

Immediate

Device	Action	Arguments
2nd to 3rd Stair Lights	SetLoadLevelTarget	newLoadlevelTarget=30
Notifications

Name	Description	Users	Last Sent
NotifyBackDoorOpenTooLong	Lighting PLEG has satisfied condition: BackDoorOpenTooLong	wilme2 lucretia132	2014-11-06 14:18:33.108
NotifyFrontDoorOpenTooLong	Lighting PLEG has satisfied condition: FrontDoorOpenTooLong	wilme2 lucretia132	2014-06-04 19:19:32.103
NotifyGarageDoorOpenTooLong	Lighting PLEG has satisfied condition: GarageDoorOpenTooLong	wilme2 lucretia132	2014-10-23 18:02:21.119

That status report is a lot to read. The problem is that Vera restarted while turning off the light, a standard GE/Jasco dimmer in a 4-way configuration, due to a PLEG action, and hence PLEG now thinks the light is on when it is not. Unless I manually turn the light on and then back off, the lights won’t go back to automatic. Even a condition I have built to turn off lights manually turned on after an hour won’t fix the problem - the condition fires, but because Vera knows the light is really off the state doesn’t get reset…

Triggers:
Lights1stto2ndOff 1st to 2nd Stair Lights is turned off false 2014-11-10 18:15:56.737 2014-11-10 18:17:12.777
Lights1stto2ndOn 1st to 2nd Stair Lights is turned on true 2014-11-10 18:17:12.777 2014-11-10 18:15:56.737

I will have to review the code … but as I recall … when PLEG restarts … it reads the device states and re-evaluates the triggers … and will trigger after the reload any triggers that happened during the reload.

I have regular situations where the restart definitely isn’t getting the updated state into PLEG. Don’t get me wrong - I love PLEG, as evidenced by my status report above, plus I have another similarly sized PLEG to control climate. And I don’t know why the restarts are happening. They happen when I am simply turning on and off lights based on security alarm input (DSC plug-in) and occupancy sensor input (EnOcean plug-in). I have a VeraLite that is likely very tight on memory, and so I have a 64 MB swap file to help with memory, and I am using USB logging…

The one last night is pretty clear looking at Event Watcher logs via SYSLOG on my Synology NAS-

Occupancy Sensor trips at 23:04:45 and turns lights on at that same 23:04:45.

Sensor goes untripped at 23:06:50, the light did not turn off as it should, instead Event Watcher has Vera = RESTART() at 23:07:10 and VeraAlerts has Vera Startup at 23:07:15. The PLEG showed after the 23:07 restart that the light was off, but in reality it was not and the UI5 GUI agreed that the light was still on. I had to turn it off via AutHomation when we went to bed…

The PLEG showed after the 23:07 restart that the light was off, but in reality it was not and the UI5 GUI agreed that the light was still on.

What in PLEG show it was off ? The condition that turns it OFF ? Or do you have a trigger for this as well ?

Triggers on on-and-off states…

BedroomClosetLightsOff Bedroom Closet Lights is turned off true
BedroomClosetLightsOn Bedroom Closet Lights is turned on false

Replying to this since I want to see updates considering I am having the exact same issue…

Walked back into my office just now, and the lights didn’t turn on.

PLEG turned the lights off at 17:33, via Condition:

OfficeNeedsFanLightsOff	No	OfficeFanLightsOn and (OfficeFanLightsOnViaAuto or (OfficeFanLightsOn ; Now > 60:00)) and (OfficeOccupancy ; Now > 10:00)	false	2014-11-17 17:33:07.682	2014-11-17 17:34:25.690

Associated action:

Actions for Condition: OfficeNeedsFanLightsOff

Device Actions:

Immediate

Device	Action	Arguments
Office Fan Lights	SetLoadLevelTarget	newLoadlevelTarget=0

But a restart happened right as the action occurred.

So the triggers are backwards and hence my office is dark…

Triggers:

OfficeFanLightsOff Office Fan Lights is turned off false 2014-11-17 16:38:55.928 2014-11-17 17:09:21.672 OfficeFanLightsOn Office Fan Lights is turned on true 2014-11-17 17:09:21.673 2014-11-17 16:38:55.928

I had same issues with my vera, I decided to factory reset and I’m building back one PLEG at a time leaving it run 12 hours between each modification trying to find out what causes the crash, in my logfile, I had LUUP restart 245 every 15-30 minutes.

I’ll post my finds here.

[quote=“goldriver, post:16, topic:183969”]I had same issues with my vera, I decided to factory reset and I’m building back one PLEG at a time leaving it run 12 hours between each modification trying to find out what causes the crash, in my logfile, I had LUUP restart 245 every 15-30 minutes.

I’ll post my finds here.[/quote]

^^^ sounds like this is the best option for the OP also. His problems apear to isolated to a select few users rather then a whole Vera or PLEG plugin issue. A start over would likely never show the problem again.

(Homer Simpson voice) doh!

I only have 2-3 restarts a day, and always driven by PLEG activities. And at 60+ devices (z-wave, enocean, alarm zones), it would be several full days of work to rebuild without restoring from backup. I would really only want to undertake that as part of a [UI5 + VeraLite] to [UI7 + Vera Edge] conversion. I mean if I am going to spend several days of my time redoing everything, I ought to at least get the additional memory and processor speed - the cost of a Vera Edge is small compared to my time to implement. The problem is that I hear UI7 is still far from ready - and I have Vera deeply integrated into my wife and my daily lives and no hurry to lose the high WAF factor I have achieved…

There really isn’t a way to resync device states? That is all I really wanted to figure out - a way to force the re-evaluation of the triggers when PLEG does not match Vera…

(Homer Simpson voice) doh!

I only have 2-3 restarts a day, and always driven by PLEG activities. And at 60+ devices (z-wave, enocean, alarm zones), it would be several full days of work to rebuild without restoring from backup. I would really only want to undertake that as part of a [UI5 + VeraLite] to [UI7 + Vera Edge] conversion. I mean if I am going to spend several days of my time redoing everything, I ought to at least get the additional memory and processor speed - the cost of a Vera Edge is small compared to my time to implement. The problem is that I hear UI7 is still far from ready - and I have Vera deeply integrated into my wife and my daily lives and no hurry to lose the high WAF factor I have achieved…

There really isn’t a way to resync device states? That is all I really wanted to figure out - a way to force the re-evaluation of the triggers when PLEG does not match Vera…[/quote]

Sorry I don’t think the magic button has been created or found hiding anywhere. Think maybe your pushing the Vera Lite to hard? ( I don’t know what all you have on it)

Added 3 new PLEG yesterday night using schedules and NOW – 6 LUUP restart overnight

Looking at the log, it seems that 2 of the PLEG triggered for no reason and keep being evaluated every minutes until it crashes again.

I’m not sure how to analysing the issue, would there be someone able to guide my research, I included my log file between 2 crashes and my PLEG Status report.

Thanks for any help