Vision ZP3102 EU PIR Motion Sensor logic?

For Z-Wave related questions in Domoticz

Moderator: leecollings

Post Reply
ErFr
Posts: 8
Joined: Friday 12 June 2015 14:44
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Sweden
Contact:

Vision ZP3102 EU PIR Motion Sensor logic?

Post by ErFr »

I made a LUA script in order to find out how the Vision ZP3102 EU PIR Motion Sensor works.
I have renamed all registered devices for the PIR with the prefix "PIR_"

Code: Select all

function print_r(prefix, arr, name)
	for i, v in pairs(arr) do
		if (string.sub(i,1,string.len(prefix)) == prefix) then
			print(name.."::"..i.." = "..v)
		end
	end
end

prefix = "PIR_"

print ("---------------------------")
if type(otherdevices_lastupdate)=="table" then
	print_r(prefix, otherdevices_lastupdate,"otherdevices_lastupdate")
end

if type(devicechanged)=="table" then
	print_r(prefix, devicechanged,"devicechanged")
end

if type(uservariables)=="table" then
	print_r(prefix, uservariables, "uservariables")
end

if type(uservariables_lastupdate)=="table" then
	print_r(prefix, uservariables_lastupdate, "uservariables_lastupdate" )
end

if type(otherdevices)=="table" then
	print_r(prefix, otherdevices, "otherdevices")
end

if type(otherdevices_svalues)=="table" then
	print_r(prefix, otherdevices_svalues, "otherdevices_svalues")
end

commandArray = {}
return commandArray
When triggering the PIR sensor by walking in front, I am getting the following result in the log:

Code: Select all

 2015-11-05 19:55:51.213 LUA: ---------------------------
2015-11-05 19:55:51.213 LUA: otherdevices_lastupdate::PIR_Alarm Type: 0x07 = 2015-11-05 19:54:50
2015-11-05 19:55:51.214 LUA: otherdevices_lastupdate::PIR_Alarm_Level = 2015-11-05 19:54:50
2015-11-05 19:55:51.214 LUA: otherdevices_lastupdate::PIR_Alarm_Type = 2015-11-05 19:55:51
2015-11-05 19:55:51.214 LUA: otherdevices_lastupdate::PIR_Burglar = 2015-11-05 19:54:50
2015-11-05 19:55:51.214 LUA: devicechanged::PIR_Alarm_Type = On
2015-11-05 19:55:51.215 LUA: otherdevices::PIR_Alarm Type: 0x07 = Off
2015-11-05 19:55:51.215 LUA: otherdevices::PIR_Alarm_Level = Off
2015-11-05 19:55:51.215 LUA: otherdevices::PIR_Alarm_Type = On
2015-11-05 19:55:51.216 LUA: otherdevices::PIR_Burglar = Off
2015-11-05 19:55:51.216 LUA: otherdevices_svalues::PIR_Alarm Type: 0x07 = 0
2015-11-05 19:55:51.217 LUA: otherdevices_svalues::PIR_Alarm_Level = 0
2015-11-05 19:55:51.217 LUA: otherdevices_svalues::PIR_Alarm_Type = 255
2015-11-05 19:55:51.217 LUA: otherdevices_svalues::PIR_Burglar = 0
2015-11-05 19:55:51.154 (Razberry) Lighting 2 (PIR_Alarm_Type)
2015-11-05 19:55:51.225 OpenZWave: Alarm Level: Tamper
2015-11-05 19:55:51.286 LUA: ---------------------------
2015-11-05 19:55:51.287 LUA: otherdevices_lastupdate::PIR_Alarm Type: 0x07 = 2015-11-05 19:55:51
2015-11-05 19:55:51.287 LUA: otherdevices_lastupdate::PIR_Burglar = 2015-11-05 19:54:50
2015-11-05 19:55:51.287 LUA: otherdevices_lastupdate::PIR_Alarm_Type = 2015-11-05 19:55:51
2015-11-05 19:55:51.287 LUA: otherdevices_lastupdate::PIR_Alarm_Level = 2015-11-05 19:54:50
2015-11-05 19:55:51.288 LUA: devicechanged::PIR_Alarm Type: 0x07 = On
2015-11-05 19:55:51.288 LUA: otherdevices::PIR_Alarm Type: 0x07 = On
2015-11-05 19:55:51.288 LUA: otherdevices::PIR_Burglar = Off
2015-11-05 19:55:51.289 LUA: otherdevices::PIR_Alarm_Type = On
2015-11-05 19:55:51.289 LUA: otherdevices::PIR_Alarm_Level = Off
2015-11-05 19:55:51.289 LUA: otherdevices_svalues::PIR_Alarm Type: 0x07 = 0
2015-11-05 19:55:51.290 LUA: otherdevices_svalues::PIR_Burglar = 0
2015-11-05 19:55:51.290 LUA: otherdevices_svalues::PIR_Alarm_Type = 255
2015-11-05 19:55:51.290 LUA: otherdevices_svalues::PIR_Alarm_Level = 0
2015-11-05 19:55:51.228 (Razberry) Lighting 2 (PIR_Alarm Type: 0x07)
2015-11-05 19:55:51.357 LUA: ---------------------------
2015-11-05 19:55:51.357 LUA: otherdevices_lastupdate::PIR_Alarm Type: 0x07 = 2015-11-05 19:55:51
2015-11-05 19:55:51.357 LUA: otherdevices_lastupdate::PIR_Alarm_Level = 2015-11-05 19:55:51
2015-11-05 19:55:51.358 LUA: otherdevices_lastupdate::PIR_Alarm_Type = 2015-11-05 19:55:51
2015-11-05 19:55:51.358 LUA: otherdevices_lastupdate::PIR_Burglar = 2015-11-05 19:54:50
2015-11-05 19:55:51.358 LUA: devicechanged::PIR_Alarm_Level = On
2015-11-05 19:55:51.359 LUA: otherdevices::PIR_Alarm Type: 0x07 = On
2015-11-05 19:55:51.359 LUA: otherdevices::PIR_Alarm_Level = On
2015-11-05 19:55:51.359 LUA: otherdevices::PIR_Alarm_Type = On
2015-11-05 19:55:51.360 LUA: otherdevices::PIR_Burglar = Off
2015-11-05 19:55:51.360 LUA: otherdevices_svalues::PIR_Alarm Type: 0x07 = 0
2015-11-05 19:55:51.360 LUA: otherdevices_svalues::PIR_Alarm_Level = 255
2015-11-05 19:55:51.360 LUA: otherdevices_svalues::PIR_Alarm_Type = 255
2015-11-05 19:55:51.361 LUA: otherdevices_svalues::PIR_Burglar = 0
2015-11-05 19:55:51.298 (Razberry) Lighting 2 (PIR_Alarm_Level)
2015-11-05 19:55:51.427 LUA: ---------------------------
2015-11-05 19:55:51.428 LUA: otherdevices_lastupdate::PIR_Alarm Type: 0x07 = 2015-11-05 19:55:51
2015-11-05 19:55:51.428 LUA: otherdevices_lastupdate::PIR_Alarm_Level = 2015-11-05 19:55:51
2015-11-05 19:55:51.428 LUA: otherdevices_lastupdate::PIR_Alarm_Type = 2015-11-05 19:55:51
2015-11-05 19:55:51.428 LUA: otherdevices_lastupdate::PIR_Burglar = 2015-11-05 19:55:51
2015-11-05 19:55:51.429 LUA: devicechanged::PIR_Burglar = On
2015-11-05 19:55:51.429 LUA: otherdevices::PIR_Alarm Type: 0x07 = On
2015-11-05 19:55:51.429 LUA: otherdevices::PIR_Alarm_Level = On
2015-11-05 19:55:51.429 LUA: otherdevices::PIR_Alarm_Type = On
2015-11-05 19:55:51.430 LUA: otherdevices::PIR_Burglar = On
2015-11-05 19:55:51.430 LUA: otherdevices_svalues::PIR_Alarm Type: 0x07 = 0
2015-11-05 19:55:51.431 LUA: otherdevices_svalues::PIR_Alarm_Level = 255
2015-11-05 19:55:51.431 LUA: otherdevices_svalues::PIR_Alarm_Type = 255
2015-11-05 19:55:51.431 LUA: otherdevices_svalues::PIR_Burglar = 255
2015-11-05 19:55:51.369 (Razberry) Lighting 2 (PIR_Burglar) 
Questions
1. In a LUA script, what shall I look for to detect that the PIR has triggered by movement? The field "PIR_Alarm Type: 0x07" is set to on. But later PIR_Burglar is also set to on? Why? This is not burglar.
2. In a LUA script, what shall I look for to detect that the PIR has triggered by burglar?

I believe that there is a generic test, despite PIR model, to check if a PIR is triggered either by movement or by burglar? How?
Paspberry PI with RFXtrx433, Razberry using only zwave plus devices, onewire (DS9490R) and some LUA-scripts
ErFr
Posts: 8
Joined: Friday 12 June 2015 14:44
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Sweden
Contact:

Re: Vision ZP3102 EU PIR Motion Sensor logic?

Post by ErFr »

No answers, maybe wrong forum?
How did you do handling zwave PIR detectors in LUA?
Paspberry PI with RFXtrx433, Razberry using only zwave plus devices, onewire (DS9490R) and some LUA-scripts
User avatar
gizmocuz
Posts: 2486
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Top of the world
Contact:

Re: Vision ZP3102 EU PIR Motion Sensor logic?

Post by gizmocuz »

ignore the type/level devices
Quality outlives Quantity!
ErFr
Posts: 8
Joined: Friday 12 June 2015 14:44
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Sweden
Contact:

Re: Vision ZP3102 EU PIR Motion Sensor logic?

Post by ErFr »

Sorry, I mistook burglar and tamper. I interpreted burglar as burglar into the PIR detector. But that is tamper. :oops:
End of discussion
Paspberry PI with RFXtrx433, Razberry using only zwave plus devices, onewire (DS9490R) and some LUA-scripts
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest