eavanvalkenburg / sia

SIA alarm systems integration into Home Assistant
MIT License
48 stars 11 forks source link

[Honeywell FX020] Failed to Communicate #32

Open Alexwijn opened 4 years ago

Alexwijn commented 4 years ago

I'm trying to use this component with my Honeywell Galaxy Flex 20 (FX020), firmware version 3.0.2.

Version of the custom_component and HA setup (version, OS, etc)

HA: 0.116.4 Component: master, but also tested beta

Configuration

Not relevant.

Describe the bug

The alarm system also reports that it can't communicate with the server (FTC). And the component also got a task exception that it can't read the test message, I think.

Debug log

2020-10-28 19:14:25 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/pysiaalarm/aio/sia_server.py", line 50, in handle_line
    line = str.strip(data.decode())
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x81 in position 2: invalid start byte
eavanvalkenburg commented 4 years ago

Hi @Alexwijn I don't know what is going on there, what you could try (if you know a bit of python) is to run the underlying package (https://github.com/eavanvalkenburg/pysiaalarm) code and see what kind of messages are being sent by the alarm, before all the parsing happens, the protocol used is quite specific, so if they implemented it slightly differently then that might cause issues!

Alexwijn commented 3 years ago

I also noticed that my encryption was turned on. I turned it off and I'm receiving this: bytearray(b'D#0192\x92')

And the exception: UnicodeDecodeError: 'ascii' codec can't decode byte 0x92 in position 6: ordinal not in range(128)

I don't know anything about the SIA protocol, but I imagine the received line should be a lot longer than that.

eavanvalkenburg commented 3 years ago

@Alexwijn give the latest a try, I changed something in the underlying package that might fix this!

Alexwijn commented 3 years ago

Thanks for the update. Got the following error now: Last line could not be parsed as a SIAEvent, line was: D#0192

eavanvalkenburg commented 3 years ago

so it seems there is something else going on with your alarm systems, normally a line is a lot longer, do you have some documentation about the alarm system?

Alexwijn commented 3 years ago

No, this alarm system came pre-installed when I moved into this house. Did you find out anything out yet?

Alexwijn commented 3 years ago

I just noticed but the numbers 0192 are the first numbers of the account id. My account id is six digits long.

Alexwijn commented 3 years ago

Also note that the docs give me an example of how the account Id could look like, eg. AAA. But I can only enter numbers not letters.

eavanvalkenburg commented 3 years ago

@Alexwijn do you mean you can only enter numbers in your alarm? that should work, but you might not to translate that number to a base16 number (which includes A-E), like here: https://www.rapidtables.com/convert/number/decimal-to-hex.html

compunix-be commented 2 years ago

I'm trying to get this working with Honeywell Flex100 centrale. 2022-04-25 15:17:47 DEBUG (MainThread) [pysiaalarm.base_server] Incoming line: F#123456 2022-04-25 15:17:47 WARNING (MainThread) [pysiaalarm.base_server] Last line could not be parsed succesfully. Error message: No matches found, event was not a SIA or ADM Spec event, line was: %s. Line: F#123456

where 123456 is the account number defined on the Galaxy. The company that installed the system confirmed that SIA protocol was selected for communication. Anything I can do at my end to debug this ?

compunix-be commented 2 years ago

@eavanvalkenburg, I've been able to test further and gather some network traces of communications between my Flex 100 and another app. One communication exchange looks like follow

123456

Nti10:20/id001/CG A DEELB.ING 0

Each of the above lines were send separately, and required acknowledgement.

First line is the account number, second line matches a SIA event block, third line is some additional ASCII text, last line is 0 or end of communication. This messages correspond with the sia_content_regex, but does not get matched. At least for the account line, because the initial 'F' is included in the pattern matching. For your information, I've used https://github.com/dklemm/FlexSIA2MQTT to generate the network traces. Any idea what is going wrong here ?

PS: Or might it be that 4 lines should be concatenated and then matched against the sia_content_regex ?

eavanvalkenburg commented 2 years ago

@compunix-be thank you so much for this effort! It indeed looks like it is spreading things out over multiple messages so this gives me a starting point to see if I can build something for this!

compunix-be commented 2 years ago

@eavanvalkenburg did you had time to research this ? If you want me to debug something, let me know.