Open mrrepel opened 1 year ago
Thanks @mrrepel for your feedback. Indeed RKH/EKH systems (which I think are called Altherma 2) are not as well supported as Altherma 3 systems. For now I think we would be able to modify the code such that it reports a number of sensor values (I hope at least some of the temperatures (49.000, 44.582, 33.906) are correct for your system even if the names used may be wrong). We will need to write a separate header file for the EKH systems. It would be helpful for me to receive your logs of raw data P1P2/R/# together with a description of system changes made during the log (on/off, target setings changed manually, temperature values changing as a response, so we can match these to the changes in the raw data logs).
There are a few EKH* users with the P1/P2 interface so this issue would be a good place to start sharing EKH/RKH experiences.
Now that my holidays have started I picked it up again for my Altherma 2 (EKHVH008BB6WN). I can already report the following:
Set point values are decoded correctly. However the labels are not correct. The following changes need to happen.
S1_DHW_Setpoint_Response
-> Target temperature leaving water. There is no room thermostat in my system, so room temperature is not the correct label I think.S0_Target_Temperature_Room
-> Target temperature DHW TankAll measured values seem to have the wrong encoding applied. The jump up and down while on the controller itself only the value after the . seem to fluctuate. I "hacked" the NTC of my boiler with 2 relays so that I can let it measure the correct value, a very low value or a high value. I use this to make it heat only on solar in the summer. This also means that I can create an mqtt dump while the values change before the .
I have not dived deeps enough into but at the very least it seems that the byte order is different (or not fixed point at all). Often the part behind the . is stable while the part before it fluctuates a lot. The results of my experiment are as follows. The files attached are the dumps that correspond to the values the daikin controller reported. I wrote down all the values I saw:
A. 44.1 44.2 44.4 B. 31.5 31.6 C. 56.9 57
Based on the changing values, my guess is that this sensor is labeled T1_Temperature_DHW_Tank
Once we can find the correct encoding, it should not be to difficult anymore to also correctly label all other values. They all report the same strange values.
Hi @bartv - thanks very much, very useful information. I will set up a separate header file for EKH over the next week based on your findings.
The user manual for the EKHBRD-ADV17 system indicates that it supports a main controller (room thermostat) and a slave controller (2nd room thermostat, used for controlling but not really as room thermostat). If someone would have a system with 2 such controllers and make raw data logs when changing settings on the 2nd auxiliary/slave controller, we could determine whether the protocol between main controller (master) and auxiliary controller (slave) would function in the same way as on other (Altherma 3 or VRV) systems, and we would actually be able to control EKH/RKH systems too!
Yeah, I have already started searching ebay and 2hands for something like that. No luck so far :-)
My C is a bit rusty and the code is not the most accessible to make changes to so I wrote a short python script to validate my suspicion that the bytes are swapped. In the A trace I was able to get the 3 values I read on the controller like this:
data = """05084C2CD41704184818F414A9
05084C2CD417181848180C1557
05084C2CD41730183018F4140E
05084C2CEC17181830180C1530
05084C2CEC1718184818F41456
05084C2CEC17301848180C152D
0508282C0418181830180C15EC
0508282C0418301848180C15F1
0508282CD417041860180C1594
0508282CD417181830180C1512
0508282CD41718184818F41474
0508282CEC17041830180C15ED
0508282CEC17181830180C1557
0508282CEC1718184818F41431
05084C2C0418301848180C1596
05084C2CBC17181830180C1521
05084C2CD417181830180C1575
05084C2CD41718183018F41431
05084C2CD417181848180C1557
05084C2CD41718184818F41413
05084C2CD417181860180C1549
05084C2CD41730183018F4140E
05084C2CEC17181830180C1530
05084C2CEC1718183018F41474
05084C2CEC17181848180C1512
05084C2CEC1718184818F41456
05084C2CEC17301830180C150F
05084C2CEC17301848180C152D
05084C2CEC1730184818F41469
05086C2CBC17181830180C1534
05086C2CD41704184818F414BC
05086C2CD41718183018F41424
05086C2CD417181848180C1542
05086C2CEC1704184818F414F9"""
for line in data.splitlines():
data = []
for i in range(int(len(line) / 2)):
data.append(int(line[2*i:2*i+2], 16))
vars = data[2:4]
print("{:2.1f}".format(vars[1] + vars[0] / 256))
So the value is like f8_8, except the function should be:
float FN_f8_8(uint8_t *b) { return (((int8_t) b[0]) + (b[-1] * 1.0 / 256)); }
The DHW setpoint response seems to be the "stooklijn" from the weather setpoint. This is the preset for leaving temp hot water for heating (when it is cold, the heatingwater will be warmer and vice versa, see graph). Setting 3 in the menu. I also use an external thermostat with the EKRP1AHTA interface card (dry relais), so there are no room temperature settings for me, S0_Target_Temperature_Room stays at 16 "C
Also the next sensors are correct: S0_Heating_OnOff S0_DHW_OnOff S0_Quiet_Mode S1_Defrost_Operation
Mismatches in names: T1_Temperature_Refrigerant_1 seems to be T1_Temperature_Return_Water T1_Temperature_Outside_1 seems to be T1_Temperature_DHW_Tank
Because i switch the heatpump on/off externally for heating i think these ones are correct to: S1_Circulation_Pump_OnOff S1_Compressor_OnOff
The warmtepomp on/off is a relais starting/stopping heating
Other values fluctuate, maybe the bitswapping as Bart stated.
I did an attempt to update the firmware to already figure out the correct labels. I am unable to generate a working firmware using the arduino ide. It compiles and can uploaded (both using serial and OTA), the boards responds to a ping but it does not connect to MQTT and the telnet interface does not come up. I used my arduino ide before, even for esp* boards. I guess there must be some setting that is wrong?
Hi @bartv, I think you have flash size set to default 1MB instead of 4MB. This value determines where the "EEPROM" (wifi/mqtt) data is stored. Even with 1MB selected, the WiFiManager AP "P1P2MQTT" should restart to allow entering your wifi/mqtt settings. If you change the configuration to 4MB, I think you will get the original settings back. Please let me know if that does not help - ultimate fall-back is programming with the USB programmer and "Erase Flash: All".
Also there are some changes needed to the BSP and libraries. The ESP_Telnet library owner implemented my suggestion for making the library working with ethernet differently than I did, so for the current ESP code you still need my modified version of the library, or #undefine ETHERNET, or change the code. I will update the code to allow the use of the official library now it is updated.
That did the trick. I patched the f8_8 function to swap the bytes and now I get all stable readings
Great, many thanks! I'll incorporate this change and the name corrections into the new header file for EKH/RKH systems, or if you prefer, feel free to do so yourself.
I created a draft PR with my findings and experiments: https://github.com/Arnold-n/P1P2Serial/pull/46
@mrrepel if you want I can also post a firmware image
Thanks - I would suggest to use #ifdef EKH constructs to keep the original functionality maintained for Altherma 3, or to create a separate header file for EKH.
That is why I created the PR. I am not sure on how much is shared between E and EKH. So first I am going to make the change in the E header and then decide on how to support both.
@bartv , that would be really nice if you post the image.
Some logs from my system are added. If there is any need for specific logs / actions, please tell. log1.txt
I can confirm that the outside temperature is correct.
@bartv , that would be really nice if you post the image.
Some logs from my system are added. If there is any need for specific logs / actions, please tell. log1.txt
@bartv , that would be really nice if you post the image. Some logs from my system are added. If there is any need for specific logs / actions, please tell. log1.txt
You might need to remove the integration from HA and let it discover again so that the renamed values are gone.
I was able to figure out some more fields. Others are still work in progress. I create another repo with my scripts and current documentation: https://github.com/bartv/p1p2decoder/blob/main/ekh.py
The summary: https://github.com/bartv/p1p2decoder/blob/main/ekh.md
Thanx Bart for sharing the firmware. Just finished flashing the ESP and after some trial and error i got the interface working again (fully my fault :-)).
The values and labels have changed, some readings work, others dont.
<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns="http://www.w3.org/TR/REC-html40">
Label | Arnold | Bart -- | -- | -- S0 DHW on/off | ok | ok S0DHW setpoint response | not sure | fault, stays at 16'C S0 heating on/off | ok | ok S0 Quit mode | ok | ok S1 circulation pump | ok | to be tested (seems ok) S1 compressor on/off | ok | to be tested (seems ok) S1 defrost operation | ok | ok S1 target temp leaving water | NA | ok T1 temperature DHW tank | fault (+120/-120'C) | fault (0,2/0,8'C) T1 Temperature_HP2Gas_Water | NA | fault (5/-80'C) T1 leaving water | fault (near 0'C) | ok (resolution 1 degree) T1 temp outside | label fault, must be T1_Temperature_DHW_Tank | fault, stays at 0'C T1 temp refrigirant 1 | label fault, must be T1_Temperature_Return_Water | fault, (+120/-120'C) T1 temp return water | fault (near 0'C) | label fault, must be T1_Temperature_Outside mqtt: valve 3 way | | equal to S0 DHW on/off
Hi,
First of all, thanks to Arnold for sending the P1P2ESP quickly, it arrived within 2 days and, looking at the construction method, I can only say that it is like an commercial product! After I received it I immediately got tinkering.
Unfortunately it seems that my heat pump is not supported. The values fluctuate on some sensors (not all) and the values are not correct.
Below is a screenshot of the HA interface.
I am not a programmer but a hobbyist. I would like to hear if and how I can help with providing logs etc. so that this heat pump can also be supported. The values I am particularly interested in are;
Kind regards, Barry