qix67 / comfortzone_heatpump

Arduino library to monitor and control Comfortzone EX50 heatpump
GNU General Public License v3.0
8 stars 5 forks source link

RS485 module tips #2

Open dessibelle opened 2 years ago

dessibelle commented 2 years ago

I've been looking at this library for quite some time, with the intention of hooking up my EX50 heat pump. Unfortunately I'm very new to RS485 communication and am having some trouble finding a suitable RS485 module to use with Arduino. I've been doing some searching and modules appear to have slightly different connections, i.e. some have A/B/GND/VCC inputs while others have only A/B. This should be easy enough by just picking one that has at least A/B/GND however.

There other thing I'm having trouble with is understanding the DE/RE pin mentioned in this example. From what I've gathered the the RS485 module's RX/TX pics are meant to be hooked up to an Arduino's Serial interface and the module's DE/RE pin to one of the Arduino's inputs. However, many of the modules I've come across have have RX/TX/GND/VCC but as far as I can tell no RE/DE pins, see for example this one.

From what I've understood reading this thread DE/RE means Driver Enable/Receiver Enable and can be used to control wether how/if the module can send and receive data. Is there any specific RS485 module that suitable for the connection described in the example, which have been used successfully with this library in the past?

kalaws commented 1 year ago

I too would be interested in some tips

qix67 commented 1 year ago

Sorry for the late reply, your mail was buried in a mail flood.

Module without DE/RE pin can only receive data (or only send but it seems to be very rare).

I am using this module.

DI, DE, RE, RO, VCC and GND are on the arduino side, A and B on heatpump side. There is no need to connect GND to heatpump unless the cable from RS485 module to heatpump is very long. I have no communication problem with a 3m cable.

kalaws commented 1 year ago

Great! Are you getting 5VDC from the heat pump (converting 24VDC to 5VDC before rs485 module), or are you getting it from some other source? Or is there 5VDC available somewhere in the heat pump?

dessibelle commented 1 year ago

Thanks for the response @qix67, appears to be what I need to get started. 🙏

kalaws commented 1 year ago

Also, any idea what current is coming through the 24 vdc pin? Thinking about what wire is adequate.

qix67 commented 1 year ago

@kalaws Yes, I am using a 27VDC to 5VDC step down module cascaded with a 5VDC to 3.3VDC step down module to power an esp8266

About wiring, check Wiring part in the README.txt

kalaws commented 1 year ago

Excellent. Luckily I have an esp8266 that can manage 5VDC. So from the rs485 module, where do the DI, DE, RE, RO go? I gather two of them go to TX/RX, but which ones? Appreciate you taking your time for these rookie questions!

edit: also, have you integrated all this into something like home assistant?

qix67 commented 1 year ago

I have wired my ESP8266 like this: TXD => DI RXD => RO GPIO12 => DE and RE

My ESP8266 is connected to a MQTT broker as well as my domoticz

kalaws commented 1 year ago

I have a MQTT broker, so I should be able to pull that off and integrate into HA. Looking forward to setting this up once everything arrives in the mail.

kalaws commented 1 year ago

@dessibelle , you wouldn't happen to be planning to integrate this with Home Assistant? :)

qix67 commented 1 year ago

Totally no.

Python really sucks when running an application as daemon. Nearly each time you update python without rebooting server or restarting daemon, the application starts to behave strangely. I have encountered this problem with transmission and websockify and it is the 2 only python daemons I have used.

dessibelle commented 1 year ago

Well I’m looking to get the data into Home Assistant too as it happens. I’m still in an early experimentation phase as you can probably guess. First I’d like to read data, and later on possibly adjust some parameters. Haven’t thought too much about the integration in the HA side yet, but I’d prefer to keep it as lightweight as possible. One thing I’m thinking about is ESPHome (but I have only scratched the surface yet). I’d be happy to work on something together if you’re up for that @kalaws.

kalaws commented 1 year ago

Well, I'm not great with code, but I'll certainly contribute anything I can! So far, I've set up Powersaver (powersaver.no) through Node-RED integration in HA. The plan is to use the adjustments coming out of Powersaver and push those to the ESP8266 device, so that ultimately electricity consumption is shifted from expensive hours onto cheap hours.

kalaws commented 1 year ago

@qix67, any idea of the rs485 module also has to be powered, or if it is enough with the esp8266?

qix67 commented 1 year ago

I power my esp8266 and my RS485 module (+ a HTU21D module) using heatpump 24VDC and a step down module (2 modules: 27V-DC>5VDC and 5VDC-> 3.3VDC). It works great and I have encountered no problem for years now.

GitBaer commented 1 year ago

OT: Would it be an idea that qix67 builds finished modules and sell them to interested users? Unfortunately, i think that it is more difficult than expected. This would be great!

qix67 commented 1 year ago

I suck at soldering :) Moreover hardware is one thing, software is another. I have no trouble on software side due to my job but on the hardware side I somewhat make it works.

I will check this evening, but 2 or 3 PCB made for my project may be available.

dessibelle commented 1 year ago

I call dibs on one of them then! :D

Joking aside, I think if you're trying something like this on heat pump in the approx €7000 range, then it probably makes sense that you understand enough of what you're doing and are competent enough in hardware and software that you can be fairly confident you are not breaking things. That said, if someone is willing to sell PCB's it would definitely be something I'd consider, but still it makes sense that you can sort of overlook the inner workings.

GitBaer commented 1 year ago

@qix67 this would be great! :) Thank you!

kalaws commented 1 year ago

@dessibelle Any progress on the home assistant side? My rs485 module has apparently just arrived, so I'll finish that up tonight.

dessibelle commented 1 year ago

@kalaws Nope, I have small kids at home so my time is limited and thus the progress is extremely slow, I've not even started on the hardware yet (although I have all components at hand). Once I've gotten it hooked up I'll start thinking about how to best get it into Home Assistant.

qix67 commented 1 year ago

Same problem for me, I have genshin impact @ home and time is very limited :)

kalaws commented 1 year ago

Yeah, kids at this end too :) AND add to that limited competence! hehe

qix67 commented 1 year ago

I have 8 PCB back front

PCB size is roughly 2.1 x 4.3cm (4.3cm is RS485 module length, 2.1cm is DC-DC 27V->5V converter length)

I can also provide gerber file (assuming kicad 6 can read kicad 4 files).

BOM is limited:

You can see additionnal components on silkscreen (red led, zener diode) but they are not used here.

On upper-left of front PCB, you can found a space with I2C pins if you want to add something. I added an HTU21D.

jenshorn commented 1 year ago

First of all thank you for this library, great job! The internet is a bit sparse regarding integrations to the EX50 so I'm crossing my fingers that I can get this to work. I've however been struggling a bit as well to get this going, tried a handful of RS485 modules with NodeMCU and Wemos D1 mini but no luck so far unfortunately. I guess there's something I don't get quite right. Right now I have landed on the same RS485 that was linked to previously in this thread together with a Wemos powered by a step down from the EX50 to 5V. When I connect the Wemos to EX50 I get an error message Controller connection failure on the display but that goes away as soon as I navigate away to some other screen on the display. After that the controller is polling but only getting default values (0) in stead of any actual numbers. I'm probably doing something wrong, somewhere.

qix67 commented 1 year ago

During my test, I encountered this problem.

To solve it, you just have to switch wire A and B on RS485 module.

Wiring improperly A and B damages nothing, it just jams RS485 bus communication.

jenshorn commented 1 year ago

@qix67 I believe I might have some other issue as the error message disappears after a few seconds and there is no major difference when switching the A & B wires :/ Either something I connected incorrectly or perhaps something with the breadboard.

Right now that issue is gone but I still only get default values (0) on for example heatpump.comfortzone_status.total_runtime. Perhaps there is something missing with the way I'm using the Wemos D1 mini. Is anyone else using that hardware successfully for this library?

jenshorn commented 1 year ago

So perhaps I'm (obviously) doing something wrong or there is a hardware issue involved that I need to figure out. Communication appears to be working as if I change RS485_DE_PIN to something else than where the DE/RE pin is connected I always get 0 (PFT_NONE) as a result, when setting it to the correct pin I get 4 (PFT_UNKNOWN). This is roughly how I do it now:

#define RS485SER Serial    // Serial connected to RS485 module
#define RS485_DE_PIN 16    // pin connected to DE/RE pin of RS485 module
comfortzone_heatpump heatpump;

void setup() {
    heatpump.begin(RS485SER, RS485_DE_PIN);
}

void loop() {
  long now = millis();
  if (now - lastMsg > 5000) {
    lastMsg = now;

    comfortzone_heatpump::PROCESSED_FRAME_TYPE frame = heatpump.process();
    Serial.print("PROCESSED_FRAME_TYPE: ");
    Serial.println(frame);
    if(frame != comfortzone_heatpump::PFT_NONE){
      Serial.print("TE24 - Hot water: ");
      Serial.print(heatpump.comfortzone_status.sensors_te24_hot_water_temp);
      Serial.println(" °C");
    }
  }
}

Produces this output:

PROCESSED_FRAME_TYPE: 4
TE24 - Hot water: 0 °C

Perhaps it's the Serial that can't be used both for RS485 and print at the same time? To minimize the impact of a shared Serial I've removed every use and instead publish to MQTT. But the output received on the client is still '0'.

if(frame != comfortzone_heatpump::PFT_NONE){
   client.publish(
       "comfortzone/sensor/sensors_te24_hot_water_temp",
        intToString(heatpump.comfortzone_status.sensors_te24_hot_water_temp));
}
const char* intToString(int value){
  static char msgBuffer[10];
  sprintf(msgBuffer, "%d", value);
  return msgBuffer;
}

Oh well, perhaps not related to the RS485 module so turning a bit off topic. Suggestions are welcome though 😄

qix67 commented 1 year ago

It may seem strange but I think PFT_NONE is better than PFT_UNKNOWN :)

Perhaps your heatpump has a different address. During your setup, after begin, try to add something like:

byte hp_ad[4];

if(heatpump.guess_heatpump_addr(hp_ad))
{
   char stradr[1024];

   snprintf(stradr,1024, "heatpump address: %02X %02X %02X %02X",
                  (unsigned int)(hp_ad[0]), (unsigned int)(hp_ad[1]), (unsigned int)(hp_ad[2]), (unsigned int)(hp_ad[3])
            );
   Serial.println(stradr);
}
else
{
   Serial.println("Fail to guess heatpump address");
}

Default heatpump address is 0x65 0x6F 0xDE 0x02.

Remember control panel must be connected during your test because it is the control panel which periodically send queries to heatpump, not the library.

jenshorn commented 1 year ago

I added the above in setup, after heatpump.begin, and extended the timeout to 30s. Fail to guess heatpump address

I'll just add the machines versioned components, just in case. Component Version
UI software version 2.6.0
UI hardware version E
Controller version 1.80
HP Box version 3
qix67 commented 1 year ago

I have 2.0.0, C, 1.60 and 3. Assuming HP box version is the same, it should use the same protocol

qix67 commented 1 year ago

I just remember something.

When I start my program, during 30-45s, most of the values are 0 until control panel sends a query to obtain all HP data. Did you try to wait a little.

jenshorn commented 1 year ago

It's been running for some time when I tried this. I also jiggled around on the primary display just in case it might generate any additional traffic :) Should I connect while EX50 is off and let it boot up together? I have tried that previously but could not get any data then either. Would it matter when running guess_heatpump_addr?

How about set_grab_buffer, would that bring anything of value even if I can't grab the address? Any examples how to run it? My C is a bit rusty :/

qix67 commented 1 year ago

No need to power off EX50, it works on the fly.

Yes, you can use set_grab_buffer, it will just dump all traffic it can decode. It is faily easy to use.

Define buffer globally with this code:

byte grab_buffer[256];
uint16_t grabbed_frame_size;

#define OBUFF_SIZE 1024;
char obuff[OBUFF_SIZE];

In setup, add:

heatpump.set_grab_buffer(grab_buffer, sizeof(grab_buffer), &grabbed_frame_size);

dump data using:

if(frame != comfortzone_heatpump::PFT_NONE)
{
      char *pos;
      int nb;
      int i;
      char *type;

      switch(frame)
      {
         case comfortzone_heatpump::PFT_CORRUPTED:
                           type = "corrupted";
                           break;
         case comfortzone_heatpump::PFT_QUERY:
                           type = "query";
                           break;
         case comfortzone_heatpump::PFT_REPLY:
                           type = "reply";
                           break;
         case comfortzone_heatpump::PFT_UNKNOWN:
                           type = "unknown";
                           break;
      }

      snprintf(obuff, OBUFF_SIZE, "%s: %02X %02X %02X %02X - %02X %02X - %02X %02X %02X %02X - %02X - %02X - %02X %02X %02X %02X %02X %02X %02X %02X %02X",
                  type,
                  (unsigned int)(grab_buffer[0]), (unsigned int)(grab_buffer[1]), (unsigned int)(grab_buffer[2]), (unsigned int)(grab_buffer[3]), // source
                  (unsigned int)(grab_buffer[4]), (unsigned int)(grab_buffer[5]),   // unknown
                  (unsigned int)(grab_buffer[6]), (unsigned int)(grab_buffer[7]), (unsigned int)(grab_buffer[8]), (unsigned int)(grab_buffer[9]), // destination
                  (unsigned int)(grab_buffer[10]), // packet_size
                  (unsigned int)(grab_buffer[11]), // cmd
                  (unsigned int)(grab_buffer[12]), (unsigned int)(grab_buffer[13]), (unsigned int)(grab_buffer[14]), (unsigned int)(grab_buffer[15]), (unsigned int)(grab_buffer[16]), (unsigned int)(grab_buffer[17]), (unsigned int)(grab_buffer[18]), (unsigned int)(grab_buffer[19]), (unsigned int)(grab_buffer[20])  // reg_num
            );
      Serial.println(obuff);

      pos = obuff;
      i = 21;

      strcpy(pos, "    --- ");
      pos += 8;
      nb = 0;

      while( i < grabbed_frame_size)
      {
         if(nb >= 32)
         {
            Serial.println(obuff);
            pos = obuff;
            strcpy(pos, "    --- ");
            pos += 8;
            nb = 0;
         }

         sprintf(pos, "%02X ", (unsigned int)(grab_buffer[i]));
         pos += 3;

         nb++;
         i++;
      }

      Serial.println(obuff);
      Serial.println("===============================================================");
}

This code is based on the one I use when I enable debug mode in my program.

It will dump all packet headers and packet content in hexadecimal.

Output should be something like that:

query: 65 6F DE 02 - D3 5E - 41 44 44 52 - 17 - 52 - 01 02 03 04 0B 07 00 DE 04
    --- 53 B5 
===============================================================
reply: 41 44 44 52 - 07 8A - 65 6F DE 02 - 69 - 72 - 01 02 03 04 0B 07 00 DE 04
    --- 00 00 2D 00 BB 03 05 1E 2C 01 0A F4 01 3C 00 F4 01 F4 01 78 
    --- 00 A0 00 D0 07 58 02 1A FF 05 DA 02 05 50 00 05 B0 04 78 E8 
    --- 03 E8 03 14 01 84 03 84 03 08 07 5A 00 C0 03 00 00 00 00 00 
    --- 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 D2 
    --- 04 55 55 40 
===============================================================
query: 65 6F DE 02 - D3 5E - 41 44 44 52 - 17 - 52 - 01 02 03 04 0B 07 01 00 00
    --- B2 5B 
===============================================================
reply: 41 44 44 52 - 07 8A - 65 6F DE 02 - C8 - 72 - 01 02 03 04 0B 07 01 00 00
    --- 00 00 00 00 10 30 1A 1C 0C 12 05 00 10 30 1A FF FF 00 00 40 
    --- 00 40 00 00 00 88 2A 00 00 10 00 00 00 00 00 00 00 00 00 00 
    --- 00 00 00 00 00 00 00 41 19 FC 19 FC 15 00 DB 00 DA 00 C5 00 
    --- 8F 01 F5 00 65 00 74 00 22 FC 22 FC 03 01 22 FC 22 FC 22 FC 
    --- 22 FC 22 FC 22 FC 22 FC 22 FC 22 FC 22 FC 22 FC 22 FC 22 FC 
    --- 5D 01 41 00 0C 00 44 01 C0 00 00 00 E8 03 E8 03 00 00 41 00 
    --- 7E 00 A2 00 C0 00 00 00 00 00 00 00 15 00 DE 00 DA 00 C5 00 
    --- 91 01 E3 00 53 00 46 01 5D 00 22 FC 22 FC 03 01 22 FC 22 FC 
    --- 22 FC 22 FC 22 FC 22 FC 22 FC 22 FC 22 FC 22 FC 22 FC 5A 
jenshorn commented 1 year ago
unknown: 65 6F DE 02 - D3 5E - 41 44 44 52 - 17 - 52 - 01 02 03 04 0B 09 04 4E 3F
    --- 16 46 
===============================================================
unknown: 65 6F DE 02 - D3 5E - 41 44 44 52 - 17 - 52 - 01 02 03 04 0B 09 00 00 00
    --- 16 B8 
===============================================================
unknown: 65 6F DE 02 - D3 5E - 41 44 44 52 - 17 - 52 - 01 02 03 04 0B 09 03 6F 0E
    --- 42 AC 
===============================================================
unknown: 41 44 44 52 - 07 8A - 65 6F DE 02 - 58 - 72 - 01 02 03 04 0B 09 03 6F 0E
    --- 1F 00 00 00 00 00 00 00 00 15 0A 16 0C 0E 09 00 00 00 00 00 00 00 00 15 0A 16 0C 2F 08 00 00 00 
    --- 00 00 00 00 00 1C 0A 16 0C 08 20 00 00 00 00 00 00 00 00 1C 0A 16 0C 09 12 01 03 00 00 00 00 00 
    --- 00 00 15 
===============================================================
unknown: 65 6F DE 02 - D3 5E - 41 44 44 52 - 17 - 52 - 01 02 03 04 0B 09 01 04 00
    --- 62 30 
===============================================================
unknown: 65 6F DE 02 - D3 5E - 41 44 44 52 - 17 - 52 - 01 02 03 04 0B 09 03 6F 0E
    --- 42 AC 
===============================================================
unknown: 65 6F DE 02 - D3 5E - 41 44 44 52 - 17 - 52 - 01 02 03 04 0B 09 03 6F 0E
    --- 42 AC 
===============================================================
unknown: 41 44 44 52 - 07 8A - 65 6F DE 02 - C8 - 72 - 01 02 03 04 0B 09 03 BD 0D
    --- 00 00 00 00 00 0E 0C 16 11 1D 1E 00 00 00 00 00 00 00 00 05 06 16 0B 03 2A 02 12 00 00 00 00 00 
    --- 00 05 06 16 0B 03 2D 03 12 00 00 00 00 00 00 11 07 16 17 34 04 00 00 00 00 00 00 00 00 02 09 16 
    --- 0C 00 00 01 12 00 00 00 00 00 00 1E 09 16 0A 2F 06 00 00 00 00 00 00 00 00 1E 09 16 0A 2F 07 01 
    --- 12 00 00 00 00 00 00 1E 09 16 0A 2F 1D 02 12 00 00 00 00 00 00 1E 09 16 0A 2F 21 03 12 00 00 00 
    --- 00 00 00 02 0A 16 16 09 2C 00 00 00 00 00 00 00 00 02 0A 16 16 0E 35 00 00 00 00 00 00 00 00 02 
    --- 0A 16 16 0F 2E 00 00 00 00 00 00 00 00 02 0A 16 16 2C 94 
===============================================================
unknown: 65 6F DE 02 - D3 5E - 41 44 44 52 - 17 - 52 - 01 02 03 04 0B 09 03 6F 0E
    --- 42 AC 
===============================================================
unknown: 65 6F DE 02 - D3 5E - 41 44 44 52 - 17 - 52 - 01 02 03 04 0B 09 03 6F 0E
    --- 42 AC 
===============================================================
unknown: 65 6F DE 02 - D3 5E - 41 44 44 52 - 17 - 52 - 01 02 03 04 0B 09 03 6F 0E
    --- 42 AC 
===============================================================
unknown: 65 6F DE 02 - D3 5E - 41 44 44 52 - 17 - 52 - 01 02 03 04 0B 09 00 2C 03
    --- B2 0C 
===============================================================
unknown: 65 6F DE 02 - D3 5E - 41 44 44 52 - 17 - 52 - 01 02 03 04 0B 09 03 21 0F
    --- 57 0F 
===============================================================
qix67 commented 1 year ago

As expected, your heatpump address is the same as mine (65 6F DE 02). Control panel also has the same address (41 44 44 52).

I wonder why frames are detected as unknown, they look like mine. I wil check my old dump to find frame having the same header.

qix67 commented 1 year ago

It is a bit weird. In the header (1 line of packet), your commands start with "01 02 03 04 0B" like mine but the 4 last bytes are never the same as mine. Yours start with "09", mine with "07".

In comfortzone_decoder.cpp, you can find a list of all codes I found.

In your dump, the 6 lines "unknown" block is a reply, its size matchs all status block I know. The 3 lines "unknown" block is also a reply but its size matchs none of my status block.

Another surprising thing is your control panel sends queries but most of them seems to be ignored by heatpump. Queries starts with "65 6F DE 02", replies starts with "41 44 44 52". In my case, I always have a reply from heatpump to each query made by control panel.

Can you try the following thing:

  1. Start a new dump
  2. While dumping, change the month on your heatpump from december to november and validate your choice
  3. Restore month to december
  4. Stop your dump

Attach your dump to a message, I will compare it with mine.

jenshorn commented 1 year ago

It appears as although our headers are the same in many ways the register part appears to differ on one marker Your: 01 02 03 04 0B 07 01 00 00 Mine: 01 02 03 04 0B 09 04 4E 3F

qix67 commented 1 year ago

These little differents explain why packets can be dumped (same frame structure) but why nothing is understood by the library. Even dialog between HP and control panel works in the same way. A query and a reply have the same last 9 bytes in the header.

Perhaps I have not properly understood the way these last 9 bytes are processed, I have only 1 heatpump to compare :)

jenshorn commented 1 year ago

It's a bit strange, I followed you instructions above but can not see a response or every request I thought I would expect. Not anything related to the month modification as I would expect that to end with 01 08 00?

unknown: 65 6F DE 02 - D3 5E - 41 44 44 52 - 17 - 52 - 01 02 03 04 0B 09 03 14 0F
    --- 10 21 
===============================================================
unknown: 65 6F DE 02 - D3 5E - 41 44 44 52 - 17 - 52 - 01 02 03 04 0B 09 03 6F 0E
    --- 42 AC 
===============================================================
unknown: 65 6F DE 02 - D3 5E - 41 44 44 52 - 17 - 52 - 01 02 03 04 0B 09 03 6F 0E
    --- 42 AC 
===============================================================
unknown: 65 6F DE 02 - D3 5E - 41 44 44 52 - 17 - 52 - 01 02 03 04 0B 09 03 6F 0E
    --- 42 AC 
===============================================================
unknown: 65 6F DE 02 - D3 5E - 41 44 44 52 - 17 - 52 - 01 02 03 04 0B 09 03 6F 0E
    --- 42 AC 
===============================================================
unknown: 65 6F DE 02 - D3 5E - 41 44 44 52 - 17 - 52 - 01 02 03 04 0B 09 03 6F 0E
    --- 42 AC 
===============================================================
unknown: 65 6F DE 02 - D3 5E - 41 44 44 52 - 17 - 52 - 01 02 03 04 0B 09 00 DE 03
    --- 77 3B 
===============================================================
unknown: 65 6F DE 02 - D3 5E - 41 44 44 52 - 17 - 52 - 01 02 03 04 0B 09 03 6F 0E
    --- 42 AC 
===============================================================
jenshorn commented 1 year ago

As another attempt, just for fun, I changed the fifth marker from 0x07 to 0x09. Then I toggled extra hot water and changed the month again like previously. A ew queries and a response was recognized. Perhaps they are talking a different protocol?

unknown: 41 44 44 52 - 07 8A - 65 6F DE 02 - 26 - 72 - 01 02 03 04 0B 09 03 14 0F
    --- 09 00 00 08 09 17 32 07 00 00 00 08 00 00 00 07 2D 
===============================================================
unknown: 65 6F DE 02 - D3 5E - 41 44 44 52 - 17 - 52 - 01 02 03 04 0B 09 03 6F 0E
    --- 42 AC 
===============================================================
unknown: 65 6F DE 02 - D3 5E - 41 44 44 52 - 17 - 52 - 01 02 03 04 0B 09 03 6F 0E
    --- 42 AC 
===============================================================
query: 65 6F DE 02 - D3 5E - 41 44 44 52 - 17 - 52 - 01 02 03 04 0B 09 01 04 00
    --- 62 30 
===============================================================
unknown: 65 6F DE 02 - D3 5E - 41 44 44 52 - 17 - 52 - 01 02 03 04 0B 09 03 6F 0E
    --- 42 AC 
===============================================================
unknown: 65 6F DE 02 - D3 5E - 41 44 44 52 - 17 - 52 - 01 02 03 04 0B 09 03 6F 0E
    --- 42 AC 
===============================================================
unknown: 65 6F DE 02 - D3 5E - 41 44 44 52 - 17 - 52 - 01 02 03 04 0B 09 03 6F 0E
    --- 42 AC 
===============================================================
unknown: 41 44 44 52 - 07 8A - 65 6F DE 02 - 58 - 72 - 01 02 03 04 0B 09 03 6F 0E
    --- 1F 00 00 00 00 00 00 00 00 15 0A 16 0C 0E 09 00 00 00 00 00 00 00 00 15 0A 16 0C 2F 08 00 00 00 
    --- 00 00 00 00 00 1C 0A 16 0C 08 20 00 00 00 00 00 00 00 00 1C 0A 16 0C 09 12 01 03 00 00 00 00 00 
    --- 00 00 15 
===============================================================
unknown: 41 44 44 52 - 07 8A - 65 6F DE 02 - BF - 72 - 01 02 03 04 0B 09 01 24 04
    --- 00 00 00 00 10 0E 00 01 00 00 0A 00 00 00 14 14 03 00 01 00 01 00 01 00 B4 00 14 00 0A 00 0A 00 
    --- 0A 00 0A E0 2E 10 0E 2C 01 05 78 78 14 08 07 08 07 18 15 05 B0 04 8C 0A 1E 00 10 0E 10 0E 3C 00 
    --- 3C 00 3C 00 3C 00 8C 0A 27 2C 01 80 16 C1 A8 0A C7 FF FF FF 00 C0 A8 0A 01 63 01 83 00 00 2C 01 
    --- 18 01 C8 00 6C 02 2C 01 6A FF 78 00 2C 01 C8 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    --- 00 00 00 00 00 00 00 00 00 00 00 00 26 02 00 02 06 00 05 00 00 00 00 00 00 00 00 00 00 00 00 00 
    --- 00 00 00 00 00 00 00 00 00 0B 
===============================================================
query: 65 6F DE 02 - D3 5E - 41 44 44 52 - 17 - 52 - 01 02 03 04 0B 09 04 4E 3F
    --- 16 46 
===============================================================
unknown: 65 6F DE 02 - D3 5E - 41 44 44 52 - 17 - 52 - 01 02 03 04 0B 09 03 6F 0E
    --- 42 AC 
===============================================================
unknown: 65 6F DE 02 - D3 5E - 41 44 44 52 - 17 - 52 - 01 02 03 04 0B 09 00 BF 04
    --- 8B 8C 
===============================================================
unknown: 65 6F DE 02 - D3 5E - 41 44 44 52 - 17 - 52 - 01 02 03 04 0B 09 03 6F 0E
    --- 42 AC 
===============================================================
query: 65 6F DE 02 - D3 5E - 41 44 44 52 - 17 - 52 - 01 02 03 04 0B 09 01 04 00
    --- 62 30 
===============================================================
unknown: 65 6F DE 02 - D3 5E - 41 44 44 52 - 17 - 52 - 01 02 03 04 0B 09 03 6F 0E
    --- 42 AC 
===============================================================
unknown: 65 6F DE 02 - D3 5E - 41 44 44 52 - 17 - 52 - 01 02 03 04 0B 09 03 6F 0E
    --- 42 AC 
===============================================================
unknown: 65 6F DE 02 - D3 5E - 41 44 44 52 - 17 - 52 - 01 02 03 04 0B 09 03 BD 0D
    --- B2 DB 
===============================================================
unknown: 65 6F DE 02 - D3 5E - 41 44 44 52 - 17 - 52 - 01 02 03 04 0B 09 03 6F 0E
    --- 42 AC 
===============================================================
reply: 41 44 44 52 - 07 8A - 65 6F DE 02 - 78 - 72 - 01 02 03 04 0B 09 01 04 00
    --- 0C 36 1E 10 0B 16 03 00 0C 36 1E 00 00 40 00 C4 00 00 00 18 6A 00 01 10 00 00 00 00 00 00 00 00 
    --- 00 00 00 00 00 00 00 00 00 00 00 41 19 FC 19 FC 97 FF 6B 01 4C 01 D3 00 60 02 68 01 72 FF 69 FF 
    --- 22 FC 22 FC 04 01 22 FC 22 FC 22 FC 22 FC 22 FC 22 FC 22 FC 22 FC 22 FC 22 FC 22 FC 22 FC 22 FC 
    --- 21 02 CD 
===============================================================
unknown: 65 6F DE 02 - D3 5E - 41 44 44 52 - 17 - 52 - 01 02 03 04 0B 09 03 6F 0E
    --- 42 AC 
===============================================================
unknown: 65 6F DE 02 - D3 5E - 41 44 44 52 - 17 - 52 - 01 02 03 04 0B 09 01 63 01
    --- B0 C0 
===============================================================
query: 65 6F DE 02 - D3 5E - 41 44 44 52 - 17 - 52 - 01 02 03 04 0B 09 04 4E 3F
    --- 16 46 
===============================================================
unknown: 41 44 44 52 - 07 8A - 65 6F DE 02 - 2E - 72 - 01 02 03 04 0B 09 05 28 00
    --- 00 00 00 00 06 73 38 00 E7 44 05 00 32 E6 0E 00 89 1C 0B 00 29 C2 1C 00 62 
===============================================================
unknown: 41 44 44 52 - 07 8A - 65 6F DE 02 - 58 - 72 - 01 02 03 04 0B 09 03 6F 0E
    --- 1F 00 00 00 00 00 00 00 00 15 0A 16 0C 0E 09 00 00 00 00 00 00 00 00 15 0A 16 0C 2F 08 00 00 00 
    --- 00 00 00 00 00 1C 0A 16 0C 08 20 00 00 00 00 00 00 00 00 1C 0A 16 0C 09 12 01 03 00 00 00 00 00 
    --- 00 00 15 
===============================================================
unknown: 65 6F DE 02 - D3 5E - 41 44 44 52 - 17 - 52 - 01 02 03 04 0B 09 03 6F 0E
    --- 42 AC 
===============================================================
query: 65 6F DE 02 - D3 5E - 41 44 44 52 - 17 - 52 - 01 02 03 04 0B 09 01 04 00
    --- 62 30 
===============================================================
jenshorn commented 1 year ago

I have 2.0.0, C, 1.60 and 3. Assuming HP box version is the same, it should use the same protocol

Our HP Box versions are the same so it would be interesting to know if it's the Controller version that is managing the protocol and if it's correlated to the UI hardware version. If anyone else implemented this library it would be very interesting to know their versions as well.

qix67 commented 1 year ago

Yes. It seems like controller version and UI version are related. I think putting my control panel on your heatpump won't work.

Can you retry a dump but instead of changing month, try to change room temperature or hot water temperature.

qix67 commented 1 year ago

From what is can read, this packet really looks like R_REPLY_STATUS_02 and may be decoded like this

reply: 41 44 44 52 - 07 8A - 65 6F DE 02 - 78 - 72 - 01 02 03 04 0B 09 01 04 00
    --- 0C 36 1E 10 0B 16 03 00 0C 36 1E 00 00 40 00 C4 00 00 00 18 6A 00 01 10 00 00 00 00 00 00 00 00 
    --- 00 00 00 00 00 00 00 00 00 00 00 41 19 FC 19 FC 97 FF 6B 01 4C 01 D3 00 60 02 68 01 72 FF 69 FF 
    --- 22 FC 22 FC 04 01 22 FC 22 FC 22 FC 22 FC 22 FC 22 FC 22 FC 22 FC 22 FC 22 FC 22 FC 22 FC 22 FC 
    --- 21 02 CD 

0C 36 1E : 14h 54' 30" 10 0B 16 : 16 december 2022 (december is the 12th month but if january is 0, december becomes 11). 03 : day of week ??? Are you still thursday ? probably not possible especially given the hour in the packet and my localtime 00 : ??? 0C 36 1E : 14h 54' 30"

00 00 40 00 C4 00 00 00 18 6A 00 01 10 : looks like general_status in R_REPLY_STATUS_02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 41 19 FC 19 FC

The following are probably temperatures

97 FF : -10.5 probably TE0 (external temperature) 6B 01 : 36.3 TE1 flow water 4C 01 : 33.2 TE2 return water D3 00 : 21.1 TE3 indoor temp 60 02 : 60.8 TE4 hot gas temp ? this seems high 68 01 : 36 TE5 exchanger out 72 FF : -14.2 TE6 evaporator in 69 FF : -15.1 TE7 exhaust air 22 FC : -99 22 FC : -99 04 01 : 26 TE10 . Nothing here for me 22 FC : -99 22 FC : -99 22 FC : -99 22 FC : -99 22 FC : -99 22 FC : -99 22 FC : -99 22 FC : -99 22 FC : -99 22 FC : -99 22 FC : -99 22 FC : -99 22 FC : -99 21 02 : 54.5 TE24 hot water temp CD : frame CRC

One strange things is status_r02 frame contains 62 temperatures but you have only 24 and more over the only 24 having meanings.

jenshorn commented 1 year ago

This is the dump while changing HW temperature:

unknown: 65 6F DE 02 - D3 5E - 41 44 44 52 - 17 - 52 - 01 02 03 04 0B 09 03 6F 0E
    --- 42 AC 
===============================================================
unknown: 65 6F DE 02 - D3 5E - 41 44 44 52 - 17 - 52 - 01 02 03 04 0B 09 03 6F 0E
    --- 42 AC 
===============================================================
unknown: 41 44 44 52 - 07 8A - 65 6F DE 02 - 58 - 72 - 01 02 03 04 0B 09 03 6F 0E
    --- 1F 00 00 00 00 00 00 00 00 15 0A 16 0C 0E 09 00 00 00 00 00 00 00 00 15 0A 16 0C 2F 08 00 00 00 
    --- 00 00 00 00 00 1C 0A 16 0C 08 20 00 00 00 00 00 00 00 00 1C 0A 16 0C 09 12 01 03 00 00 00 00 00 
    --- 00 00 15 
===============================================================
unknown: 65 6F DE 02 - D3 5E - 41 44 44 52 - 17 - 52 - 01 02 03 04 0B 09 03 6F 0E
    --- 42 AC 
===============================================================
unknown: 65 6F DE 02 - D3 5E - 41 44 44 52 - 17 - 52 - 01 02 03 04 0B 09 03 6F 0E
    --- 42 AC 
===============================================================
unknown: 65 6F DE 02 - D3 5E - 41 44 44 52 - 17 - 52 - 01 02 03 04 0B 09 00 DE 03
    --- 77 3B 
===============================================================
unknown: 41 44 44 52 - 07 8A - 65 6F DE 02 - 58 - 72 - 01 02 03 04 0B 09 03 6F 0E
    --- 1F 00 00 00 00 00 00 00 00 15 0A 16 0C 0E 09 00 00 00 00 00 00 00 00 15 0A 16 0C 2F 08 00 00 00 
    --- 00 00 00 00 00 1C 0A 16 0C 08 20 00 00 00 00 00 00 00 00 1C 0A 16 0C 09 12 01 03 00 00 00 00 00 
    --- 00 00 15 
===============================================================
qix67 commented 1 year ago

This became really weird. I think my library may discard silently data it does not understand.

I will write a small program to dump all data received on serial port. Something must be wrong, there is too many missing replies. It is a simple program, I will try to do this tomorrow morning.

qix67 commented 1 year ago

Here is my dump program. You should be able to use it directly as I put your settings inside. test.ino.txt

You have to let it runs at least for 30 seconds. During that time, try to increase 1° room temperature, wait a little (2-3 seconds), increase 1° again, wait again a little and finally restore your original room temperature. Then send me your dump file.

Dump file will probably be fairly big, gzip it before attaching it to a message.

This dump will contain absolutely everything seen on RS485 bus. With this I should be able to find command sent by control panel to HP to change temperature.

jenshorn commented 1 year ago

I ran the dump and it appears to work! However I used Arduino IDE 2.0 and there is some issue copying the output from that IDE. It doesn't allow selecting anything not visible on the output window. I'll see if I can set up VS Code and use that for Arduino instead. Also, I cannot find the Room temperature setting, would HW Setting suffice?

qix67 commented 1 year ago

You can use any setting you want.

jenshorn commented 1 year ago

Let me know if this works for you. Not sure how long after the commands are sent that I need to wait for reply. Hopefully it is enough, just let me know otherwise. rs485.dump.zip