The following scripts integrate Paradox EVO192 security panel. Paradox PRT3 printer module is used to connect the security panel to LM5 through RS232 serial port.
Thanks our forum member rebooter for contribution!
08.07.2020, 10:50 (This post was last modified: 08.07.2020, 10:59 by fleeceable.)
Hello!
Here is my updated communication script. Maybe this helps someone...
It allows to see zone status, get info about areas (if there is trouble in some area and if area is open or not), arm/disarm etc...
Also it polls every minute area status.
Resident script for communication check (EVO192 Communication check, sleep interval 10s):
Code:
1234567891011121314
last_timestamp = grp.find("10/0/0").updatetime--Area1 status (status is polled every minute from security system)communication_error = grp.getvalue('10/3/4')
now = os.microtime()
if (now - last_timestamp) >= 120then--if object hasn't updated on last 120s then generate communication errorifcommunication_error == falsethengrp.update('10/3/4', true)
endelseifgrp.getvalue('10/3/4')==truethengrp.update('10/3/4', false)
endend
18.07.2020, 14:37 (This post was last modified: 16.04.2024, 18:58 by fleeceable.)
Another update to get integration done about 1 minute.
Now my script reads out all arealabels and zone labels (You don't need to know anything about EVO program). Also creates automatically group objects. I tested it couple days ago in my new project and really, integration takes about 1-2 minutes.
What you probably need to do is edit zone labels to more understandable form (paradox allows enter only 16 characters for area and zone name).
Program needs one main group address range (example 10/x/x)
require('user.guardZoneStatus')
require('user.guardAreaStatus')
require('user.guardAreaLabels')
require('user.guardZoneLabels')
command_enum = {
[1] = 'A',
[2] = 'F',
[3] = 'S',
[4] = 'I',
}
ifnotportthenrequire('serial')
port = serial.open('/dev/RS232', { baudrate = 9600, parity = 'none', databits = '8', stopbits = '1'})
port:flush()
line = ''endsecurity_main_ga = '10/'--'3-level' = main/middle/sub. Make sure that 10/0/0 - 10/7/X group addresses are not used. System creates objects automatically.security_code = '1234'request_area_status_ga = '32/5/0'--Create scheduled script for this one. Write true every minute.request_zone_labels_ga = '32/5/3'--You need to change this to true only one time or if security zones are changed. --This also activates group address generation. --Make sure that zone label is not "Zone 001, Zone 002 etc because these zone names gonna be ignored.request_area_labels_ga = '32/5/4'--You need to change this to true only one time or if security areas are changed.--This also activates group address generation. --Make sure that area label is not "Area 001, Area 002 etc because these area names gonna be ignored.request_zone_name_count = 50--how many zones will be scanned to get zone labels.active_areas = 1--How many areas are polled periodically. Starts on first area.char = port:read(1, 1)
--log(char)ifcharthenifchar == '\r'thenline = line:trim()
log(line)
event = string.sub(line,1,2)
-- log(event)ifevent == 'G0'theneventnr = tonumber(string.sub(line,6,-5))
area = tonumber(string.sub(line,10,-1))
eventngr = tonumber(string.sub(line,2,4))
guardzonefunction(eventngr,eventnr,area,security_main_ga)
elseifevent == 'RA'thenarea = tonumber(string.sub(line,3,5))
securitystatus_1 = string.sub(line,6,6)
areastatus_1 = string.sub(line,7,7)
areastatus_2 = string.sub(line,8,8)
areastatus_3 = string.sub(line,9,9)
areastatus_4 = string.sub(line,10,10)
areastatus_5 = string.sub(line,11,11)
areastatus_6 = string.sub(line,12,12)
guardareafunction(area,securitystatus_1,areastatus_1,areastatus_2,areastatus_3,areastatus_4,areastatus_5,areastatus_6,security_main_ga )
elseifevent == 'AL'thenarea = tonumber(string.sub(line,3,5))
name = string.sub(line,6,16)
guardarealabelfunction(area, name,security_main_ga)
elseifevent == 'ZL'thenzone = tonumber(string.sub(line,3,5))
name = string.sub(line,6,16)
guardzonelabelfunction(zone, name,security_main_ga)
endline = ''elseline = line .. charendelserequest = grp.getvalue(request_area_status_ga) --scheduled script changes object to true every minuteifrequestthenfori = 1, active_areas, 1doport:write('RA00'.. i .. '\r') --send area1 status request commandos.sleep(0.2)
ifi==active_areasthengrp.update(request_area_status_ga, false)
endendendrequest_area_names = grp.getvalue(request_area_labels_ga)
ifrequest_area_namesthenfori = 1, 8, 1doport:write('AL00'..tostring(i)..'\r')
os.sleep(0.2)
endgrp.update(request_area_labels_ga, false)
endrequest_zone_names = grp.getvalue(request_zone_labels_ga)
ifrequest_zone_namesthenfori = 1, request_zone_name_count, 1doifi<10thenport:write('ZL00'..tostring(i)..'\r')
os.sleep(0.2)
elseport:write('ZL0'..tostring(i)..'\r')
os.sleep(0.2)
endendgrp.update(request_zone_labels_ga, false)
endfori = 1, active_areas, 1doexist = grp.alias(security_main_ga .. '1/' .. i)
ifexist ~= nilthenAreaControl = grp.getvalue(security_main_ga .. '1/' .. i) --1-Arm; 2-Force arm; 3-Stay arm; 4-Instant arm; 5-DisarmifAreaControl ~=0thenifAreaControl ~= 5thenport:write('AA00' .. i .. command_enum[AreaControl] .. security_code ..'\r')
grp.update(security_main_ga .. '1/' .. i, 0)
elseport:write('AD00' .. i .. security_code ..'\r')
grp.update(security_main_ga .. '1/' .. i, 0)
endendendendend
After you request area and zone names, give it some time to scan and create group objects. Mine needed about 15-20 seconds (1 area, 50 zones)...
All objects what are created automatically they have also object comment "Automatically created object - Security Area X", "Automatically created object - Zone XX" etc..
01.12.2020, 21:05 (This post was last modified: 01.12.2020, 21:07 by mishoboss.)
Hi, thank you for this script! I'm investigating the best possible way to integrate a security system with KNX in my next project. Satel has INT-KNX-2, which is great, but it has certain limitations (e.g. only 64 addresses). There are some pricey 3rd party modules for DSC. And there is Paradox with PRT3 and pricey 3rd party modules again, or using Logic Machine alternatively. The last option I like the most, because I'll probably put a Logic Machine into the project anyways.
Two questions:
1. Does this script work with the newer Paradox serial module? PRT3 is now discontinued and replaced.
2. Are zone changes reported imidiately? For example if a motion sensor detects motion, is this reported on the same second?
(01.12.2020, 21:05)mishoboss Wrote: Hi, thank you for this script! I'm investigating the best possible way to integrate a security system with KNX in my next project. Satel has INT-KNX-2, which is great, but it has certain limitations (e.g. only 64 addresses). There are some pricey 3rd party modules for DSC. And there is Paradox with PRT3 and pricey 3rd party modules again, or using Logic Machine alternatively. The last option I like the most, because I'll probably put a Logic Machine into the project anyways.
Two questions:
1. Does this script work with the newer Paradox serial module? PRT3 is now discontinued and replaced.
2. Are zone changes reported imidiately? For example if a motion sensor detects motion, is this reported on the same second?
Hi!
I definitelly should choose LM to integrate security system. You have no limits when using LM. Can program whatever you want.
Answers:
1. I havent tested it but if all commands are the same then it will work.
2. Yes, this is realtime info. In one project I am using movement from security as triger and switch lights when brightness is below setpoint.
(26.06.2021, 05:27)mishoboss Wrote: Hi, is there a way to control Paradox PGMs (outputs)?
I didn't find any straight solution because there is no command to control PGM output directly. PGM output is meant to control via some statements inside paradox.
But, this solution should work (haven't tested it by myself) but paradox uses this solution with RF remotes.
You can try to use utility key and create this kind of configuration (picture 1 attached). I think there is possible to create similar configuration in BabyWare also.
In LM add this code in residential script to test it out:
Code:
123456789101112131415
utility_key1_grp_addr = 'x/x/x'-- turn PGM on group addressutility_key2_grp_addr = 'x/x/x'-- turn PGM off group addressutility_key1 = grp.getvalue(utility_key1_grp_addr) -- PGM onutility_key2 = grp.getvalue(utility_key2_grp_addr) -- PGM offifutility_key1==trueorutility_key1==1thenport:write('UK001\r')
grp.update(utility_key1_grp_addr, false)
os.sleep(0.2)
elseifutility_key2==trueorutility_key2==1thenport:write('UK002\r')
grp.update(utility_key2_grp_addr, false)
os.sleep(0.2)
end
enable log(event) in residential script to see if command is accepted.
Unfortunately there is no request/status command to see what is PGM state.
Hello. Everything is perfect but I see that the connection is through RS-232 port. My initial question is if there is some possibility to manage a alarm central through http connection. This kind of central usually include web server.
Thank you.
ASCII protocol should only contain printable characters. Since you are getting <?> (unprintable character) it means that there's something wrong on the communication level.
11.03.2022, 11:51 (This post was last modified: 11.03.2022, 11:52 by fleeceable.)
You can also try to switch Tx and Rx cables on logic side.
Another way to test that your PRT3 module (and paradox program) works is to use RS232 to USB converter and connect PRT3 to computer. Then use Docklight (https://docklight.de/) program. If all settings are correct you should see some data on Docklight terminal...
I have used that Logic library on 4 sites and all works great.
(11.03.2022, 11:51)fleeceable Wrote: You can also try to switch Tx and Rx cables on logic side.
Another way to test that your PRT3 module (and paradox program) works is to use RS232 to USB converter and connect PRT3 to computer. Then use Docklight (https://docklight.de/) program. If all settings are correct you should see some data on Docklight terminal...
I have used that Logic library on 4 sites and all works great.
Problem solved!
It was a bad wire connection inside the DB9 connector. The gnd wire was disconected.
It is hard to understand why Paradox did not include Bypass function on the PRT3.
They have it with the IP module... Everyone should send an update request to Paradox to have it added to the PRT3. It takes numbers to get results.
22.04.2024, 08:47 (This post was last modified: 22.04.2024, 08:48 by mishoboss.)
Hi! Right now the D (disarmed) status is mapped to number 0 and the disarm control is mapped to number 5. I need disarm control and status to be mapped to the same number, for example 5. So I thought it would be easy to remap those here:
if areastatus == 'D' then
grp.update(security_main_ga .. '0/' .. areanumber , 5)
elseif areastatus == 'A' then
grp.update(security_main_ga .. '0/' .. areanumber , 1)
elseif areastatus == 'F' then
grp.update(security_main_ga .. '0/' .. areanumber , 2)
elseif areastatus == 'S' then
grp.update(security_main_ga .. '0/' .. areanumber , 3)
elseif areastatus == 'I' then
grp.update(security_main_ga .. '0/' .. areanumber , 4)
end
However DISARMED status is still reported as 0 instead of 5 right after disarming, or it's even not reported at all in some cases. I've scheduled a script to call request_area_status_ga = true every minute and this one successfully updates it to 5. So it works, just not right after DISARMING for some reason. All other controls successfully update the status, it's just the disarm one that is the issue. What I'm missing here?
22.04.2024, 10:54 (This post was last modified: 22.04.2024, 10:59 by fleeceable.)
(22.04.2024, 08:47)mishoboss Wrote: Hi! Right now the D (disarmed) status is mapped to number 0 and the disarm control is mapped to number 5. I need disarm control and status to be mapped to the same number, for example 5. So I thought it would be easy to remap those here:
if areastatus == 'D' then
grp.update(security_main_ga .. '0/' .. areanumber , 5)
elseif areastatus == 'A' then
grp.update(security_main_ga .. '0/' .. areanumber , 1)
elseif areastatus == 'F' then
grp.update(security_main_ga .. '0/' .. areanumber , 2)
elseif areastatus == 'S' then
grp.update(security_main_ga .. '0/' .. areanumber , 3)
elseif areastatus == 'I' then
grp.update(security_main_ga .. '0/' .. areanumber , 4)
end
However DISARMED status is still reported as 0 instead of 5 right after disarming, or it's even not reported at all in some cases. I've scheduled a script to call request_area_status_ga = true every minute and this one successfully updates it to 5. So it works, just not right after DISARMING for some reason. All other controls successfully update the status, it's just the disarm one that is the issue. What I'm missing here?
You need to change this to get 5 for disarm:
user.guardZoneStatus
Code:
12345678
elseifeventgroup == 5then-- user code entered on keypadgrp.update(security_main_ga .. '0/' .. areanumber , 0) ------<<<<<CHANGE THIS TO 5grp.update(security_main_ga .. '0/' .. areanumber+10,false) --reset exit delaygrp.update(security_main_ga .. '0/' .. areanumber+20 , false) --reset entry delayelseifeventgroup == 13oreventgroup == 14then-- disarm with master or user codegrp.update(security_main_ga .. '0/' .. areanumber , 0) ------<<<<<CHANGE THIS TO 5 grp.update(security_main_ga .. '0/' .. areanumber+10,false) --reset exit delaygrp.update(security_main_ga .. '0/' .. areanumber+20 , false) --reset entry delay
Also you don't need to change "command_enum" because that is used only to send right arming command (usual arm, force arm, stay arm etc). If AreaControl variable is 5 then it gonna disarm on either way. Check residential script line 104.