Page 1 of 1

EVL4 TPI events 802 and 803 (AC Failure)

Posted: Tue Apr 25, 2017 12:27 pm
by zos93
Hi,
i have a DSC PC1832 Alarm with Envisalink 4. I use an application to exploit the API events but in can't see the 802/803 events when i switch off the AC Power. There is only 840, 841 and 849 events in the LOG. Anybody knows why ?
Thank you.

Re: EVL4 TPI events 802 and 803 (AC Failure)

Posted: Tue Apr 25, 2017 4:58 pm
by pos42
Hi

These are a few snippets from my integration code... 849 show a lot of status. Loss of AC power among other things... 841 tells it's restored.

Sorry the code looks so ugly on the forum.... :)

If you see code 510, 511 or 849 from the DSC alarm I call a function decode binary as it is a 2 char bitfield.

Code: Select all

 elseif string.match(token, '^510') or string.match(token, '^511') or string.match(token, '^849') then -- decode binary
   			    decodebinary(token) -- logging handled in the "decodebinary" function itself

And if I see 841 I simply print...

Code: Select all

elseif string.match(token, '^841') then -- Trouble LED OFF	
   				local x
   				x = string.sub(token, 4, 4)
   				if DEBUG >= 1 then fibaro:debug('Trouble LED: OFF - Partition: ' .. x) end
   				if SYSLOG == 1 then syslogserver('Trouble LED: OFF - Partition: ' .. x) end
   			



That function is is here

Code: Select all

function decodebinary(z) -- We decode hex to 8 bit binary data here and translate the result
	local str, bit0, bit1, bit2, bit3, bit4, bit5, bit6, bit7
	str = string.sub(z, 4, 5) -- Pick LED HEX code from function input
	str = tonumber(str,16) -- Convert HEX to DEC
	str = bin(str) -- Call the DEC to BIN function
	str = string.format("%08d", str) -- pad with leading zeros to 8 bit if needed

	bit7 = string.sub(str, 1, 1)
	bit6 = string.sub(str, 2, 2)
	bit5 = string.sub(str, 3, 3)
	bit4 = string.sub(str, 4, 4)
 	bit3 = string.sub(str, 5, 5)
 	bit2 = string.sub(str, 6, 6)
 	bit1 = string.sub(str, 7, 7) 
 	bit0 = string.sub(str, 8, 8)
 	

	if tonumber(string.sub(z, 1, 3)) == 510 then
		if DEBUG >= 2 then fibaro:debug('Keypad LED State for partition 1 - Backlight:' .. bit7 .. ' Fire:' .. bit6 .. ' Program:' .. bit5 .. ' Trouble:' .. bit4 .. ' Bypass:' .. bit3 .. ' Memory:' .. bit2 .. ' Armed:' .. bit1 .. ' Ready:' .. bit0) end
		if DEBUG >= 2 and SYSLOG == 1 then syslogserver('Keypad LED State for partion 1 - Backlight:' .. bit7 .. ' Fire:' .. bit6 .. ' Program:' .. bit5 .. ' Trouble:' .. bit4 .. ' Bypass:' .. bit3 .. ' Memory:' .. bit2 .. ' Armed:' .. bit1 .. ' Ready:' .. bit0) end	
	elseif tonumber(string.sub(z, 1, 3)) == 511 then
		if DEBUG >= 2 then fibaro:debug('Keypad LED FLASH State for partition 1 - Backlight:' .. bit7 .. ' Fire:' .. bit6 .. ' Program:' .. bit5 .. ' Trouble:' .. bit4 .. ' Bypass:' .. bit3 .. ' Memory:' .. bit2 .. ' Armed:' .. bit1 .. ' Ready:' .. bit0) end
		if DEBUG >= 2 and SYSLOG == 1 then syslogserver('Keypad LED FLASH State for partion 1 - Backlight:' .. bit7 .. ' Fire:' .. bit6 .. ' Program:' .. bit5 .. ' Trouble:' .. bit4 .. ' Bypass:' .. bit3 .. ' Memory:' .. bit2 .. ' Armed:' .. bit1 .. ' Ready:' .. bit0) end	
	elseif tonumber(string.sub(z, 1, 3)) == 849 then
		if DEBUG >= 1 then fibaro:debug('Verbose Trouble Status - Loss of Time:' .. bit7 .. ' Sensor/Zone Low Battery:' .. bit6 .. ' Sensor/Zone Tamper:' .. bit5 .. ' Sensor/Zone Fault:' .. bit4 .. ' Failure to Communicate:' .. bit3 .. ' Telephone Line Fault:' .. bit2 .. ' AC Power Lost:' .. bit1 .. ' Service is Required:' .. bit0) end
	if SYSLOG ==1 then syslogserver('Verbose Trouble Status - Loss of Time:' .. bit7 .. ' Sensor/Zone Low Battery:' .. bit6 .. ' Sensor/Zone Tamper:' .. bit5 .. ' Sensor/Zone Fault:' .. bit4 .. ' Failure to Communicate:' .. bit3 .. ' Telephone Line Fault:' .. bit2 .. ' AC Power Lost:' .. bit1 .. ' Service is Required:' .. bit0) end
	end
end[/size]

The rest of my code is here if you want to look...
http://www.incedo.eu/~sjoholmp/Fibaro_H ... DSCengine/

Peo

Re: EVL4 TPI events 802 and 803 (AC Failure)

Posted: Tue Apr 25, 2017 5:58 pm
by GrandWizard
zos93 wrote:Hi,
i have a DSC PC1832 Alarm with Envisalink 4. I use an application to exploit the API events but in can't see the 802/803 events when i switch off the AC Power. There is only 840, 841 and 849 events in the LOG. Anybody knows why ?
Thank you.
You probably aren't waiting long enough for the event to trigger in the panel. You need to have AC fail for about 30 minutes on DSC systems before it issues that event.

Re: EVL4 TPI events 802 and 803 (AC Failure)

Posted: Tue Apr 25, 2017 6:49 pm
by pos42
As API code 849 gives AC failure info feedback after a few seconds I wonder why there is a need for 802 and 803 event codes if you detect AC failure after a much longer time.


/Peo

Re: EVL4 TPI events 802 and 803 (AC Failure)

Posted: Thu Apr 27, 2017 4:04 am
by zos93
Hi,

@pos42 : thank you for your code, i will try to use it
@GrandWizard : thank you for the answer that explains my problem.

The topic can be closed.