Skip to content
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

0.7.0 #36

Merged
merged 21 commits into from
May 23, 2024
Merged

0.7.0 #36

merged 21 commits into from
May 23, 2024

Conversation

Aohzan
Copy link
Collaborator

@Aohzan Aohzan commented Mar 21, 2024

  • Fix default conf missing error during initialization
  • Lint and code improvments
  • Bump pyserial-asyncio
  • Add service translation
  • Handle no USB device found during init
  • Replace the jamming sensor by a binary_sensor and add events catching to it
  • Allow to specify manual path to USB device
  • Disallow multi instance of the integration

Copy link
Contributor

@jaroslawp jaroslawp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rfpparser.py: why did you remove Delta Dore X2D Starbox related code here ? (askin since I am co-author of these ... and use that in my install..)

@Aohzan Aohzan marked this pull request as draft March 22, 2024 08:21
@Aohzan
Copy link
Collaborator Author

Aohzan commented Mar 22, 2024

it's still a draft MR, I don't know why I removed this code, I will revert that

@Aohzan Aohzan marked this pull request as ready for review March 22, 2024 19:38
@Aohzan Aohzan requested a review from jaroslawp March 22, 2024 19:38
@Aohzan Aohzan self-assigned this Mar 22, 2024
@Aohzan Aohzan added bug Something isn't working enhancement New feature or request labels Mar 22, 2024
@Aohzan
Copy link
Collaborator Author

Aohzan commented Mar 22, 2024

ping @Doubledom45 @jaroslawp si vous pouvez review 🙏

@Doubledom45
Copy link
Collaborator

ping si vous pouvez review 🙏

Slt, ✅👁‍🗨
je testerai sur un RPI4B de dev.
Est-ce que tu peux ajouter dans le README.md la liaison avec le HACS direct pour l'installation ?

Open your Home Assistant instance and open a repository inside the Home Assistant Community Store.

@Aohzan
Copy link
Collaborator Author

Aohzan commented Mar 22, 2024

Yes je m'occupe de ça

@Doubledom45
Copy link
Collaborator

Doubledom45 commented Mar 23, 2024

Slt..
J'ai fais test, pas concluant. pas d'enregistrement des entités ?
De plus je vois quelque truc remontés du Type OREGON, et tu prends l'ID sur le id_PHY ? C'est le code des Sondes !
Tu as les Ref dans l'API
image
Donc on ne différencie pas les Sondes, il faut L'ID avec adr-channel , d'ailleurs pour faire relation avec son identité réelle, on devrait traduire en Hexa [ ce qui donnerai le Canal [7:0] et l'adresse [15:8]]
**Moi je ne traduit pas, je modifierai peut-être dans une version Future **
(cela change les ref des ID des utilisateurs !
Permet de faire un peu comme le RFXCOM
image
Et surtout event avec command ? devrait faire event avec autres sinon pas T° et Hygro, en plus possible Batt [OK ou pas]

Ci-dessous une partie du LOG pour Oregon

2024-03-23 06:23:02.900 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpprotocol] received data: ZIA33{ "frame" :{"header": {"frameType": "0", "cluster": "0", "dataFlag": "0", "rfLevel": "-85", "floorNoise": "-107", "rfQuality": "5", "protocol": "5", "protocolMeaning": "OREGON", "infoType": "4", "frequency": "433920"},"infos": {"subType": "0", "id_PHY": "0x1A2D", "id_PHYMeaning": "THGR122/228/238/268,THGN122/123/132", "adr_channel": "6146",  "adr": "24",  "channel": "2",  "qualifier": "32",  "lowBatt": "0", "measures" : [{"type" : "temperature", "value" : "+19.9", "unit" : "Celsius"}, {
2024-03-23 06:23:02.914 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpprotocol] received data: "type" : "hygrometry", "value" : "69", "unit" : "%"}]}}}
2024-03-23 06:23:02.915 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpprotocol] decoded packet: {'node': 'gateway', 'protocol': 'OREGON', 'id': '0x1A2D', 'hardware': 'THGR122/228/238/268,THGN122/123/132', 'command': '+19.9', 'state': '+19.9', 'unit': 'Celsius', 'type': 'temperature'}
2024-03-23 06:23:02.915 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] f:node,v:gateway
2024-03-23 06:23:02.915 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] f:protocol,v:OREGON
2024-03-23 06:23:02.915 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] f:id,v:0x1A2D
2024-03-23 06:23:02.915 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] f:hardware,v:THGR122/228/238/268,THGN122/123/132
2024-03-23 06:23:02.915 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] f:command,v:+19.9
2024-03-23 06:23:02.916 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] f:state,v:+19.9
2024-03-23 06:23:02.916 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] f:unit,v:Celsius
2024-03-23 06:23:02.916 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] f:type,v:temperature
2024-03-23 06:23:02.916 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] event: command -> +19.9
2024-03-23 06:23:02.916 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] packet_events, sensor:command,value:+19.9
2024-03-23 06:23:02.917 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpprotocol] ignore_event
2024-03-23 06:23:02.917 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpprotocol] got event: {'id': 'OREGON_0x1A2D_cmd', 'sensor': 'command', 'value': '+19.9', 'unit': None}
2024-03-23 06:23:02.917 DEBUG (MainThread) [custom_components.rfplayer] event of type sensor: {'id': 'OREGON_0x1A2D_cmd', 'sensor': 'command', 'value': '+19.9', 'unit': None}
2024-03-23 06:23:02.917 DEBUG (MainThread) [custom_components.rfplayer] passing event to {'id': 'OREGON_0x1A2D_cmd', 'sensor': 'command', 'value': '+20.6', 'unit': None}
2024-03-23 06:23:02.918 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpprotocol] decoded packet: {'node': 'gateway', 'protocol': 'OREGON', 'id': '0x1A2D', 'hardware': 'THGR122/228/238/268,THGN122/123/132', 'command': '69', 'state': '69', 'unit': '%', 'type': 'hygrometry'}
2024-03-23 06:23:02.919 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] f:node,v:gateway
2024-03-23 06:23:02.919 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] f:protocol,v:OREGON
2024-03-23 06:23:02.919 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] f:id,v:0x1A2D
2024-03-23 06:23:02.920 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] f:hardware,v:THGR122/228/238/268,THGN122/123/132
2024-03-23 06:23:02.921 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] f:command,v:69
2024-03-23 06:23:02.921 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] f:state,v:69
2024-03-23 06:23:02.921 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] f:unit,v:%
2024-03-23 06:23:02.921 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] f:type,v:hygrometry
2024-03-23 06:23:02.921 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] event: command -> 69
2024-03-23 06:23:02.922 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] packet_events, sensor:command,value:69
2024-03-23 06:23:02.922 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpprotocol] ignore_event
2024-03-23 06:23:02.922 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpprotocol] got event: {'id': 'OREGON_0x1A2D_cmd', 'sensor': 'command', 'value': '69', 'unit': None}
2024-03-23 06:23:02.922 DEBUG (MainThread) [custom_components.rfplayer] event of type sensor: {'id': 'OREGON_0x1A2D_cmd', 'sensor': 'command', 'value': '69', 'unit': None}
2024-03-23 06:23:02.922 DEBUG (MainThread) [custom_components.rfplayer] passing event to {'id': 'OREGON_0x1A2D_cmd', 'sensor': 'command', 'value': '+20.6', 'unit': None}
2024-03-23 06:23:07.199 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpprotocol] received data: ZIA33{ "frame" :{"header": {"frameType": "0", "cluster": "0", "dataFlag": "0", "rfLevel": "-72", "floorNoise": "-107", "rfQuality": "8", "protocol": "5", "protocolMeaning": "OREGON", "infoType": "4", "frequency": "433920"},"infos": {"subType": "0", "id_PHY": "0x1A2D", "id_PHYMeaning": "THGR122/228/238/268,THGN122/123/132", "adr_channel": "51204",  "adr": "200",  "channel": "4",  "qualifier": "32",  "lowBatt": "0", "measures" : [{"type" : "temperature", "value" : "+20.7", "unit" : "Celsius"},
2024-03-23 06:23:07.214 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpprotocol] received data: {"type" : "hygrometry", "value" : "66", "unit" : "%"}]}}}
2024-03-23 06:23:07.215 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpprotocol] decoded packet: {'node': 'gateway', 'protocol': 'OREGON', 'id': '0x1A2D', 'hardware': 'THGR122/228/238/268,THGN122/123/132', 'command': '+20.7', 'state': '+20.7', 'unit': 'Celsius', 'type': 'temperature'}
2024-03-23 06:23:07.215 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] f:node,v:gateway
2024-03-23 06:23:07.215 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] f:protocol,v:OREGON
2024-03-23 06:23:07.215 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] f:id,v:0x1A2D
2024-03-23 06:23:07.216 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] f:hardware,v:THGR122/228/238/268,THGN122/123/132
2024-03-23 06:23:07.216 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] f:command,v:+20.7
2024-03-23 06:23:07.216 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] f:state,v:+20.7
2024-03-23 06:23:07.216 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] f:unit,v:Celsius
2024-03-23 06:23:07.216 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] f:type,v:temperature
2024-03-23 06:23:07.216 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] event: command -> +20.7
2024-03-23 06:23:07.217 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] packet_events, sensor:command,value:+20.7
2024-03-23 06:23:07.217 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpprotocol] ignore_event
2024-03-23 06:23:07.217 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpprotocol] got event: {'id': 'OREGON_0x1A2D_cmd', 'sensor': 'command', 'value': '+20.7', 'unit': None}
2024-03-23 06:23:07.217 DEBUG (MainThread) [custom_components.rfplayer] event of type sensor: {'id': 'OREGON_0x1A2D_cmd', 'sensor': 'command', 'value': '+20.7', 'unit': None}
2024-03-23 06:23:07.217 DEBUG (MainThread) [custom_components.rfplayer] passing event to {'id': 'OREGON_0x1A2D_cmd', 'sensor': 'command', 'value': '+20.6', 'unit': None}
2024-03-23 06:23:07.217 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpprotocol] decoded packet: {'node': 'gateway', 'protocol': 'OREGON', 'id': '0x1A2D', 'hardware': 'THGR122/228/238/268,THGN122/123/132', 'command': '66', 'state': '66', 'unit': '%', 'type': 'hygrometry'}
2024-03-23 06:23:07.218 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] f:node,v:gateway
2024-03-23 06:23:07.218 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] f:protocol,v:OREGON
2024-03-23 06:23:07.218 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] f:id,v:0x1A2D
2024-03-23 06:23:07.218 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] f:hardware,v:THGR122/228/238/268,THGN122/123/132
2024-03-23 06:23:07.218 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] f:command,v:66
2024-03-23 06:23:07.219 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] f:state,v:66
2024-03-23 06:23:07.219 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] f:unit,v:%
2024-03-23 06:23:07.219 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] f:type,v:hygrometry
2024-03-23 06:23:07.219 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] event: command -> 66
2024-03-23 06:23:07.219 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] packet_events, sensor:command,value:66
2024-03-23 06:23:07.219 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpprotocol] ignore_event
2024-03-23 06:23:07.219 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpprotocol] got event: {'id': 'OREGON_0x1A2D_cmd', 'sensor': 'command', 'value': '66', 'unit': None}
2024-03-23 06:23:07.220 DEBUG (MainThread) [custom_components.rfplayer] event of type sensor: {'id': 'OREGON_0x1A2D_cmd', 'sensor': 'command', 'value': '66', 'unit': None}
2024-03-23 06:23:07.220 DEBUG (MainThread) [custom_components.rfplayer] passing event to {'id': 'OREGON_0x1A2D_cmd', 'sensor': 'command', 'value': '+20.6', 'unit': None}

Log en version 0.7.0

2024-03-23 07:12:14.851 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpprotocol] received data: ZIA33{ "f
2024-03-23 07:12:14.895 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpprotocol] received data: rame" :{"header": {"frameType": "0", "cluster": "0", "dataFlag": "0", "rfLevel": "-85", "floorNoise": "-108", "rfQuality": "5", "protocol": "5", "protocolMeaning": "OREGON", "infoType": "4", "frequency": "433920"},"infos": {"subType": "0", "id_PHY": "0x1A2D", "id_PHYMeaning": "THGR122/228/238/268,THGN122/123/132", "adr_channel": "6146",  "adr": "24",  "channel": "2",  "qualifier": "32",  "lowBatt": "0", "measures" : [{"type" : "temperature", "value" : "+19.8", "unit" : "Celsius"}, {"type" :
2024-03-23 07:12:14.911 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpprotocol] received data: "hygrometry", "value" : "69", "unit" : "%"}]}}}
2024-03-23 07:12:14.911 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpprotocol] decoded packet: {'node': 'gateway', 'protocol': 'OREGON', 'id': '0x1A2D', 'hardware': 'THGR122/228/238/268,THGN122/123/132', 'command': '+19.8', 'state': '+19.8', 'unit': 'Celsius', 'type': 'temperature'}
2024-03-23 07:12:14.911 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] f:node,v:gateway
2024-03-23 07:12:14.911 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] f:protocol,v:OREGON
2024-03-23 07:12:14.912 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] f:id,v:0x1A2D
2024-03-23 07:12:14.912 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] f:hardware,v:THGR122/228/238/268,THGN122/123/132
2024-03-23 07:12:14.912 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] f:command,v:+19.8
2024-03-23 07:12:14.912 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] f:state,v:+19.8
2024-03-23 07:12:14.912 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] f:unit,v:Celsius
2024-03-23 07:12:14.912 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] f:type,v:temperature
2024-03-23 07:12:14.913 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] event: command -> +19.8
2024-03-23 07:12:14.913 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] packet_events, sensor:command,value:+19.8
2024-03-23 07:12:14.913 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpprotocol] ignore_event
2024-03-23 07:12:14.913 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpprotocol] got event: {'id': 'OREGON_0x1A2D_cmd', 'sensor': 'command', 'value': '+19.8', 'unit': None}
2024-03-23 07:12:14.913 DEBUG (MainThread) [custom_components.rfplayer] event of type sensor: {'id': 'OREGON_0x1A2D_cmd', 'sensor': 'command', 'value': '+19.8', 'unit': None}
2024-03-23 07:12:14.914 ERROR (MainThread) [homeassistant] Error doing job: Exception in callback SerialTransport._read_ready()
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/asyncio/events.py", line 88, in _run
    self._context.run(self._callback, *self._args)
  File "/usr/local/lib/python3.12/site-packages/serial_asyncio/__init__.py", line 120, in _read_ready
    self._protocol.data_received(data)
  File "/config/custom_components/rfplayer/rflib/rfpprotocol.py", line 62, in data_received
    self.handle_lines()
  File "/config/custom_components/rfplayer/rflib/rfpprotocol.py", line 69, in handle_lines
    self.handle_raw_packet(line)
  File "/config/custom_components/rfplayer/rflib/rfpprotocol.py", line 129, in handle_raw_packet
    self.handle_packet(packet)
  File "/config/custom_components/rfplayer/rflib/rfpprotocol.py", line 268, in handle_packet
    self._handle_packet(packet)
  File "/config/custom_components/rfplayer/rflib/rfpprotocol.py", line 245, in _handle_packet
    self.event_callback(event)
  File "/config/custom_components/rfplayer/__init__.py", line 158, in event_callback
    entity_id = hass.data[DOMAIN][DATA_ENTITY_LOOKUP][event_type][event_id]
                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^
KeyError: 'OREGON_0x1A2D_cmd'
2024-03-23 07:12:19.317 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpprotocol] received data: ZIA33{ "frame" :{"header": {"frameType": "0", "cluster": "0", "dataFlag": "0", "rfLevel": "-101", "floorNoise": "-107", "rfQuality": "2", "protocol": "5", "protocolMeaning": "OREGON", "infoType": "4", "frequency": "433920"},"infos": {"subType": "0", "id_PHY": "0x1A2D", "id_PHYMeaning": "THGR122/228/238/268,THGN122/123/132", "adr_channel": "7172",  "adr": "28",  "channel": "4",  "qualifier": "32",  "lowBatt": "0", "measures" : [{"type" : "temperature", "value" : "+21.2", "unit" : "Celsius"},
2024-03-23 07:12:19.332 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpprotocol] received data: {"type" : "hygrometry", "value" : "63", "unit" : "%"}]}}}
2024-03-23 07:12:19.333 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpprotocol] decoded packet: {'node': 'gateway', 'protocol': 'OREGON', 'id': '0x1A2D', 'hardware': 'THGR122/228/238/268,THGN122/123/132', 'command': '+21.2', 'state': '+21.2', 'unit': 'Celsius', 'type': 'temperature'}
2024-03-23 07:12:19.333 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] f:node,v:gateway
2024-03-23 07:12:19.333 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] f:protocol,v:OREGON
2024-03-23 07:12:19.333 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] f:id,v:0x1A2D
2024-03-23 07:12:19.334 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] f:hardware,v:THGR122/228/238/268,THGN122/123/132
2024-03-23 07:12:19.334 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] f:command,v:+21.2
2024-03-23 07:12:19.334 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] f:state,v:+21.2
2024-03-23 07:12:19.335 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] f:unit,v:Celsius
2024-03-23 07:12:19.335 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] f:type,v:temperature
2024-03-23 07:12:19.335 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] event: command -> +21.2
2024-03-23 07:12:19.335 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] packet_events, sensor:command,value:+21.2
2024-03-23 07:12:19.336 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpprotocol] ignore_event
2024-03-23 07:12:19.336 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpprotocol] got event: {'id': 'OREGON_0x1A2D_cmd', 'sensor': 'command', 'value': '+21.2', 'unit': None}
2024-03-23 07:12:19.336 DEBUG (MainThread) [custom_components.rfplayer] event of type sensor: {'id': 'OREGON_0x1A2D_cmd', 'sensor': 'command', 'value': '+21.2', 'unit': None}
2024-03-23 07:12:19.337 ERROR (MainThread) [homeassistant] Error doing job: Exception in callback SerialTransport._read_ready()
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/asyncio/events.py", line 88, in _run
    self._context.run(self._callback, *self._args)
  File "/usr/local/lib/python3.12/site-packages/serial_asyncio/__init__.py", line 120, in _read_ready
    self._protocol.data_received(data)
  File "/config/custom_components/rfplayer/rflib/rfpprotocol.py", line 62, in data_received
    self.handle_lines()
  File "/config/custom_components/rfplayer/rflib/rfpprotocol.py", line 69, in handle_lines
    self.handle_raw_packet(line)
  File "/config/custom_components/rfplayer/rflib/rfpprotocol.py", line 129, in handle_raw_packet
    self.handle_packet(packet)
  File "/config/custom_components/rfplayer/rflib/rfpprotocol.py", line 268, in handle_packet
    self._handle_packet(packet)
  File "/config/custom_components/rfplayer/rflib/rfpprotocol.py", line 245, in _handle_packet
    self.event_callback(event)
  File "/config/custom_components/rfplayer/__init__.py", line 158, in event_callback
    entity_id = hass.data[DOMAIN][DATA_ENTITY_LOOKUP][event_type][event_id]
                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^
KeyError: 'OREGON_0x1A2D_cmd'
2024-03-23 07:12:33.154 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpprotocol] received data: ZIA66 EDISIOFRAME 0xF0 0x61 0x1A 0xB4 0x02 0
2024-03-23 07:12:33.203 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpprotocol] received data: x08 0x23 0x05 0x00 0x19 0xBD 0x07

ZIA33{ "frame" :{"header": {"frameType": "0", "cluster": "0", "dataFlag": "1", "rfLevel": "-75", "floorNoise": "-87", "rfQuality": "3", "protocol": "16", "protocolMeaning": "EDISIO", "infoType": "15", "frequency": "868350"},"infos": {"subType": "25", "subTypeMeaning": "SET_TEMPERATURE", "id": "3021627888", "qualifier": "2", "info": "8968", "infoMeaning": "ETS-100, 3.5V", "add0": "1981", "add1": "0"}}}

ZIA66 EDISIOFRAME 0xF0 0x61 0x1A 0xB4 0x02 0x08 0x23 0x
2024-03-23 07:12:33.203 WARNING (MainThread) [custom_components.rfplayer.rflib.rfpprotocol] dropping invalid data: ZIA66 EDISIOFRAME 0xF0 0x61 0x1A 0xB4 0x02 0x08 0x23 0x05 0x00 0x19 0xBD 0x07
2024-03-23 07:12:33.203 WARNING (MainThread) [custom_components.rfplayer.rflib.rfpprotocol] no valid packet
2024-03-23 07:12:33.218 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpprotocol] received data: 05 0x01 0x19 0xBD 0x07
2024-03-23 07:12:33.219 WARNING (MainThread) [custom_components.rfplayer.rflib.rfpprotocol] dropping invalid data: ZIA66 EDISIOFRAME 0xF0 0x61 0x1A 0xB4 0x02 0x08 0x23 0x05 0x01 0x19 0xBD 0x07
2024-03-23 07:12:33.347 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpprotocol] received data: ZIA66 EDISIOFRAME 0xF0 0x61 0x1A 0xB4 0x02 0x08 0x
2024-03-23 07:12:33.362 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpprotocol] received data: 23 0x05 0x02 0x19 0xBD 0x07
2024-03-23 07:12:33.363 WARNING (MainThread) [custom_components.rfplayer.rflib.rfpprotocol] dropping invalid data: ZIA66 EDISIOFRAME 0xF0 0x61 0x1A 0xB4 0x02 0x08 0x23 0x05 0x02 0x19 0xBD 0x07
2024-03-23 07:12:34.194 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpprotocol] received data: ZIA33{ "frame" :{"header": {"frameType": "0", "cluster": "0", "dataFlag": "0", "rfLevel": "-72", "floorNoise": "-107", "rfQuality": "8", "protocol": "5", "protocolMeaning": "OREGON", "infoType": "4", "frequency": "433920"},"infos": {"subType": "0", "id_PHY": "0x1A2D", "id_PHYMeaning": "THGR122/228/238/268,THGN122/123/132", "adr_channel": "51204",  "adr": "200",  "channel": "4",  "qualifier": "32",  "lowBatt": "0", "measures" : [{"type" : "temperature", "value" : "+20.7", "unit" : "Celsius"},
2024-03-23 07:12:34.209 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpprotocol] received data: {"type" : "hygrometry", "value" : "66", "unit" : "%"}]}}}
2024-03-23 07:12:34.210 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpprotocol] decoded packet: {'node': 'gateway', 'protocol': 'OREGON', 'id': '0x1A2D', 'hardware': 'THGR122/228/238/268,THGN122/123/132', 'command': '+20.7', 'state': '+20.7', 'unit': 'Celsius', 'type': 'temperature'}
2024-03-23 07:12:34.211 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] f:node,v:gateway
2024-03-23 07:12:34.211 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] f:protocol,v:OREGON
2024-03-23 07:12:34.211 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] f:id,v:0x1A2D
2024-03-23 07:12:34.211 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] f:hardware,v:THGR122/228/238/268,THGN122/123/132
2024-03-23 07:12:34.211 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] f:command,v:+20.7
2024-03-23 07:12:34.211 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] f:state,v:+20.7
2024-03-23 07:12:34.212 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] f:unit,v:Celsius
2024-03-23 07:12:34.212 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] f:type,v:temperature
2024-03-23 07:12:34.212 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] event: command -> +20.7
2024-03-23 07:12:34.212 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] packet_events, sensor:command,value:+20.7
2024-03-23 07:12:34.213 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpprotocol] ignore_event
2024-03-23 07:12:34.213 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpprotocol] got event: {'id': 'OREGON_0x1A2D_cmd', 'sensor': 'command', 'value': '+20.7', 'unit': None}
2024-03-23 07:12:34.213 DEBUG (MainThread) [custom_components.rfplayer] event of type sensor: {'id': 'OREGON_0x1A2D_cmd', 'sensor': 'command', 'value': '+20.7', 'unit': None}
2024-03-23 07:12:34.213 ERROR (MainThread) [homeassistant] Error doing job: Exception in callback SerialTransport._read_ready()
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/asyncio/events.py", line 88, in _run
    self._context.run(self._callback, *self._args)
  File "/usr/local/lib/python3.12/site-packages/serial_asyncio/__init__.py", line 120, in _read_ready
    self._protocol.data_received(data)
  File "/config/custom_components/rfplayer/rflib/rfpprotocol.py", line 62, in data_received
    self.handle_lines()
  File "/config/custom_components/rfplayer/rflib/rfpprotocol.py", line 69, in handle_lines
    self.handle_raw_packet(line)
  File "/config/custom_components/rfplayer/rflib/rfpprotocol.py", line 129, in handle_raw_packet
    self.handle_packet(packet)
  File "/config/custom_components/rfplayer/rflib/rfpprotocol.py", line 268, in handle_packet
    self._handle_packet(packet)
  File "/config/custom_components/rfplayer/rflib/rfpprotocol.py", line 245, in _handle_packet
    self.event_callback(event)
  File "/config/custom_components/rfplayer/__init__.py", line 158, in event_callback
    entity_id = hass.data[DOMAIN][DATA_ENTITY_LOOKUP][event_type][event_id]
                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^
KeyError: 'OREGON_0x1A2D_cmd'

Je sais pas ou en est GCE pour une demande de modif sur le Firmware, pour autoriser les ID complet ?

@Aohzan
Copy link
Collaborator Author

Aohzan commented Apr 4, 2024

@Doubledom45 j'ai fix le problème qui apparait dans les logs, peux-tu revérifier stp ?

sinon je n'ai pas compris le début de ton message, je n'ai pas de sonde Oregon ou autre pour tester cette partie là de mon côté

@Doubledom45
Copy link
Collaborator

Je vais essayer de refaire des tests avec ta version !
Pour Oregon, il ne faut pas prendre l'ID sur le Id_PHY [ c'est le modèle] mais sur l'adr_channel !

Doubledom45 and others added 2 commits April 5, 2024 09:21
Modification de l'ID pour Oregon, doit être sur l' adr_channel !
@Doubledom45
Copy link
Collaborator

Et de plus , il y a 2 valeurs à remontée souvent sur l'OREGON, L'humidité et le température .
Du coup bug !
Idem je pense sur OWL, il y a x valeurs !

@Doubledom45
Copy link
Collaborator

DONC plantage sur la remontée de l'info température !

LOG pour sonde oregon

2024-04-05 09:23:32.064 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpprotocol] received data: ZIA33{ "frame" :{"header": {"frameType": "0", "cluster": "0", "dataFlag": "0", "rfLevel": "-87", "floorNoise": "-107", "rfQuality": "5", "protocol": "5", "protocolMeaning": "OREGON", "infoType": "4", "frequency": "433920"},"infos": {"subType": "0", "id_PHY": "0x1A2D", "id_PHYMeaning": "THGR122/228/238/268,THGN122/123/132", "adr_channel": "51204", "adr": "200", "channel": "4", "qualifier": "32", "lowBatt": "0", "measures" : [{"type" : "temperature", "value" : "+19.7", "unit" : "Celsius"},
2024-04-05 09:23:32.080 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpprotocol] received data: {"type" : "hygrometry", "value" : "61", "unit" : "%"}]}}}
2024-04-05 09:23:32.080 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpprotocol] decoded packet: {'node': 'GATEWAY', 'protocol': 'OREGON', 'id': '51204', 'hardware': 'THGR122/228/238/268,THGN122/123/132', 'command': '+19.7', 'state': '+19.7', 'unit': 'Celsius', 'type': 'temperature'}
2024-04-05 09:23:32.080 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] f:node,v:GATEWAY
2024-04-05 09:23:32.080 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] f:protocol,v:OREGON
2024-04-05 09:23:32.080 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] f:id,v:51204
2024-04-05 09:23:32.081 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] f:hardware,v:THGR122/228/238/268,THGN122/123/132
2024-04-05 09:23:32.081 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] f:command,v:+19.7
2024-04-05 09:23:32.081 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] f:state,v:+19.7
2024-04-05 09:23:32.081 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] f:unit,v:Celsius
2024-04-05 09:23:32.081 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] f:type,v:temperature
2024-04-05 09:23:32.081 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] event: command -> +19.7
2024-04-05 09:23:32.081 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] packet_events, sensor:command,value:+19.7
2024-04-05 09:23:32.081 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpprotocol] ignore_event
2024-04-05 09:23:32.081 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpprotocol] got event: {'id': 'OREGON_51204_cmd', 'sensor': 'command', 'value': '+19.7', 'unit': None}
2024-04-05 09:23:32.081 DEBUG (MainThread) [custom_components.rfplayer] event of type sensor: {'id': 'OREGON_51204_cmd', 'sensor': 'command', 'value': '+19.7', 'unit': None}
2024-04-05 09:23:32.081 ERROR (MainThread) [homeassistant] Error doing job: Exception in callback SerialTransport._read_ready()
Traceback (most recent call last):
File "/usr/local/lib/python3.12/asyncio/events.py", line 88, in _run
self._context.run(self._callback, *self._args)
File "/usr/local/lib/python3.12/site-packages/serial_asyncio/init.py", line 120, in _read_ready
self._protocol.data_received(data)
File "/config/custom_components/rfplayer/rflib/rfpprotocol.py", line 66, in data_received
self.handle_lines()
File "/config/custom_components/rfplayer/rflib/rfpprotocol.py", line 73, in handle_lines
self.handle_raw_packet(line)
File "/config/custom_components/rfplayer/rflib/rfpprotocol.py", line 133, in handle_raw_packet
self.handle_packet(packet)
File "/config/custom_components/rfplayer/rflib/rfpprotocol.py", line 272, in handle_packet
self._handle_packet(packet)
File "/config/custom_components/rfplayer/rflib/rfpprotocol.py", line 249, in _handle_packet
self.event_callback(event)
File "/config/custom_components/rfplayer/init.py", line 151, in event_callback
if event_type not in hass.data[DOMAIN][DATA_ENTITY_LOOKUP]:
~~~~~~~~~^^^^^^^^
KeyError: 'rfplayer'

2eme sonde

2024-04-05 09:23:53.089 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpprotocol] received data: ZIA33{ "frame" :{"header": {"frameType": "0", "cluster": "0", "dataFlag": "0", "rfLevel": "-85", "floorNoise": "-107", "rfQuality": "5", "protocol": "5", "protocolMeaning": "OREGON", "infoType": "4", "frequency": "433920"},"infos": {"subType": "0", "id_PHY": "0x1A2D", "id_PHYMeaning": "THGR122/228/238/268,THGN122/123/132", "adr_channel": "6146", "adr": "24", "channel": "2", "qualifier": "32", "lowBatt": "0", "measures" : [{"type" : "temperature", "value" : "+19.1", "unit" : "Celsius"}, {
2024-04-05 09:23:53.105 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpprotocol] received data: "type" : "hygrometry", "value" : "64", "unit" : "%"}]}}}
2024-04-05 09:23:53.105 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpprotocol] decoded packet: {'node': 'GATEWAY', 'protocol': 'OREGON', 'id': '6146', 'hardware': 'THGR122/228/238/268,THGN122/123/132', 'command': '+19.1', 'state': '+19.1', 'unit': 'Celsius', 'type': 'temperature'}
2024-04-05 09:23:53.105 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] f:node,v:GATEWAY
2024-04-05 09:23:53.105 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] f:protocol,v:OREGON
2024-04-05 09:23:53.105 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] f:id,v:6146
2024-04-05 09:23:53.105 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] f:hardware,v:THGR122/228/238/268,THGN122/123/132
2024-04-05 09:23:53.105 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] f:command,v:+19.1
2024-04-05 09:23:53.105 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] f:state,v:+19.1
2024-04-05 09:23:53.105 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] f:unit,v:Celsius
2024-04-05 09:23:53.105 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] f:type,v:temperature
2024-04-05 09:23:53.106 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] event: command -> +19.1
2024-04-05 09:23:53.106 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] packet_events, sensor:command,value:+19.1
2024-04-05 09:23:53.106 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpprotocol] ignore_event
2024-04-05 09:23:53.106 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpprotocol] got event: {'id': 'OREGON_6146_cmd', 'sensor': 'command', 'value': '+19.1', 'unit': None}
2024-04-05 09:23:53.106 DEBUG (MainThread) [custom_components.rfplayer] event of type sensor: {'id': 'OREGON_6146_cmd', 'sensor': 'command', 'value': '+19.1', 'unit': None}
2024-04-05 09:23:53.106 ERROR (MainThread) [homeassistant] Error doing job: Exception in callback SerialTransport._read_ready()
Traceback (most recent call last):
File "/usr/local/lib/python3.12/asyncio/events.py", line 88, in _run
self._context.run(self._callback, *self._args)
File "/usr/local/lib/python3.12/site-packages/serial_asyncio/init.py", line 120, in _read_ready
self._protocol.data_received(data)
File "/config/custom_components/rfplayer/rflib/rfpprotocol.py", line 66, in data_received
self.handle_lines()
File "/config/custom_components/rfplayer/rflib/rfpprotocol.py", line 73, in handle_lines
self.handle_raw_packet(line)
File "/config/custom_components/rfplayer/rflib/rfpprotocol.py", line 133, in handle_raw_packet
self.handle_packet(packet)
File "/config/custom_components/rfplayer/rflib/rfpprotocol.py", line 272, in handle_packet
self._handle_packet(packet)
File "/config/custom_components/rfplayer/rflib/rfpprotocol.py", line 249, in _handle_packet
self.event_callback(event)
File "/config/custom_components/rfplayer/init.py", line 151, in event_callback
if event_type not in hass.data[DOMAIN][DATA_ENTITY_LOOKUP]:
~~~~~~~~~^^^^^^^^
KeyError: 'rfplayer'

LOg pour OWL IL Y A Plusieurs type OWL ici 180i

2024-04-05 09:24:00.236 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpprotocol] received data: ZIA33{ "frame" :{"header": {"frameType": "0", "cluster": "0", "dataFlag": "0", "rfLevel": "-78", "floorNoise": "-107", "rfQuality": "7", "protocol": "7", "protocolMeaning": "OWL", "infoType": "8", "frequency": "433920"},"infos": {"subType": "0", "id_PHY": "0x0003", "id_PHYMeaning": "CM180i", "adr_channel": "176", "adr": "11", "channel": "0", "qualifier": "6", "lowBatt": "0", "measures" : [{"type" : "energy", "value" : "32", "unit" : "Wh"}, {"type" : "power", "value" : "0", "unit" : "W"},
2024-04-05 09:24:00.263 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpprotocol] received data: {"type" : "P1", "value" : "0", "unit" : "W"}, {"type" : "P2", "value" : "0", "unit" : "W"}, {"type" : "P3","value" : "0", "unit" : "W"}]}}}
2024-04-05 09:24:00.263 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpprotocol] decoded packet: {'node': 'GATEWAY', 'protocol': 'OWL', 'id': None, 'command': '0'}
2024-04-05 09:24:00.263 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] f:node,v:GATEWAY
2024-04-05 09:24:00.263 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] f:protocol,v:OWL
2024-04-05 09:24:00.263 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] f:id,v:None
2024-04-05 09:24:00.263 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] f:command,v:0
2024-04-05 09:24:00.263 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] event: command -> 0
2024-04-05 09:24:00.264 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] packet_events, sensor:command,value:0
2024-04-05 09:24:00.264 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpprotocol] ignore_event
2024-04-05 09:24:00.264 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpprotocol] got event: {'id': 'OWL_cmd', 'sensor': 'command', 'value': '0', 'unit': None}
2024-04-05 09:24:00.264 DEBUG (MainThread) [custom_components.rfplayer] event of type sensor: {'id': 'OWL_cmd', 'sensor': 'command', 'value': '0', 'unit': None}
2024-04-05 09:24:00.264 ERROR (MainThread) [homeassistant] Error doing job: Exception in callback SerialTransport._read_ready()
Traceback (most recent call last):
File "/usr/local/lib/python3.12/asyncio/events.py", line 88, in _run
self._context.run(self._callback, *self._args)
File "/usr/local/lib/python3.12/site-packages/serial_asyncio/init.py", line 120, in _read_ready
self._protocol.data_received(data)
File "/config/custom_components/rfplayer/rflib/rfpprotocol.py", line 66, in data_received
self.handle_lines()
File "/config/custom_components/rfplayer/rflib/rfpprotocol.py", line 73, in handle_lines
self.handle_raw_packet(line)
File "/config/custom_components/rfplayer/rflib/rfpprotocol.py", line 133, in handle_raw_packet
self.handle_packet(packet)
File "/config/custom_components/rfplayer/rflib/rfpprotocol.py", line 272, in handle_packet
self._handle_packet(packet)
File "/config/custom_components/rfplayer/rflib/rfpprotocol.py", line 249, in _handle_packet
self.event_callback(event)
File "/config/custom_components/rfplayer/init.py", line 151, in event_callback
if event_type not in hass.data[DOMAIN][DATA_ENTITY_LOOKUP]:
~~~~~~~~~^^^^^^^^
KeyError: 'rfplayer'

@Aohzan
Copy link
Collaborator Author

Aohzan commented Apr 5, 2024

tu as un exemple de code où tu le gères ?

@Doubledom45
Copy link
Collaborator

tu as un exemple de code où tu le gères ?

Le truc c'est que l'on décode pas comme toi !

Je vois que toi tu transformes les values en command, ce qui fait que tu ne peux dissocier les différentes remontées du sensor !
Ils s'ecrivent tous dans le même sensor "_cmd"

received data: ZIA33{ "frame" :{"header": {"frameType": "0", "cluster": "0", "dataFlag": "0", "rfLevel": "-84", "floorNoise": "-104", "rfQuality": "5", "protocol": "5", "protocolMeaning": "OREGON", "infoType": "4", "frequency": "433920"},"infos": {"subType": "0", "id_PHY": "0x1A2D", "id_PHYMeaning": "THGR122/228/238/268,THGN122/123/132", "adr_channel": "51204", "adr": "200", "channel": "4", "qualifier": "32", "lowBatt": "0", "measures" : [{"type" : "temperature", "value" : "+20.8", "unit" : "Celsius"}, {"type" : "hygrometry", "value" : "56", "unit" : "%"}]}}}
(MainThread) [custom_components.rfplayer.rflib.rfpprotocol] decoded packet: {'node': 'GATEWAY', 'protocol': 'OREGON', 'id': '51204', 'hardware': 'THGR122/228/238/268,THGN122/123/132', 'command⁉': '+20.8', 'state': '+20.8', 'unit': 'Celsius', 'type': 'temperature'}
2024-04-05 11:51:10.068 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] f:node,v:GATEWAY
2024-04-05 11:51:10.068 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] f:protocol,v:OREGON
2024-04-05 11:51:10.068 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] f:id,v:51204
2024-04-05 11:51:10.069 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] f:hardware,v:THGR122/228/238/268,THGN122/123/132
2024-04-05 11:51:10.069 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] f:command,v:+20.8⁉
2024-04-05 11:51:10.069 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] f:state,v:+20.8
2024-04-05 11:51:10.069 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] f:unit,v:Celsius
2024-04-05 11:51:10.069 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] f:type,v:temperature
2024-04-05 11:51:10.069 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] event: command -> +20.8
2024-04-05 11:51:10.069 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] packet_events, sensor:command,value:+20.8
2024-04-05 11:51:10.070 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpprotocol] ignore_event
2024-04-05 11:51:10.070 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpprotocol] got event: {'id': 'OREGON_51204_cmd', 'sensor': 'command', 'value': '+20.8', 'unit': None}
2024-04-05 11:51:10.070 DEBUG (MainThread) [custom_components.rfplayer] event of type sensor: {'id': 'OREGON_51204_cmd', 'sensor': 'command', 'value': '+20.8', 'unit': None}
2024-04-05 11:51:10.070 DEBUG (MainThread) [custom_components.rfplayer] passing event to sensor.oregon_51204

Log du même sensor avec mon add_on au 1er passage ! Ici un peu verbeux, mais simplement pour te montrer !

DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] Packet : ZIA33{ "frame" :{"header": {"frameType": "0", "cluster": "0", "dataFlag": "0", "rfLevel": "-83", "floorNoise": "-102", "rfQuality": "4", "protocol": "5", "protocolMeaning": "OREGON", "infoType": "4", "frequency": "433920"},"infos": {"subType": "0", "id_PHY": "0x1A2D", "id_PHYMeaning": "THGR122/228/238/268,THGN122/123/132", "adr_channel": "51204", "adr": "200", "channel": "4", "qualifier": "32", "lowBatt": "0", "measures" : [{"type" : "temperature", "value" : "+21.1", "unit" : "Celsius"}, {"type" : "hygrometry", "value" : "55", "unit" : "%"}]}}}
DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpprotocol] decoded packet: {'node': 'gateway', 'frameType': '0', 'cluster': '0', 'dataFlag': '0', 'rfLevel': '-83', 'floorNoise': '-102', 'rfQuality': '4', 'infoType': '4', 'frequency': '433920', 'protocol': 'OREGON', 'subType': '0', 'id_PHY': 'THGR122/228/238/268,THGN122/123/132', 'adr_channel': '51204', 'qualifier': '32', 'battery_level': 100, 'battery_level_unit': '%', 'oreg_protocol': 'V2', 'temperature': '+21.1', 'temperature_unit': '°C', 'hygrometry': '55', 'hygrometry_unit': '%', 'id': '51204', 'platform': 'sensor'}
DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] f:node,v:gateway
DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] f:frameType,v:0
DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] f:cluster,v:0
DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] f:dataFlag,v:0
DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] f:rfLevel,v:-83
DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] f:floorNoise,v:-102
DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] f:rfQuality,v:4
DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] f:infoType,v:4
DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] f:frequency,v:433920
DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] f:protocol,v:OREGON
DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] f:subType,v:0
DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] f:id_PHY,v:THGR122/228/238/268,THGN122/123/132
DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] f:adr_channel,v:51204
DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] f:qualifier,v:32
DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] f:battery_level,v:100
DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] f:battery_level_unit,v:%
DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] f:oreg_protocol,v:V2
DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] f:temperature,v:+21.1
DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] f:temperature_unit,v:°C
DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] f:hygrometry,v:55
DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] f:hygrometry_unit,v:%
DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] f:id,v:51204
DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] f:platform,v:sensor
DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] packet_events, sensor:subType,value:0
DEBUG (MainThread) [custom_components.rfplayer] device_id not known, adding new device
DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] packet_events, sensor:qualifier,value:32
DEBUG (MainThread) [custom_components.rfplayer] device_id not known, adding new device
DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] packet_events, sensor:battery_level,value:100
DEBUG (MainThread) [custom_components.rfplayer] device_id not known, adding new device
DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] packet_events, sensor:temperature,value:+21.1
DEBUG (MainThread) [custom_components.rfplayer] device_id not known, adding new device
DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] packet_events, sensor:hygrometry,value:55
DEBUG (MainThread) [custom_components.rfplayer] device_id not known, adding new device

INFO (MainThread) [custom_components.rfplayer.sensor] RfPlayer Sensor ID : 51204typ
INFO (MainThread) [custom_components.rfplayer.sensor] RfPlayer Sensor ID : 51204qua
INFO (MainThread) [custom_components.rfplayer.sensor] RfPlayer Sensor ID : 51204batl
INFO (MainThread) [custom_components.rfplayer.sensor] RfPlayer Sensor ID : 51204temperature
INFO (MainThread) [custom_components.rfplayer.sensor] RfPlayer Sensor ID : 51204hygrometry

J'ai encore pas mal de truc à refaire, mais pour l'instant tourne , il faut que je revoie le config_flow lors du passage sur modif , je pense d'ailleurs trop compliqué et faudrait laisser faire par un envoie de commande !

@Aohzan Aohzan requested review from Doubledom45 and removed request for jaroslawp April 5, 2024 13:25
@Aohzan
Copy link
Collaborator Author

Aohzan commented Apr 5, 2024

je te propose de merger cette PR si tu ne vois pas de regression, et on peut travailler sur une nouvelle PR avec ton code pour mieux traiter les données ?

@Aohzan Aohzan merged commit b965959 into main May 23, 2024
5 checks passed
@Aohzan Aohzan deleted the 0.7.0 branch May 23, 2024 15:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants