This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Paradox EVO192 integration
#2
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.


Residential script (EVO192 communication, sleep interval 0 seconds):
Code:
require('user.guardZoneStatus')
require('user.guardAreaStatus')

if not port then
  require('serial')
  port = serial.open('/dev/RS232', { baudrate = 9600, parity = 'none', databits = '8', stopbits = '1'})
  port:flush()
  line = ''
end

control_house_security_ga = '10/1/0'                --area1 security status group address
control_woodstorage_security_ga = '10/1/1'    --area2 security status group address
security_code = '1234'

char = port:read(1, 1)
--log(char)
if char then
  if char == '\r' then
    line = line:trim()
    --log(line)
        event = string.sub(line,1,2)
   -- log(event)
    if event == 'G0' then
      eventnr = tonumber(string.sub(line,6,-5))
            area = tonumber(string.sub(line,10,-1))
      eventngr = tonumber(string.sub(line,2,4))
      if zone == nil  then
        zone = 255255
            end
      guardzonefunction(eventngr,eventnr,area)
    elseif event == 'RA' then
      area = 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  )
    end
    line = ''
  else
    line = line .. char
  end 
else
  request = grp.getvalue('32/5/0')    --scheduled script changes object to true every minute. !!!ADD SCHEDULED SCRIPT!!!
  if request then
    port:write('RA001\r')                --send area1 status request command
    os.sleep(0.5)
    port:write('RA002\r')                --send area2 status request command
    grp.update('32/5/0', false)
  end
  house_arm_disarm = grp.getvalue(control_house_security_ga)                        --1-Arm; 2-Force arm; 3-Stay arm; 4-Instant arm; 5-Disarm
  if house_arm_disarm == 1 then
    port:write('AA001A'..security_code..'\r')
    grp.update(control_house_security_ga, 0)
  elseif house_arm_disarm == 2 then
    port:write('AA001F'..security_code..'\r')
    grp.update(control_house_security_ga, 0)
  elseif house_arm_disarm == 3 then
    port:write('AA001S'..security_code..'\r')
    grp.update(control_house_security_ga, 0)
  elseif house_arm_disarm == 4 then
    port:write('AA001I'..security_code..'\r')
    grp.update(control_house_security_ga, 0)
  elseif house_arm_disarm == 5 then
    port:write('AD001'..security_code..'\r')
    grp.update(control_house_security_ga, 0)
  end
 
  woodstorage_arm_disarm = grp.getvalue(control_woodstorage_security_ga)    --1-Arm; 2-Force arm; 3-Stay arm; 4-Instant arm; 5-Disarm
  if woodstorage_arm_disarm == 1 then
    port:write('AA002A'..security_code..'\r')
    grp.update(control_woodstorage_security_ga, 0)
  elseif woodstorage_arm_disarm == 2 then
    port:write('AA002F'..security_code..'\r')
    grp.update(control_woodstorage_security_ga, 0)
  elseif woodstorage_arm_disarm == 3 then
    port:write('AA002S'..security_code..'\r')
    grp.update(control_woodstorage_security_ga, 0)
  elseif woodstorage_arm_disarm == 4 then
    port:write('AA002I'..security_code..'\r')
    grp.update(control_woodstorage_security_ga, 0)
  elseif woodstorage_arm_disarm == 5 then
    port:write('AD002'..security_code..'\r')
    grp.update(control_woodstorage_security_ga, 0)
  end
end

User library:

Script name: guardAreaStatus
Code:
function guardareafunction(areanumber, areastatus, areastatus1, areastatus2, areastatus3, areastatus4, areastatus5, areastatus6 ) --what must be process RA001DOONOOO; RA - Request area; 001 - Area number; D - Disarmed/Armed/Force armed/Stay armed/Instant armed; O - Zone in memory/Ok; O - Troube/Ok; N - Not ready/Ok; O - In programming/Ok; O - In alarm/Ok; O - Strobe/Ok

  house_area_status_ga = '10/0/0'
  woodstorage_area_status_ga = '10/0/1'
 
  house_area_trouble_ga = '10/3/0'
  woodstorage_area_trouble_ga = '10/3/1'
 
  house_area_not_ready_ga = '10/3/2'
  woodstorage_area_not_ready = '10/3/3'
 
  house_area_alarm_ga    = '10/2/0'
  woodstorage_area_alarm_ga = '10/2/1'
 
  if areastatus == 'D' then
    if areanumber == 1 then
      grp.write(house_area_status_ga, 0)
    elseif areanumber == 2 then
      grp.write(woodstorage_area_status_ga, 0)
    end
  elseif areastatus == 'A' then
    if areanumber == 1 then
        grp.update(house_area_status_ga, 1)
    elseif areanumber == 2 then
      grp.update(woodstorage_area_status_ga, 1)
    end
  elseif areastatus == 'F' then
    if areanumber == 1 then
        grp.update(house_area_status_ga, 2)
    elseif areanumber == 2 then
      grp.update(woodstorage_area_status_ga, 2)
    end
  elseif areastatus == 'S' then
    if areanumber == 1 then
        grp.update(house_area_status_ga, 3)
    elseif areanumber == 2 then
      grp.update(woodstorage_area_status_ga, 3)
    end
  elseif areastatus == 'I' then
    if areanumber == 1 then
        grp.update(house_area_status_ga, 4)
    elseif areanumber == 2 then
      grp.update(woodstorage_area_status_ga, 4)
    end
  end
 
  if areastatus2 == 'T' then
    if areanumber == 1 then
      grp.update(house_area_trouble_ga, true)
    elseif areanumber == 2 then
      grp.update(woodstorage_area_trouble_ga, true)
    end
  elseif areastatus2 == 'O' then
    if areanumber == 1 then
      grp.update(house_area_trouble_ga, false)
    elseif areanumber == 2 then
      grp.update(woodstorage_area_trouble_ga, false)
    end
  end
 
  if areastatus3 == 'N' then
    if areanumber == 1 then
      grp.update(house_area_not_ready_ga, true)
    elseif areanumber == 2 then
      grp.update(woodstorage_area_not_ready, true)
    end
  elseif areastatus3 == 'O' then
    if areanumber == 1 then
      grp.update(house_area_not_ready_ga, false)
    elseif areanumber == 2 then
      grp.update(woodstorage_area_not_ready, false)
    end
  end
 
  if areastatus5 == 'A' then
    if areanumber == 1 then
      grp.update(house_area_alarm_ga, true)
    elseif areanumber == 2 then
      grp.update(woodstorage_area_alarm_ga, true)
    end
  elseif areastatus5 == 'O' then
    if areanumber == 1 then
      grp.update(house_area_alarm_ga, false)
    elseif areanumber == 2 then
      grp.update(woodstorage_area_alarm_ga, false)
    end
  end
 
end
Script name: guardZoneStatus

Code:
function guardzonefunction( eventgroup,eventnumber,areanumber)
  guardZones = {
  [255255] = 'An empty zone has arrived',
  [01] = 'Tehnoruum PIR.', 
  [02] = '1k Trepihall PIR.',
  [03] = 'Kontor PIR.',
  [04] = 'Esik PIR.',
  [05] = 'Elutuba PIR.',
  [06] = 'Magamistuba PIR.',
  [07] = 'Garderoob PIR.',
  [08] = 'Kuur PIR.',
  [09] = 'Mona PIR ',
  [10] = 'Cara PIR  ',
  [11] = '2k Trepihall PIR ',
  [12] = 'Tehnoruumi Suits ',   
  [13] = '1 Trepihall Suit ',
  [14] = 'Kontori Suits ',
  [15] = 'Esiku Suits ',
  [16] = 'Elutoa Suits ',
  [17] = 'Magamistoa Suits ',
  [18] = 'Garderoob Suits',
  [19] = 'Mona Suits',
  [20] = 'Cara Suits',
  [21] = '2 Trepihall Suit',
  [22] = '2k Elutoa Suits',
  [23] = 'Kuuri Uks',
  [24] = 'Kontori Aken',
  [25] = 'Peauks',
  [26] = 'Köögi Aken.',
  [27] = 'Terrassi Uks',
  [28] = '1k Vannitoa Uks',
  [29] = '1k Vannitoa Aken',
  [30] = 'Magamistoa Aken',
  [31] = 'Kuuri Aken',
  [32] = 'Mona 1 Aken',
  [33] = 'Cara 1 Aken',
  [34] = '2k Vannitoa Aken',
  [35] = '2k Elutuba M',
  [36] = 'Mona 2 Aken',
  [37] = 'Cara 2 Aken',
  [38] = 'Valvekilp',

}

  house_area_status_ga = '10/0/0'
  woodstorage_area_status_ga = '10/0/1'
 
  house_area_alarm_ga    = '10/2/0'
  woodstorage_area_alarm_ga = '10/2/1'
 
  house_area_exit_delay_ga = '10/0/2'
  house_area_entry_delay_ga = '10/0/3'
 
  woodstorage_area_exit_delay_ga = '10/0/4'
  woodstorage_area_entry_delay_ga = '10/0/5'

  if eventgroup == 0 or eventgroup == 1 then
    if eventgroup == 0 then
      grp.update('10/4/'..eventnumber, false)
    elseif eventgroup == 1 then
      grp.update('10/4/'..eventnumber, true)
    end
  elseif eventgroup == 13 then
    if areanumber == 1 then
      grp.update(house_area_status_ga, 0)
    elseif areanumber == 2 then
      grp.update(woodstorage_area_status_ga, 0)
    end
  elseif eventgroup == 64 then
    if eventnumber == 0 then
      if areanumber == 1 then
        grp.update(house_area_status_ga, 1)
      elseif areanumber == 2 then
        grp.update(woodstorage_area_status_ga, 1)
      end
    elseif eventnumber == 1 then
      if areanumber == 1 then
        grp.update(house_area_status_ga, 2)
      elseif areanumber == 2 then
        grp.update(woodstorage_area_status_ga, 2)
      end
    elseif eventnumber == 2 then
      if areanumber == 1 then
        grp.update(house_area_status_ga, 3)
      elseif areanumber == 2 then
        grp.update(woodstorage_area_status_ga, 3)
      end
    elseif eventnumber == 3 then
      if areanumber == 1 then
        grp.update(house_area_status_ga, 4)
      elseif areanumber == 2 then
        grp.update(woodstorage_area_status_ga, 4)
      end
    elseif eventnumber == 4 or eventnumber == 5 or eventnumber == 6 or eventnumber == 7 then
      if areanumber == 1 then
        grp.update(house_area_alarm_ga, true)
      elseif areanumber == 2 then
        grp.update(woodstorage_area_alarm_ga, true)
      end
    end
  elseif eventgroup == 65 then
    if eventnumber == 1 then
      if areanumber == 1 then
        grp.update(house_area_exit_delay_ga, true)
      elseif areanumber == 2 then
        grp.update(woodstorage_area_exit_delay_ga, true)
      end
    elseif eventnumber == 2 then
      if areanumber == 1 then
        grp.update(house_area_entry_delay_ga, true)
      elseif areanumber == 2 then
        grp.update(woodstorage_area_entry_delay_ga, true)
      end
    elseif eventnumber == 0 then
      if areanumber == 1 then
        grp.update(house_area_entry_delay_ga, false)
        grp.update(house_area_exit_delay_ga, false)
      elseif areanumber == 2 then
        grp.update(woodstorage_area_entry_delay_ga, false)
        grp.update(woodstorage_area_exit_delay_ga, false)
      end
    end
  end
end
Resident script for communication check (EVO192 Communication check, sleep interval 10s):

Code:
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) >= 120 then --if object hasn't updated on last 120s then generate communication error
  if communication_error == false then
    grp.update('10/3/4', true)
  end
else
  if grp.getvalue('10/3/4')==true then
    grp.update('10/3/4', false)
  end
end

Here is UI:
       
Reply


Messages In This Thread
Paradox EVO192 integration - by edgars - 13.11.2019, 09:00
RE: Paradox EVO192 integration - by fleeceable - 08.07.2020, 10:50
RE: Paradox EVO192 integration - by gtsamis - 25.03.2022, 02:02
RE: Paradox EVO192 integration - by mishoboss - 01.12.2020, 21:05
RE: Paradox EVO192 integration - by mishoboss - 26.06.2021, 05:27
RE: Paradox EVO192 integration - by Angeles - 27.10.2021, 11:41
RE: Paradox EVO192 integration - by admin - 22.02.2022, 12:09
RE: Paradox EVO192 integration - by admin - 22.02.2022, 15:16
RE: Paradox EVO192 integration - by JMemphix - 10.10.2022, 00:10
RE: Paradox EVO192 integration - by mishoboss - 22.04.2024, 08:47
RE: Paradox EVO192 integration - by Daniel - 22.04.2024, 08:54

Forum Jump: