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.

Monitoring Ness/ELK Alarm Zone Status
#1
Hi

We run a Ness (aka ELK) DX16X alarm here which as an IP connection.  The status reporting and control protocol is documented at the following link

http://www.nesscorporation.com/Software/...otocol.pdf


I can find integrations using this protocol for other platforms such as the following https://nessclient.readthedocs.io/en/lat...mples.html  and https://community.home-assistant.io/t/ne.../23285/163 but nothing for LogicMachine as yet.


I've started writing a script to connect the the system and can receive data ok, but need some help with getting the specific info and processing the responses in LUA.

Code:
socket = require("socket").tcp()
  socket:connect('192.168.1.150', 2401)
  socket:send(command .. '\n')
  res = socket:receive('*l')
  log('\nNESSCommand: ' .. command .. '\nNESSResponse : ' .. res)



Initially I'm interested in mapping the state of each zone back to objects in Logic Machine (after sending a status update command) from a resident script but haven't been able to figure out the protocol as yet.

Does anyone have a script that can do this?   Initially the is the info that I'm keen to track


0/210/1  Sealed/Unsealed state of Zone 1
0/210/2  Sealed/Unsealed state of Zone 2
0/210/3  Sealed/Unsealed state of Zone 3
0/210/4  Sealed/Unsealed state of Zone 4
0/210/5  Sealed/Unsealed state of Zone 5
0/210/6  Sealed/Unsealed state of Zone 6
0/210/7  Sealed/Unsealed state of Zone 7
0/210/8  Sealed/Unsealed state of Zone 8
0/210/9  Sealed/Unsealed state of Zone 9
0/210/10  Sealed/Unsealed state of Zone 10
0/210/11  Sealed/Unsealed state of Zone 11
0/210/12  Sealed/Unsealed state of Zone 12
0/210/13  Sealed/Unsealed state of Zone 13
0/210/14  Sealed/Unsealed state of Zone 14
0/210/15  Sealed/Unsealed state of Zone 15
0/210/16  Sealed/Unsealed state of Zone 26

and also the overall state of the alarm

0/210/20  All Zones Ok - true/false
0/210/30  Armed State - Disarmed (0), Fully armed (1), Partially armed (2)
0/210/40  Alarm Sounding - true/false

Many thanks in advance

Kind Regards
James
Reply
#2
The protocol is rather simple, here's a starter example that you can use to decode data further:
Code:
res = socket:receive('*l')
if res then
  data = lmcore.hextostr(res, true)
  st, addr, len, cmd, event, id, area = data:byte(1, 7)
  log(st, addr, len, cmd, event, id, area)
end

Note that the logged event number will be in decimal whereas it is written in hexadecimal in the protocol description.
Reply
#3
Many thanks for the starter example. I'm still struggling a bit.

Here's an example of the data I'm receiving with the above after connecting to the alarm panel

* arg: 1
* number: 135
* arg: 2
* number: 0
* arg: 3
* number: 131
* arg: 4
* number: 97
* arg: 5
* number: 1
* arg: 6
* number: 7
* arg: 7
* number: 0

Am I correct in my interpretation that this would map to a sensor in zone / 1D 7 being triggered (event id = 1)?


Also how would I formulate an input command to retrieve the status of all 16 zones to update the group addresses in LM?

Many thanks in advance

Kind Regards
James
Reply


Forum Jump: