eavanvalkenburg / pysiaalarm

A python package to connect to a SIA DC-09 based alarm system.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unsupported code

llastowski opened this issue · comments

Hello,

I got an error while trying to connect SATEL Perfecta alarm that supports DC-09 codes set; I am unable to add the 'ID' code into the config, can you please support me?

DEBUG:pysiaalarm.base_server:Incoming line: 80DA0040"SIA-DCS"0002L0#AA1234[#AA1234|Nri2/id15/OP]_10:03:32,06-14-2023
DEBUG:pysiaalarm.event:Content matches: {'account': 'AA1234', 'ti': None, 'id': None, 'ri': '2', 'code': 'id', 'message': '15/OP', 'xdata': None, 'timestamp': '10:03:32,06-14-2023'}
WARNING:pysiaalarm.base_server:Code not found, replying with DUH to account: AA1234

hey, this is a slightly different format, because the code would be OP not id. the id piece shouldn't be there according to the spec AFAIK and I'm not sure if I can change that without breaking it.

I found that, it's using the full capability of the data frame:
9F73003F"SIA-DCS"0007L0#AA1234[#AA1234|Nri2/id1/OP]_09:29:02,06-15-2023
which breaks down to:

N = data indicator
ri2 - zone identifier
id1 - user identifier
OP - the actual code

I'd be happy to contribute that - which part of the code is extracting the actual data frame items? I have built an ad-hoc pyparsing stub that handles those values correctly

there are multiple regexes in multiple files that take care of that, all defined here: https://github.com/eavanvalkenburg/pysiaalarm/blob/master/src/pysiaalarm/utils/regexes.py. you can also add that row as a test case and then start adapting the regex to make sure we don't regress!

I will give it a try and let you know, thanks

based on your code, the only difference I noticed is that the order of ri and id fields was inverted in the particular alarm appliance I used - to which branch should I create a merge request? the 'dev' seems to have some errors and would not cover the run.py parsing correctly.