-
Notifications
You must be signed in to change notification settings - Fork 7
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
wip(protocol-next): implementing another heat pump protocol #52
base: main
Are you sure you want to change the base?
Conversation
@taloriko I've already added parsing of time and date from the hmi message. You may want to check if the values are correct. |
Yes, looks great so far. I will incorporate the findings later. One more hint, if you use the python script, you will get dumps in hex and dec representation. It is WAY easier to spot the changed attributes. For example: e.g. in dec
or in hex
I think you've missed Operation Mode |
I updated the implementation based on your findings. Please note PROTOCOL_NEXT.md . You might also try to edit that file directly or add comments directly to the document by reviewing this PR. This would be actually a nice way implementing this 😬 It might be helpful to also have a look on the pre-existing PROTOCOL.md since I expect that there will be a lot of similarities :) |
I can't edit the PROTOCOL_NEXT.md file directly. I'm using GitHub for the first time and hope that the PR Patch 1 is suitable. I'm currently stuck with the timer. The changes start counting from byte 0 at index 9. I have a few examples:
|
…lla, airduct, main temps
To narrow down the results more precisely, I only changed the beginning of the first time window and observed the respective outcome. Byte 9 could represent the minutes since 00:00. From 6:00, it looks like it represents minutes until midnight. At 7:00, it doesn’t fit anymore – or am I calculating it incorrectly? Starting from 6 a.m., it seems that Byte 9 and 10 switch with Byte 29 and 30, and thus the time windows change. 00:00-12:00 | 16:00-22:00 | 18h,22,48,18,0,0,0,48,0,2,0,0,208,2,0,0,0,40,70,49,54,16,0,0,0,0,78,69,0,0,192,3,104,1 Timer 00:00-04:00 | 05:00-09:00 | 8h Timer 01:00-05:00 | 06:00-11:00 | 9h Timer 01:00-05:00 | 06:00-14:00 | 12h Timer 01:00-09:00 | XXXXXXX | 8h Time window: Setting limitations |
No worries, we can focus on other attributes first. I will try to look in these dumps as soon as I have some time for this. Alternatively, if you have a formula which seems promising, we can try to implement it and see if it matches... |
I’ve now tested everything I could find on the HMI (Menu + Installer Menu). I couldn’t identify any further details. I’ve added the time windows, though I’m still not entirely certain about their full functionality. Here are my observations:
Do you have any further ideas on how we could test these bytes? Otherwise, I would wrap up the HMI testing and shift focus to energy management. |
I think initially you have identified all major attributes of interest in the hmi message 🍻 A few of these leftover bytes might be reserved for commands. Checksum is the last Byte 34, which is not available in the dumps by AquaMQTT, so it is likely that there is also something else stored in Byte 33. You may try to enter the secret menu "spin the wheel left and then to the right" and you get some more advanced options. You may reverse these items as well, but AquaMQTT currently does not implement commands. I think I documented how commands work in my protocol document, not sure if they changed the pattern with the new protocol 🤷♂️ But changing this advanced settings is somehow interesting, because you're changing the main message and you able to identify more information from the main message. For example, if you set the fan speed level to 55%, you will see some value changing within the main message to 55% 😉 In the meantime I will implement the changes to speak both protocol version at the same time, so we can merge this to main as soon as we feel like it's ready. At some point in time I need you to provide a large (maybe a few minutes) raw dump using AquaDebug. Only the logs from AquaDebug contains the checksum and we need to find out, how the crc values are actually calculated. In MITM mode we need to recreate messages and therefore have to generate the checksum the same way. So understanding this pattern is crucial for getting MITM to work 😬 |
No it does not need to run during the dump. There will be a lot of hmi messages and they change checksum frequently since the time is always changing :) But while dumping, you may also open the secret menu one time. We should see how error messages look like. We need to identify them for MITM, too. |
Today, I wanted to analyze the next set of data, and I noticed that the ESP32 restarts every 10 seconds. I have always received the data so far, but there were occasional dropouts. I initially thought that IP-Symcon couldn’t receive the topics quickly enough, which caused these gaps. First, I searched for a timeout issue and found one in the WiFi settings. I adjusted the value to 600:
However, this change did not fix the problem. I’m not sure if it’s related, but I also had to adjust the code slightly to be able to flash without errors:
I replaced CustomConfiguration with a different configuration. |
Most probably I broke something with my latest commits. I will check. Sorry for that 😅 Edit: with my simulation it is not crashing, so its probably related to the protocol 🤷♂️ , but I fixed something which could lead to the crash. It is most likely memory corruption, since I've refactored a lot of stuff with the support of both protocols in parallel. In any way, the large dump of AquaDebug (while opening the super secret menu) would be really helpful. Once I have that, I can simulate your heatpump, find out how the error message looks like and can begin trying to figure out how the checksum works. If it is still crashing with latest commit, you can go back to the one where I did not refactored the serial protocols via Looking forward! |
bd84167
to
84e58f0
Compare
I have finally created the log files with AquaDebug. I created various files:
aqua_debug_data_Normal.txt |
Nice, we found the error message 🎉 Here is an example:
I will add debug topics for those, but you don't need to figure out what the bytes in this message actually mean (of course you can try, if you like). AquaMQTT is currently mostly interested in forwarding these messages to the HMI controller in MITM mode and therefore we have to know how they look like. This is how it works:
So we have also identified the error requestId in the hmi message, and the requestId in the error message. Enough for today |
…s, enable mitm (experimental)
Based on the dumps I figured out how the checksum is generated. Moreover I added error message parsing and passing. You might want to try MITM mode now and see if it works. As soon as you removed the passthrough jumper, and changed the configuation to
Be aware that overrides / controls are not yet supported for the next protocol, if the above items are working we add the functionality for sure :) |
The values I receive via MQTT seem correct at first glance. I can see the values on the HMI and control various components in test mode. In the super-secret menu, I can read errors. Unfortunately, the controller restarts every 5–12 seconds. |
Actually, these are very good news, happy to get your heat pump fully supported soon 👍 I'll do the refactoring soon and resolve the crash you have. In the meantime you should go back to listener mode, because crashes during MITM might lead in protocol dropouts. Not sure if the heat-pump likes that behavior or not 🤷♂️ You might want to proceed with completing the protocol, observing states in the main message is actually nice. These are the icons shown in the hmi controller (fan is on, heat element is on, external boiler is on...). But of course we can proceed to add things step by step after the main PR has been merged. |
Okay, I’ll switch back to LISTENER mode. As time permits, I’ll continue analyzing the main message. |
Implementing another heat pump protocol
Help
Missing Features / Open Tasks:
Status Quo:
This branch contains a modified version of AquaMQTT which is meant to be installed in LISTENER mode. It is currently able to identify hmi, main and energy messages from the new protocol #45. These are provided to mqtt on the three topics:
aquamqtt/hmi/debug
aquamqtt/main/debug
aquamqtt/energy/debug
The new protocol findings are documented within PROTOCOL_NEXT.md
Tracing
Using the debug python script https://github.com/tspopp/AquaMQTT/blob/main/tools/debug.py you are able to record changing messages over time and identify which location holds what kind of attribute.
Create the python environment
Run the python script
How to help here?