Hack my Heat Pump and publish data onto emoncms

Have you confirmed that mainboard is isolated from the mains? It’s not uncommon in sealed units like that to have the entire brains sitting at grid voltage, or at least tied to Neutral. The fact that they’ve stamped that opto-isolator board with “CAUTION: HIGH VOLTAGE” makes me wonder if its more required than you think.

Hello @dBc, well of course it’s not isolated from the mains :slight_smile: If you check the pinout of S403 short way above the part you quoted, you’ll notice the funny little pin 10: ~327VDC, which is connected to S601 on the KRP board, on the top of the image in my post from August 2018 (Hack my Heat Pump and publish data onto emoncms - #29 by relghuar). I have checked the back side of that board, and it seems like this high voltage is actually isolated from the part of board handling low-voltage interface connectors S21 and S16 (JEM-A):


(see part in the middle where the “SPACER” silk screen is printed, the only connection between top and bottom seem to be one capacitor and the transformer on the top side…)
So, there is no direct AC mains connection, but there definitely is a high DC voltage present (most likely still AC mains, just rectified and smoothed out…?). I did not investigate what is that HVDC used for on the board, although the quite big coil suggests some conversions. Again just a guess - the 5V and 12V power on the S21 is actually generated on KRP itself rather than taken from S403.
My guess is the purpose of KRP067A41E is more to protect the main board of Daikin unit, as the pins on S403 are connected straight to the main MCU. Any static discharge, short or wrongly connected wire could easily kill your whole ac unit…

Connecting your Arduino to a header that has 327V at one of its pins is very dangerous - and the risk is not limited to staying away from the 327V pin. That whole board could be sitting at mains voltages. Even if you’re suitably qualified and careful, others reading this may not be.

I think that entire motherboard and 3/4’s of the isolator board are potentially at lethal voltages. The only safe place to connect things are those two headers in the bottom left corner of the isolator board (S16 and S21).

Hi everyone,
some news regarding Daikin WIFI interface - well more like the S21 port… basically continuing my post in Hack my Heat Pump and publish data onto emoncms - #99 by relghuar (apparently I can’t post more than 3 replies to the same topic…). If this is a wrong category for such discussions, please correct me.
I connected new BRP069B41 wifi adapter to my FTXB-C (via KRP067A41E splitter), and connected uart sniffers to both RX and TX lines. I got advice from @hui5368 to use 2400,8E2 settings… so I sniffed the communication using that.
It seems the communication on S21 really is a serial port, I can see a request/response type of messages. Wifi adapter is sending requests all the time and Daikin is responding. Packets are binary, from preliminary analysis this is what it looks like:
Wifi: 02::::03
Daikin: 06 (ack?)
Daikin: 02:::[]::03
Wifi: 06 (ack?)
is always <request-type+1> (until now all the request-types are even and response-types odd, so it may be the lowest bit indicates packet direction?)
is always the same in request and response.
have fixed length for each request/data type, but can vary for different types and there is no indication of length in the packet, which means the length is probably fixed for each type.
are lowest 8bits of a simple sum of all the bytes except leading 02 and trailing 03.
I did not try any advanced requests to Wifi yet, just get_model_info, get_control_info and get_sensor_info - none of them triggered any different behaviour on the S21 directly, so I suppose data for those requests is gathered in wifi module in the background, and responses simply contain latest values. My Daikin unit was turned off the whole time.
Wifi module repeats following request packets continually:
02:46:32:78:03 (this is the one sent twice per second without Daikin connection, so it must be some basic connection detect, or model info request)
02:46:31:77:03
02:46:33:79:03
02:46:34:7a:03
02:46:35:7b:03
02:46:38:7e:03
Daikin responses for them are also the same all the time so far:
02:47:31:30:30:4e:41:67:03
02:47:32:34:3a:00:00:e7:03
02:47:33:30:fe:fe:30:d6:03
02:47:34:30:00:80:00:2b:03
02:47:35:30:30:30:80:8c:03
02:47:38:30:00:00:00:af:03
I have no idea what these values mean so far…
More interesting are request-types 52, sent about every 12 seconds:
02:52:48:9a:03
02:52:49:9b:03
02:52:4c:9e:03
02:52:4e:a0:03
02:52:58:aa:03
02:52:61:b3:03
02:52:64:b6:03
Responses I have seen so far for them:
02:53:48:30:36:32:2b:5e:03
02:53:48:30:37:32:2b:5f:03
02:53:48:35:36:32:2b:63:03
02:53:49:30:37:32:2b:60:03
02:53:49:35:36:32:2b:64:03
02:53:49:35:37:32:2b:65:03
02:53:4c:30:30:30:2f:03
02:53:4e:36:33:31:2b:66:03
02:53:58:30:35:32:2b:6d:03
02:53:61:30:36:31:2b:76:03
02:53:64:30:30:30:47:03
The changes in 53:48 correspond to observed change in internal temperature (htemp value in get_sensor_info HTTP response), value went from 27.0 to 26.5 and then 26.0, so the data bytes here are probably invert-order ascii-encoded value with fixed decimal point (30:37:32 → 32:37:30 → 270). Values in 53:49 seem to be tracking them - they are usually same or .5dC higher. Perhaps some kind of internal device temperature? 53:4c, 53:4e and 53:64 are unknown so far. 53:58 might be the set point, which I have at 25.0 now. 53:61 might be outside temperature (my own outside thermometers reported 16.3-16.5 through all the monitored period, so 160 may mean 16.0?)
Next steps:

  1. try turning the unit on, eventually changing some settings and see how it impacts the packets
  2. connect uart directly to daikin with these settings (2400,8E2) and emulate the wifi module requests - see if daikin responds. Eventually try different settings at 2400baud if the unit won’t react.

Just to be clear - I would NOT recommend to even open the aircon unit unless you know EXACTLY what you are doing, what precautions to take and so on… There are lethal voltages all over the place!
Adapter boards like KRPxxx with optoisolators are supposed to be installed inside the AC unit main case, with full access to mainboard, and should be handled by professionals!
My analysis was just meant to find electrical charateristics of S21 port (JEM-A was just a bonus I found).
S21 itself can be handled by amateurs as soon as you have the cable connection pulled out of the main box - for Wifi module for example.
Now that we have the safety part covered :slight_smile: some more news… I have rewired my uart sniffers so they break direct connection between wifi and adapter board; now the data have to be forwarded manually by my firmware. Data from Daikin to Wifi module work fine, however I still can’t send anything to the AC unit :frowning: I have to check it with oscilloscope, there might be some electrical issues (voltage or current from my usb/uart board may not fit the optocoupler specifications), or the Daikin unit is a lot more picky about uart timing.
Connection to wifi module works both ways with 2400baud 8bit and pretty much any parity/stop bits settings; same as the reception from Daikin. Transmit to Daikin however does not work whatever I try… I’ll have to check the difference between wifi module and my uart adapter output signalling.

1 Like

OK, next short update - I have now successfully connected to daikin rx/tx pins on S21 / S403 ports. Connection actually works fine with 2400,8E2 setup, the issue was with my usb/uart adapters. I used CP2102 universal ones compatible with both 5V and 3.3V TTL, which means they have 3.3V pull-ups on TX. That is fine for the wifi adapter, but apparently not for the KRP980 isolator board. (Actual issue is the PNP transistor connecting the S21-RX pin to optoisolator - it has emitter on 5V, which means anything lower on base actually opens it up and turns the optocoupler on as well; so changing logical level on S21-RX between 0V and 3.3V had no impact on the actual logical level presented to S403 port). Connection to daikin simply MUST be done using a 5V high-level on uart pins. In the end I replaced CP2102 module with FTDI one jumper-switched to 5V levels.
Now it’s time to really start digging into the data protocol :slight_smile:

1 Like

Hello,
I solved my problem.
It was the connection between the RS485 / TTL module and the TTL interface.
The XY-K485 and HW-0519 modules must connect TX to TX and RX to RX.

Vincent

1 Like

Any updates? I’m also interested in this, would be great if we can use an ESP8266 to control it, like with the Mitsubishi

Hi,

For the Daikin Altherma owners, I just published ESPAltherma on github.
It supports Altherma heat pumps and connect to the X10A serial port.

3 Likes

Hello,
do you know already packet format for A/C control?
I am able to read a lot of parameters from Daikin Comfora, but not able to switch on and change values.
Thank you

Here is the link to list of commands with response from A/C. Some of them already recognized.
Daikin Comfora FTXP - Serial communication on S21 port

Hello.
Try this command
02 44 31 31 33 4e 33 5a 03
It will switch on COOL mode and 25С

Hello.
Try this command
02 44 31 31 33 4e 33 5a 03
It will switch on COOL mode and 25С

Hello,
yes you are right, this command is working. But it’s too late for me, I already bought wifi module to sniff serial communication by Arduino :upside_down_face:

Nevertheless, thank you

Hi guys.

I am interested in Daikin S21 UART protocol. As I understood from this topic, its the ASCII serial protocol.
Connection parameters: 2400 bps, 8 data bits, even parity bit, 2 stop bits.
Start character (0x02), ascii body, checksum and end character (0x03). Receiver must acknowledge message (send 0x06) before answer.
Did someone perform reverse engineering? Does anyone have a description, maybe a library? I have a desire to write an ESPHome component for integration into HomeAssistant. Can you help? Thanks in advance.

P.S.: Yes, maybe I was looking badly, but this is practically the only topic on the Internet where this is discussed at all! You are awesome! Let’s work together and write something to help people control Daikin air conditioners.

Hi.

This command in ASCII is D113N3.
N3 I guess this is the mode of operation (cooling), right? What does D113 mean? How is the target temperature encoded?

[@dudanov - If you highlight the quote and then click the popup "Quote, it will add the quote and the source to your post. Moderator (RW)]

Hi,
check my file https://drive.google.com/file/d/1LyEWbTcdNucfsnBGTTqissDmnzVDP04R/view?usp=sharing
…there are described some commands to read data from Daikin Comfora and there is possible to see some examples how temperatures is encoded

Regarding control command I will make some developing during winter time

Thanks for your work. It’s interesting. This file is read-only and cannot be printed or saved to disk. Can you share it as an editable spreadsheet format?

Why are you putting it off so late?

Too bad I don’t have a Daikin air conditioner and didn’t bother you. The reason for my interest is that I communicate in the topic of home automation and make control dongles for home devices. People with Daikin air conditioners are asking for help, but they themselves do not have any reverse engineering skills. I could write a component for these air conditioners as I did for Midea devices.

Thanks.

More to the point, please publish it here if at all possible. From the very first line of the FAQ:
Please don’t link to files on external sites. Unlike others, we want you to attach your screenshots, log files, etc to your post. If the external site goes away, the material is likely to be lost forever. If that happens, when someone reads your post, your question and our answer will have little or no value.

I have saved file as Excel format, you can find it attached. I hope it is according to rules now :slight_smile:
Remote control serial cmd (SHARED).zip (10.0 KB)

I don’t do any software developing now, because I try to enjoy summer (spent time on garden, pool, greenhouse, grill steaks, drink beer, etc) … winter evenings are good to sitting by PC and coding :wink:

3 Likes