zxdavb / ramses_rf

An interface for the RAMSES RF protocol, as used by Honeywell-compatible HVAC & CH/DHW systems.
MIT License
64 stars 17 forks source link

Reporting packet 01FF: message parsing fails #101

Closed Onl1ne1373 closed 9 months ago

Onl1ne1373 commented 9 months ago
16:53:49.052 RQ --- 21:041873 18:010547 --:------ 01FF 026 00802A2A2CD0008000243028320000440280800280FF800400A4 < AssertionError(Support the development of ramses_rf by reporting this packet (002430))
Traceback (most recent call last):
  File "/home/online/src/ramses_rf/src/ramses_tx/message.py", line 261, in _validate
    result = parse_payload(self)
             ^^^^^^^^^^^^^^^^^^^
  File "/home/online/src/ramses_rf/src/ramses_tx/parsers.py", line 2873, in parse_payload
    result = _PAYLOAD_PARSERS.get(msg.code, parser_unknown)(msg._pkt.payload, msg)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/online/src/ramses_rf/src/ramses_tx/parsers.py", line 591, in parser_01ff
    assert payload[16:22] in (
           ^^^^^^^^^^^^^^^^^^^
zxdavb commented 9 months ago

You'll have to provide more information, especially if you're sending contrived payloads.

Onl1ne1373 commented 9 months ago

Hi, this is not a packet I constructed/send, but a request message from a Spider Thermostat to a gateway to check if it's setpoint and mode is right. The other issue I created is about responding to this request.

The strange thing is that I expected that issue #73 should already have solved this.

Onl1ne1373 commented 9 months ago

As I posted in the forum I want to listen to message event in Home Assistant, to reply to the request of the Spider. This failed, I do not get events. With a little fooling around with the regular expression I found out that all 01FF messages are missing. I think this might be related to the above parsing problem.

alias: Thermostaat Onl1ne1373 Setpoint Reply
description: ""
trigger:
  - platform: event
    event_type: ramses_cc_message
condition:
  - condition: template
    value_template: "{{ trigger.event.data.code == \"01FF\" }}"
  - condition: template
    value_template: "{{ trigger.event.data.src == \"21:033620\" }}"
action:
  - service: ramses_cc.send_packet
    data:
      device_id: "21:033620"
      verb: RP
      code: 01FF
      payload: |
        008080{{ ('%x' % ((state_attr('climate.thermostat_onl1ne1373',
         'temperature') | float * 2)) | round) | upper }}28D0000000143C80800000B40080800280FF80040000
mode: single
Onl1ne1373 commented 9 months ago

Examples of packets gecaptured. Spider thermostat communicating with Spider Connect Gateway:

072  W --- 18:011649 21:059180 --:------ 01FF 026 0080802727D0000000143C80800000B40080800280FF80040000
066  I --- 21:059180 18:011649 --:------ 01FF 026 0080282729D0008000143C28400000C40280800280FF80040084
073 RQ --- 21:059180 18:011649 --:------ 01FF 026 008028282AD0008000243028400000C40280800280FF80040084
067 RP --- 18:011649 21:059180 --:------ 01FF 026 0080802828D0000000143C80800000B40080800280FF80040000

And packages from two Spiders in my house:

RQ --- 21:041873 18:010547 --:------ 01FF 026 00802B2A2CD0008000243028320000440280800280FF800400A4
RQ --- 21:033620 18:010547 --:------ 01FF 026 00802B2729D0008000143C28320000C10280800280FF80040020

As I compare the asserts, these seem to be the changes:

payload[16:22] can also be 002430, is send by a Master Spider, one that is connected by RF and OpenTherm. payload[48:] can also be 00A4 (OpenTherm and RF Spider) and 0020 for RF Spider

RQ: payload[22:26] can also be 2832 payload[30:34] can also be 4402 or C102

RP: payload[30:34] can also be B400

Onl1ne1373 commented 9 months ago

Changed the parsers.py and now I get the RQ messages in the event system of Home Assistant:

--- parsers.py.bk
+++ parsers.py
@@ -585,27 +585,28 @@
     # see: https://github.com/zxdavb/ramses_rf/issues/73

     assert payload[:4] in ("0080", "0180"), f"{_INFORM_DEV_MSG} ({payload[:4]})"
-    assert payload[12:14] == "00", f"{_INFORM_DEV_MSG} ({payload[12:14]})"
-    assert payload[16:22] in (
+    assert payload[12:14] == "00", f"{_INFORM_DEV_MSG} ({payload[12:14]})"      
+    assert payload[16:22] in (                                                  
         "00143C",
-        "7F8080",
-    ), f"{_INFORM_DEV_MSG} ({payload[16:22]})"  # idx|25.9C?
-    assert payload[26:30] == "0000", f"{_INFORM_DEV_MSG} ({payload[26:30]})"
+        "002430",                                                               
+        "7F8080",                                                               
+    ), f"{_INFORM_DEV_MSG} ({payload[16:22]})"  # idx|25.9C?                    
+    assert payload[26:30] == "0000", f"{_INFORM_DEV_MSG} ({payload[26:30]})"    
     assert payload[34:46] == "80800280FF80", f"{_INFORM_DEV_MSG} ({payload[34:46]})"
-    assert payload[48:] == "0000", f"{_INFORM_DEV_MSG} ({payload[48:]})"
-
-    if msg.verb in (I_, RQ):  # from Spider thermostat to gateway
-        assert payload[14:16] == "80", f"{_INFORM_DEV_MSG} ({payload[14:16]})"
-        assert payload[22:26] == "2840", f"{_INFORM_DEV_MSG} ({payload[22:26]})"
-        assert payload[30:34] == "0104", f"{_INFORM_DEV_MSG} ({payload[30:34]})"
+    assert payload[48:] in ("0000", "00A4", "0020"), f"{_INFORM_DEV_MSG} ({payload[48:]})"            
+                                                                                    
+    if msg.verb in (I_, RQ):  # from Spider thermostat to gateway                   
+        assert payload[14:16] == "80", f"{_INFORM_DEV_MSG} ({payload[14:16]})"      
+        assert payload[22:26] in ("2840", "2832"), f"{_INFORM_DEV_MSG} ({payload[22:26]})"    
+        assert payload[30:34] in ("0104", "4402", "C102"), f"{_INFORM_DEV_MSG} ({payload[30:34]})"    
         assert payload[46:48] in ("04", "07"), f"{_INFORM_DEV_MSG} ({payload[46:48]})"
-
-    if msg.verb in (RP, W_):  # from Spider gateway to thermostat
-        assert payload[4:6] == "80", f"{_INFORM_DEV_MSG} ({payload[4:6]})"
+                                                                                      
+    if msg.verb in (RP, W_):  # from Spider gateway to thermostat                     
+        assert payload[4:6] == "80", f"{_INFORM_DEV_MSG} ({payload[4:6]})"            
         # assert payload[6:8] == payload[8:10], f"{_INFORM_DEV_MSG} ({payload[8:10]})"
         assert payload[14:16] in ("00", "7F"), f"{_INFORM_DEV_MSG} ({payload[14:16]})"
-        assert payload[22:26] == "8080", f"{_INFORM_DEV_MSG} ({payload[22:26]})"
-        assert payload[30:34] == "3100", f"{_INFORM_DEV_MSG} ({payload[30:34]})"
+        assert payload[22:26] == "8080", f"{_INFORM_DEV_MSG} ({payload[22:26]})"      
+        assert payload[30:34] in ("3100", "B400"), f"{_INFORM_DEV_MSG} ({payload[30:34]})"      
         assert payload[46:48] in ("00", "04"), f"{_INFORM_DEV_MSG} ({payload[46:48]})"
zxdavb commented 9 months ago

Can you please send me every 01FF packet you have? Preferably in packet logs, so that I can look at them in context. You can PM them to me.

Onl1ne1373 commented 9 months ago

I did send you the packet logs I have. Thanks for looking at them!

Regarding the D0 field, these Spiders should have day/night temperatures according to the manual, but this is disabled because they are connected to a Heat pump WPU5G and Spider Autotemp floor control. You cannot change that on the thermostat.

zxdavb commented 9 months ago

Closing in favour of #73