-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ADM-CID: Last line could not be parsed as a SIAEvent or OHEvent #22
Comments
Could you turn on some additional logging and post here:
|
This configuration is already active. No more log than above is generated. |
ok and this is using the official integration or the HACS one? |
Official |
ok, so I added the line above to the tests and there it works so there is something else going on, you have the keys used for encrypting the same in both? and could you do a test without encryption? |
Yes i have. I already have a working integration with another home automation solution (ioBroker with ioBroker.sia).
No, I'm afraid I can't. However, I think that the cause is not the encryption, as this only comes into play afterwards ;) When looking at the code, the cause can actually only be here, as the following log line can only be thrown by an
The regular expression is also correct according to me.... |
No that is not completely the case, it can also be raised by the parse_content function later on (here). So I noticed there is a small gap when the account is not encrypted but the message is, which would result in trying to parse content in the wrong way which throws the eventformaterror as well. So I'm doing two things now that will hopefully help with this one. 1) check if both the message and the account are encrypted 2) change the logged error for the other situation. |
You're right, I overlooked it :P Thanks! |
@eavanvalkenburg I have tested the latest DEV version and I still get an error:
|
which version did you try? |
Latest dev:
pysiaalarm==3.0.2 |
I have found the error and now the decryption of the messages works. The error is here.
This way it works fine for me: self.key_b = bytes.fromhex(self.key) if self.key else None |
Well, I think changing that would break other alarms. Most alarms use a key inputted as string with just hex characters, so I will have to test to see. What is the key you use? |
I think a key that is given in hex format but then encoded as a string in byte is not necessarily the best solution. e.g. my alarm system only accepts a 16 byte hex key. Others only accept a string? Do you know anyone who is actively using encryption with the current version? |
I am! In my alarm they ask you to set the key as a hex, so you type in a key with just 0-9A-F, but I'll have a look! |
ok, thanks. |
Have you looked? |
@bropat could you share an example of the key you use, especially the format? |
For example: |
Any news about it? |
Another proposal in contrast to this is: If you accept any string as a key and do not check whether it is a HEX "string", i.e. only check the length of the string in bytes, it also works for me. My key is a string that has been converted to a hex key so that it can be entered into the alarm system as a numeric hex key (not as a hex string). Unfortunately, I cannot change this key without contacting the alarm company. Example: Original Key as string: dhF3978fbas5Naj1 When I enter the string in the SIA integration, I get the error that it is not a "hex string", but would be correctly translated by pysiaalarm into a byte array and it would work. I hope I have expressed myself better ;) |
System informations:
I get the following error message:
Can you maybe help me?
Thanks!
Regards
Patrick
The text was updated successfully, but these errors were encountered: