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

line could not be parsed as a SIAEvent or OHEvent

phil2fer opened this issue · comments

Hi,

I just updated to the 3.0.0b7 and i have now a problem with this message from Ajax alarm

BF940059"SIA-DCS"0004L0#AAA[#AAA|Nri1/PA501][X006E07.7777777][Y49N06.6666666]_20:45:46,04-22-2021

Thanks for your help
Phil

Thanks! This confirms something I want sure about, whether multiple xdata fields can be added, and turns out that is the case here (the final two sections with square brackets before the date time). Will fix!

@phil2fer I have created release beta8 that should fix this, please give it a try by editing your manifest.json file in HA, I can't release the custom component right now, still working on some things there!

@eavanvalkenburg . The message is now decoded perfectly, but my ajax hub now always and always send the same message. Perhaps a problem with the acknowledge message... very strange

I have the possibility to send the message with or without the GPS data. Without, all is good but with, i have the loop

Oh that sounds like a bug, could you enable debug logging and share that?

I found out that this is a bug that is related to python 3.8, it does work in 2.9, but I haven't found a way to make it work in 3.8 yet.

try the 10 beta!

hello, i always have the issue with 10 beta

here is the log (be careful i changed the GPS data)
_siaAlarm_logs.txt

I cannot have acces to the log on the client (Ajax alarm). I try to find how

I can't open the file...

here is the log

DEBUG:root:mqtt connect...
DEBUG:pysiaalarm.sync.client:Starting SIA.
DEBUG:pysiaalarm.base_server:Incoming line: 54230012"NULL"0000L0#AAA[]
DEBUG:pysiaalarm.event:Content matches: {'account': None, 'ti': None, 'id': None, 'ri': None, 'code': None, 'message': None, 'xdata': None, 'timestamp': ''}
DEBUG:root:content => ]
DEBUG:root:Publish Message (topic => sia/ajax/maison): {'code': 'RP', 'message': None, 'zone': '0', 'xdata': None}
DEBUG:pysiaalarm.base_server:Incoming line: 53350022"SIA-DCS"0001L0#AAA[#AAA|Nri0/ZY0]
DEBUG:pysiaalarm.event:Content matches: {'account': 'AAA', 'ti': None, 'id': None, 'ri': '0', 'code': 'ZY', 'message': '0', 'xdata': None, 'timestamp': ''}
DEBUG:root:content => #AAA|Nri0/ZY0]
DEBUG:root:Publish Message (topic => sia/ajax/maison): {'code': 'ZY', 'message': '0', 'zone': '0', 'xdata': None}
DEBUG:pysiaalarm.base_server:Incoming line: CDA80026"NULL"0000L0#AAA[]_19:08:35,04-29-2021
DEBUG:pysiaalarm.event:Content matches: {'account': None, 'ti': None, 'id': None, 'ri': None, 'code': None, 'message': None, 'xdata': None, 'timestamp': '19:08:35,04-29-2021'}
DEBUG:root:content => ]_19:08:35,04-29-2021
DEBUG:root:Publish Message (topic => sia/ajax/maison): {'code': 'RP', 'message': None, 'zone': '0', 'xdata': None}
DEBUG:pysiaalarm.base_server:Incoming line: 15760036"SIA-DCS"0002L0#AAA[#AAA|Nri0/YG0]_19:09:25,04-29-2021
DEBUG:pysiaalarm.event:Content matches: {'account': 'AAA', 'ti': None, 'id': None, 'ri': '0', 'code': 'YG', 'message': '0', 'xdata': None, 'timestamp': '19:09:25,04-29-2021'}
DEBUG:root:content => #AAA|Nri0/YG0]_19:09:25,04-29-2021
DEBUG:root:Publish Message (topic => sia/ajax/maison): {'code': 'YG', 'message': '0', 'zone': '0', 'xdata': None}
DEBUG:pysiaalarm.base_server:Incoming line: 0A4E0038"SIA-DCS"0003L0#AAA[#AAA|Nri1/CL501]_19:09:36,04-29-2021
DEBUG:pysiaalarm.event:Content matches: {'account': 'AAA', 'ti': None, 'id': None, 'ri': '1', 'code': 'CL', 'message': '501', 'xdata': None, 'timestamp': '19:09:36,04-29-2021'}
DEBUG:root:content => #AAA|Nri1/CL501]_19:09:36,04-29-2021
DEBUG:root:Publish Message (topic => sia/ajax/maison): {'code': 'CL', 'message': '501', 'zone': '1', 'xdata': None}
DEBUG:pysiaalarm.base_server:Incoming line: 057D0038"SIA-DCS"0004L0#AAA[#AAA|Nri1/OP501]_19:09:44,04-29-2021
DEBUG:pysiaalarm.event:Content matches: {'account': 'AAA', 'ti': None, 'id': None, 'ri': '1', 'code': 'OP', 'message': '501', 'xdata': None, 'timestamp': '19:09:44,04-29-2021'}
DEBUG:root:content => #AAA|Nri1/OP501]_19:09:44,04-29-2021
DEBUG:root:Publish Message (topic => sia/ajax/maison): {'code': 'OP', 'message': '501', 'zone': '1', 'xdata': None}
DEBUG:pysiaalarm.base_server:Incoming line: 09910059"SIA-DCS"0005L0#AAA[#AAA|Nri1/PA501][X006E07.1234567][Y49N06.1234567]_19:09:55,04-29-2021
DEBUG:pysiaalarm.event:Content matches: {'account': 'AAA', 'ti': None, 'id': None, 'ri': '1', 'code': 'PA', 'message': '501', 'xdata': 'X006E07.1234567][Y49N06.1234567', 'timestamp': '19:09:55,04-29-2021'}
DEBUG:pysiaalarm.base_server:Incoming line: 9E910059"SIA-DCS"0005L0#AAA[#AAA|Nri1/PA501][X006E07.1234567][Y49N06.1234567]_19:10:06,04-29-2021
DEBUG:pysiaalarm.event:Content matches: {'account': 'AAA', 'ti': None, 'id': None, 'ri': '1', 'code': 'PA', 'message': '501', 'xdata': 'X006E07.1234567][Y49N06.1234567', 'timestamp': '19:10:06,04-29-2021'}
DEBUG:pysiaalarm.base_server:Incoming line: DC6E0059"SIA-DCS"0005L0#AAA[#AAA|Nri1/PA501][X006E07.1234567][Y49N06.1234567]_19:10:17,04-29-2021
DEBUG:pysiaalarm.event:Content matches: {'account': 'AAA', 'ti': None, 'id': None, 'ri': '1', 'code': 'PA', 'message': '501', 'xdata': 'X006E07.1234567][Y49N06.1234567', 'timestamp': '19:10:17,04-29-2021'}
DEBUG:pysiaalarm.base_server:Incoming line: 0B7F0059"SIA-DCS"0005L0#AAA[#AAA|Nri1/PA501][X006E07.1234567][Y49N06.1234567]_19:10:28,04-29-2021
DEBUG:pysiaalarm.event:Content matches: {'account': 'AAA', 'ti': None, 'id': None, 'ri': '1', 'code': 'PA', 'message': '501', 'xdata': 'X006E07.1234567][Y49N06.1234567', 'timestamp': '19:10:28,04-29-2021'}
DEBUG:pysiaalarm.base_server:Incoming line: 49800059"SIA-DCS"0005L0#AAA[#AAA|Nri1/PA501][X006E07.1234567][Y49N06.1234567]_19:10:39,04-29-2021
DEBUG:pysiaalarm.event:Content matches: {'account': 'AAA', 'ti': None, 'id': None, 'ri': '1', 'code': 'PA', 'message': '501', 'xdata': 'X006E07.1234567][Y49N06.1234567', 'timestamp': '19:10:39,04-29-2021'}
DEBUG:pysiaalarm.base_server:Incoming line: 93950059"SIA-DCS"0005L0#AAA[#AAA|Nri1/PA501][X006E07.1234567][Y49N06.1234567]_19:10:50,04-29-2021
DEBUG:pysiaalarm.event:Content matches: {'account': 'AAA', 'ti': None, 'id': None, 'ri': '1', 'code': 'PA', 'message': '501', 'xdata': 'X006E07.1234567][Y49N06.1234567', 'timestamp': '19:10:50,04-29-2021'}
DEBUG:pysiaalarm.base_server:Incoming line: 55A50059"SIA-DCS"0005L0#AAA[#AAA|Nri1/PA501][X006E07.1234567][Y49N06.1234567]_19:11:01,04-29-2021
DEBUG:pysiaalarm.event:Content matches: {'account': 'AAA', 'ti': None, 'id': None, 'ri': '1', 'code': 'PA', 'message': '501', 'xdata': 'X006E07.1234567][Y49N06.1234567', 'timestamp': '19:11:01,04-29-2021'}

Notice that the SIAevent not fire when i received the GPS data at 19:09:55. (sorry NOT works in b8)

It all looks okay tbh. One thing I see you are using the sync client, I would advice to use the async client, it is faster and I use it for all that I do and it seems to work for me. And what are you using for the account definition, there are 2 reasons for a NAK response, one is that the event can't be matched to a account or that the timestamps are out of sync, the latter doesn't seem to be the case, but let's make sure!

i make some debug and i think i found the problem.

DEBUG:pysiaalarm.base_server:Incoming line: 04D80059"SIA-DCS"0004L0#AAA[#AAA|Nri1/PA501][X006E07.1234567][Y49N06.1234567]_07:06:35,04-30-2021
DEBUG:pysiaalarm.event:Content matches: {'account': 'AAA', 'ti': None, 'id': None, 'ri': '1', 'code': 'PA', 'message': '501', 'xdata': 'X006E07.1234567][Y49N06.1234567', 'timestamp': '07:06:35,04-30-2021'}
DEBUG:pysiaalarm.sync.handler:reponse => b'\n6E1B001A"RSP"0004RNoneLL0#AAA[][K]\r'

the acknonelge message type = "RSP" it's false it must be "ACK"

when i comment this line in event.py (line 254)

 if self.extended_data is not None:  # pragma: no cover
      if [x for x in self.extended_data if x.identifier in RSP_XDATA] is not None:
         return ResponseType.RSP

all is good (the loop stoped)

DEBUG:pysiaalarm.base_server:Incoming line: 4F8F0045"SIA-DCS"0005L0#AAA[#AAA|Nri1/PH501][X006E07.1234567][Y49N06.1234567]
DEBUG:pysiaalarm.event:Content matches: {'account': 'AAA', 'ti': None, 'id': None, 'ri': '1', 'code': 'PH', 'message': '501', 'xdata': 'X006E07.1234567][Y49N06.1234567', 'timestamp': ''}
DEBUG:pysiaalarm.sync.handler:reponse => b'\n96D2001A"ACK"0005RNoneLL0#AAA[][K]\r'

could you check in this direction ?

b11 releasing now! Give it a try, I think it works now (it does in test at least!)

yes !! everything is ok now. Thanks

Great, thanks!