home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
69.94k stars 29.03k forks source link

Error in RFXCom parsing #67423

Closed Chilgl0rd closed 2 years ago

Chilgl0rd commented 2 years ago

The problem

It can be a unknow device as TIC Pulse https://www.cartelectronic.fr/home/124-tic-pulses-433mhz-3760313520004.html or LaCrosse TX3....

Logger: root Source: /usr/src/homeassistant/homeassistant/bootstrap.py:319 First occurred: 09:48:17 (1 occurrences) Last logged: 09:48:17

Uncaught thread exception Traceback (most recent call last): File "/usr/local/lib/python3.9/threading.py", line 973, in _bootstrap_inner self.run() File "/usr/local/lib/python3.9/threading.py", line 910, in run self._target(*self._args, **self._kwargs) File "/usr/local/lib/python3.9/site-packages/RFXtrx/init.py", line 893, in _connect event = self.transport.receive_blocking() File "/usr/local/lib/python3.9/site-packages/RFXtrx/init.py", line 705, in receive_blocking return self.parse(pkt) File "/usr/local/lib/python3.9/site-packages/RFXtrx/init.py", line 637, in parse pkt = lowlevel.parse(data) File "/usr/local/lib/python3.9/site-packages/RFXtrx/lowlevel.py", line 2759, in parse pkt.load_receive(data) File "/usr/local/lib/python3.9/site-packages/RFXtrx/lowlevel.py", line 2196, in load_receive self.battery = self.rssi_byte & 0x0f TypeError: unsupported operand type(s) for &: 'NoneType' and 'int'

What version of Home Assistant Core has the issue?

core-2022.2.9

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

rfxtrx

Link to integration documentation on our website

https://www.home-assistant.io/integrations/rfxtrx

Diagnostics information

2022-03-01 09:48:17 DEBUG (Thread-3) [RFXtrx] Recv: 0x15 0x60 0x01 0x03 0x07 0x7d 0x20 0x06 0x86 0x11 0x00 0x3a 0x92 0xc9 0x00 0x00 0x00 0x00 0x01 0x4a 0x02 0x79 2022-03-01 09:48:17 ERROR (Thread-3) [root] Uncaught thread exception Traceback (most recent call last): File "/usr/local/lib/python3.9/threading.py", line 973, in _bootstrap_inner self.run() File "/usr/local/lib/python3.9/threading.py", line 910, in run self._target(*self._args, **self._kwargs) File "/usr/local/lib/python3.9/site-packages/RFXtrx/init.py", line 893, in _connect event = self.transport.receive_blocking() File "/usr/local/lib/python3.9/site-packages/RFXtrx/init.py", line 705, in receive_blocking return self.parse(pkt) File "/usr/local/lib/python3.9/site-packages/RFXtrx/init.py", line 637, in parse pkt = lowlevel.parse(data) File "/usr/local/lib/python3.9/site-packages/RFXtrx/lowlevel.py", line 2759, in parse pkt.load_receive(data) File "/usr/local/lib/python3.9/site-packages/RFXtrx/lowlevel.py", line 2196, in load_receive self.battery = self.rssi_byte & 0x0f TypeError: unsupported operand type(s) for &: 'NoneType' and 'int'

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

probot-home-assistant[bot] commented 2 years ago

rfxtrx documentation rfxtrx source (message by IssueLinks)

probot-home-assistant[bot] commented 2 years ago

Hey there @danielhiversen, @elupus, @robbie1221, mind taking a look at this issue as it has been labeled with an integration (rfxtrx) you are listed as a code owner for? Thanks! (message by CodeOwnersMention)

elupus commented 2 years ago

I've created a pull request for fixing this in upstream library. Will need that merged a new release created to get this working.

Chilgl0rd commented 2 years ago

Wonderful !!! Thanks @elupus ! I am face also to some other issues of persitency / detection but I am going to test more before to open a case.

Chilgl0rd commented 2 years ago

Example of trame:

26/02/2022 10:53:09:889= 15600109077D200686110039F64A0000000007C60269 Packettype = Cartelectronic subtype = TIC Sequence nbr = 9 ID = 077D200686 Contract/Price= 11 Counter1 = 0039F64A decimal:3798602 Counter2 = 00000000 decimal:0 No change price time warning TeleInfo = Present Apparent Power= 07C6 decimal:1990 Signal level = 6 -72dBm Battery = OK

elupus commented 2 years ago

Will need updated lib.

Chilgl0rd commented 2 years ago

You can find in that doc of RFPlayer the spec of the TIC (Type 13)

Specifications API RFPLAYER V1.15.pdf

elupus commented 2 years ago

The lib has been fixed already, but home assistant need to be updated to use the updated lib.

elupus commented 2 years ago

Ps.. that doc shows RFLink stiff, not rfxtrx data.

Chilgl0rd commented 2 years ago

Its shows the TIC data, then it can be handel by others transivers

elupus commented 2 years ago

Yes but the format differs. Rfxtrx parses incoming RF data and present it in their own format. So you can't use that to parse the data from rfxtrx. Anyway it might be usefull for the rflink integration.

Chilgl0rd commented 2 years ago

I didn't know if you had enough information to parse the informations (values, types, fields...) I assume, it should pop up in integration page once it was released. Many thanks for this reactivity !

Chilgl0rd commented 2 years ago

It is RFPlayer, maybe close to RFLink. I was bought last year by CGE electronics. They are looking for some help to integrate it to HA: https://community.home-assistant.io/t/rfplayer-support-on-ha-433-and-868mhz/13858/2

Chilgl0rd commented 2 years ago

Hello @elupus

The new bump catched the TIC, it is a good step ! Thanks !! image But the most important value "Apparent Power" not show up. image Regards, Chilgord

elupus commented 2 years ago

Crap: seems it had some special case logic in lib for this here: https://github.com/Danielhiversen/pyRFXtrx/blob/25c4311b0bad1319a9715d8faaebc41c8ac8288b/RFXtrx/__init__.py#L499

Needs fixes in lib again. Can you open a new issue for this? That is somewhat more of a feature request compared to this issue.

Chilgl0rd commented 2 years ago

Hello @elupus , I don't see anymore the new issue I raised earlier for the TIC :-/

elupus commented 2 years ago

https://github.com/home-assistant/core/issues/67823