Code Monkey home page Code Monkey logo

Comments (12)

eavanvalkenburg avatar eavanvalkenburg commented on August 30, 2024

yeah, I've seen this sometimes during testing, not yet in real systems, are you using encryption? because if so, there are random numbers added to a message as padding and those sometimes cause this, let me know and I will see if I can catch this in the code.

from sia.

j2ko avatar j2ko commented on August 30, 2024

I have the same issue and yes - it's when encryption is enabled

2021-01-19 11:51:11 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("ascii"))
UnicodeDecodeError: 'ascii' codec can't decode byte 0x84 in position 1: ordinal not in range(128)
2021-01-19 11:51:16 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("ascii"))
UnicodeDecodeError: 'ascii' codec can't decode byte 0x80 in position 12: ordinal not in range(128)

from sia.

scorbacella avatar scorbacella commented on August 30, 2024

Hi,
in my case the encryption is not enabled.
In the log I find different codes in different positions:

UnicodeDecodeError: 'ascii' codec can't decode byte 0x94 in position 20: ordinal not in range(128)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe7 in position 23: ordinal not in range(128)
UnicodeDecodeError: 'ascii' codec can't decode byte 0x83 in position 20: ordinal not in range(128)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe4 in position 21: ordinal not in range(128)

Although the message, just before the error, is correctly decoded, It seens it is lost

from sia.

eavanvalkenburg avatar eavanvalkenburg commented on August 30, 2024

Should be fixed now, please go into the custom components and change the manifest to mention package version: 2.0.9b4 and let me know! @scorbacella and @j2ko

from sia.

eavanvalkenburg avatar eavanvalkenburg commented on August 30, 2024

Also just created new beta release for the integration which should have the fix for this as well.

from sia.

eavanvalkenburg avatar eavanvalkenburg commented on August 30, 2024

can you check if you still see this after updating to the latest (v0.5.0b4)?

from sia.

scorbacella avatar scorbacella commented on August 30, 2024

Hi,
the alarm control panel is correctly updated.

however, I use the event bus to trigger some automations based on SIA messages with custom codes and it seems it is not working anymore:

2021-04-13 13:46:53 DEBUG (MainThread) [pysiaalarm.event] Content matches: {'account': '123456', 'ti': None, 'id': None, 'ri': '0', 'code': 'UX', 'message': '2', 'xdata': None, 'timestamp': '13:46:26,04-13-2021'}
2021-04-13 13:46:56 DEBUG (MainThread) [pysiaalarm.base_server] Incoming line: �02001100180002977?A [U�u�w1bszso�
2021-04-13 13:46:56 WARNING (MainThread) [pysiaalarm.base_server] Last line could not be parsed as a SIAEvent or OHEvent, line was: �02001100180002977?A [U�u�w1bszso�
2021-04-13 13:49:16 DEBUG (MainThread) [pysiaalarm.base_server] Incoming line: 5670004D"SIA-DCS"8070L0#123456[#123456|Nri0KR1^TAST. 001 ^]_13:49:12,04-13-2021
2021-04-13 13:49:16 WARNING (MainThread) [pysiaalarm.base_server] Last line could not be parsed as a SIAEvent or OHEvent, line was: 5670004D"SIA-DCS"8070L0#123456[#123456|Nri0KR1^TAST. 001 ^]_13:49:12,04-13-2021

Furthermore, in debug log I see the SIA message repeated many times (don't know if it's an expected behaviour):

2021-04-13 13:46:50 DEBUG (MainThread) [pysiaalarm.base_server] Incoming line: 8D35004D"SIA-DCS"8068L0#123456[#123456|Nri9OP0^GARAGE ^]_13:46:25,04-13-2021
2021-04-13 13:46:50 DEBUG (MainThread) [pysiaalarm.event] Content matches: {'account': '123456', 'ti': None, 'id': None, 'ri': '9', 'code': 'OP', 'message': '0^GARAGE ^', 'xdata': None, 'timestamp': '13:46:25,04-13-2021'}
2021-04-13 13:46:50 DEBUG (MainThread) [pysiaalarm.event] Content matches: {'account': '123456', 'ti': None, 'id': None, 'ri': '9', 'code': 'OP', 'message': '0^GARAGE ^', 'xdata': None, 'timestamp': '13:46:25,04-13-2021'}
2021-04-13 13:46:50 DEBUG (MainThread) [pysiaalarm.event] Content matches: {'account': '123456', 'ti': None, 'id': None, 'ri': '9', 'code': 'OP', 'message': '0^GARAGE ^', 'xdata': None, 'timestamp': '13:46:25,04-13-2021'}
2021-04-13 13:46:50 DEBUG (MainThread) [pysiaalarm.event] Content matches: {'account': '123456', 'ti': None, 'id': None, 'ri': '9', 'code': 'OP', 'message': '0^GARAGE ^', 'xdata': None, 'timestamp': '13:46:25,04-13-2021'}
2021-04-13 13:46:50 DEBUG (MainThread) [pysiaalarm.event] Content matches: {'account': '123456', 'ti': None, 'id': None, 'ri': '9', 'code': 'OP', 'message': '0^GARAGE ^', 'xdata': None, 'timestamp': '13:46:25,04-13-2021'}
2021-04-13 13:46:50 DEBUG (MainThread) [pysiaalarm.event] Content matches: {'account': '123456', 'ti': None, 'id': None, 'ri': '9', 'code': 'OP', 'message': '0^GARAGE ^', 'xdata': None, 'timestamp': '13:46:25,04-13-2021'}
2021-04-13 13:46:50 DEBUG (MainThread) [pysiaalarm.event] Content matches: {'account': '123456', 'ti': None, 'id': None, 'ri': '9', 'code': 'OP', 'message': '0^GARAGE ^', 'xdata': None, 'timestamp': '13:46:25,04-13-2021'}
2021-04-13 13:46:50 DEBUG (MainThread) [pysiaalarm.event] Content matches: {'account': '123456', 'ti': None, 'id': None, 'ri': '9', 'code': 'OP', 'message': '0^GARAGE ^', 'xdata': None, 'timestamp': '13:46:25,04-13-2021'}
2021-04-13 13:46:50 DEBUG (MainThread) [pysiaalarm.event] Content matches: {'account': '123456', 'ti': None, 'id': None, 'ri': '9', 'code': 'OP', 'message': '0^GARAGE ^', 'xdata': None, 'timestamp': '13:46:25,04-13-2021'}
2021-04-13 13:46:50 DEBUG (MainThread) [pysiaalarm.event] Content matches: {'account': '123456', 'ti': None, 'id': None, 'ri': '9', 'code': 'OP', 'message': '0^GARAGE ^', 'xdata': None, 'timestamp': '13:46:25,04-13-2021'}
2021-04-13 13:46:50 DEBUG (MainThread) [pysiaalarm.event] Content matches: {'account': '123456', 'ti': None, 'id': None, 'ri': '9', 'code': 'OP', 'message': '0^GARAGE ^', 'xdata': None, 'timestamp': '13:46:25,04-13-2021'}
2021-04-13 13:46:51 DEBUG (MainThread) [pysiaalarm.event] Content matches: {'account': '123456', 'ti': None, 'id': None, 'ri': '9', 'code': 'OP', 'message': '0^GARAGE ^', 'xdata': None, 'timestamp': '13:46:25,04-13-2021'}
2021-04-13 13:46:51 DEBUG (MainThread) [pysiaalarm.event] Content matches: {'account': '123456', 'ti': None, 'id': None, 'ri': '9', 'code': 'OP', 'message': '0^GARAGE ^', 'xdata': None, 'timestamp': '13:46:25,04-13-2021'}
2021-04-13 13:46:51 DEBUG (MainThread) [pysiaalarm.event] Content matches: {'account': '123456', 'ti': None, 'id': None, 'ri': '9', 'code': 'OP', 'message': '0^GARAGE ^', 'xdata': None, 'timestamp': '13:46:25,04-13-2021'}
2021-04-13 13:46:51 DEBUG (MainThread) [pysiaalarm.event] Content matches: {'account': '123456', 'ti': None, 'id': None, 'ri': '9', 'code': 'OP', 'message': '0^GARAGE ^', 'xdata': None, 'timestamp': '13:46:25,04-13-2021'}
2021-04-13 13:46:51 DEBUG (MainThread) [pysiaalarm.event] Content matches: {'account': '123456', 'ti': None, 'id': None, 'ri': '9', 'code': 'OP', 'message': '0^GARAGE ^', 'xdata': None, 'timestamp': '13:46:25,04-13-2021'}
2021-04-13 13:46:51 DEBUG (MainThread) [pysiaalarm.event] Content matches: {'account': '123456', 'ti': None, 'id': None, 'ri': '9', 'code': 'OP', 'message': '0^GARAGE ^', 'xdata': None, 'timestamp': '13:46:25,04-13-2021'}
2021-04-13 13:46:51 DEBUG (MainThread) [pysiaalarm.event] Content matches: {'account': '123456', 'ti': None, 'id': None, 'ri': '9', 'code': 'OP', 'message': '0^GARAGE ^', 'xdata': None, 'timestamp': '13:46:25,04-13-2021'}
2021-04-13 13:46:51 DEBUG (MainThread) [pysiaalarm.event] Content matches: {'account': '123456', 'ti': None, 'id': None, 'ri': '9', 'code': 'OP', 'message': '0^GARAGE ^', 'xdata': None, 'timestamp': '13:46:25,04-13-2021'}
2021-04-13 13:46:51 DEBUG (MainThread) [pysiaalarm.event] Content matches: {'account': '123456', 'ti': None, 'id': None, 'ri': '9', 'code': 'OP', 'message': '0^GARAGE ^', 'xdata': None, 'timestamp': '13:46:25,04-13-2021'}
2021-04-13 13:46:51 DEBUG (MainThread) [pysiaalarm.event] Content matches: {'account': '123456', 'ti': None, 'id': None, 'ri': '9', 'code': 'OP', 'message': '0^GARAGE ^', 'xdata': None, 'timestamp': '13:46:25,04-13-2021'}
.... other hundred times

from sia.

eavanvalkenburg avatar eavanvalkenburg commented on August 30, 2024

The . was throwing it off, releasing a fix in the next few minutes.

from sia.

scorbacella avatar scorbacella commented on August 30, 2024

Hi Eduard, for me the last working release is the v0.4.0-beta.2.
Which test can I do for you?
Just a question: if I reinstall the 0.5 beta 4 can I rollback to 0.4 beta 2 later? I don't see this version in the list of the available version in HACS.
Thanks

from sia.

eavanvalkenburg avatar eavanvalkenburg commented on August 30, 2024

I just checked the difference in package and should be better now (made it as "wide" of a match as possible.). Sorry that it took some time, but hopefully this fixes it. I also changed the HA event format, to just include the whole SIA_Event in there, so you might need to check that if you are using attributes or event as trigger for automations.

from sia.

j2ko avatar j2ko commented on August 30, 2024

I can confirm that I do not see this issue anymore after updating to the v0.5.0-beta.9 version.
@eavanvalkenburg Is there any stable version available with this fix?

from sia.

eavanvalkenburg avatar eavanvalkenburg commented on August 30, 2024

yeah, I think so, the proper release of the package has it, and I think that is also included in the latest beta of this custom component, and that version is used in the official integration of HA.

from sia.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.