Skip to content
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

[Documentation] S21 protocol: new findings #408

Open
misterobotique opened this issue Jul 30, 2024 · 266 comments
Open

[Documentation] S21 protocol: new findings #408

misterobotique opened this issue Jul 30, 2024 · 266 comments

Comments

@misterobotique
Copy link

misterobotique commented Jul 30, 2024

Long story short, I've also been reverse engineering S21 protocol and here are some of my findings.

Hardware

  1. air conditioner: S22ZTES-W (interior unit), F22ZTES-W (exterior unit)
  2. interface adaptor for wired remote controller: KRP067A41
  3. wired remote control: KRC081A1

Communication method

UART, 2400bps, 8 bit data, 2 bit stop, even parity, DC 5V voltage level.

Request commands

1) Message format

STX Byte(0) Byte(1) Checksum ETX
Checksum is the Modulo256 of the sum of Byte(0) and Byte(1).

2) Command list

Here is a list of what might be new commands.

Byte(0) Byte(1) Description
F 3 Timer
F 9 Coarse indoor, outdoor temperature (℃)
F M Total energy consumption (kWh)
R g Compressor status (ON/OFF)
R A Power status (ON/OFF)
R B Operation mode
R D ON Timer setting
R E OFF Timer setting
R F Swing setting
R K Cross flow fan speed setpoint (rpm)
R L Cross flow fan speed (rpm)
R M Louver vertical angle setpoint (degree)
R N Louver vertical angle (degree)

3) Unknown command list

Here is a list of commands my air conditioner responds to but I have not yet identified.
(Result of testing the commands F0 to F9, FA to FZ, R0 to R9, Ra to Rz and RA to RZ.)

Byte(0) Byte(1) Response
F 2 0x34 0x3A 0x80 x080
F 4 0x30 0x00 0x80 0x00
F 8 0x30 0x32 0x00 0x00
F A FFFF
F B 0000
F C 1A01
F G 0801 (see below)
F K 1001
F L 0000
F N 0000
F P 8300
F Q F200
F R ?000
F S 0000
F T 1000
R b 300
R e 050
R z 0x53 0x7A
R C 720+
R G A
R W 00

Details: [ . ][X][ . ][ . ] increments by one (from 0 to F and repeat) each time the air conditioner receives a command from the remote control.

2) Request sequence

The wired remote control sends the following sequence of commands indefinitely.
D20 -> F8 -> F2 -> F4 -> F3 -> F1 -> F5 -> D80000 -> RH -> F8 -> F2 -> F4 -> F3 -> F1 -> F5 -> D80000 -> Ra
I haven't figured out D20 neither D80000 yet. Response to D20 is always ACK while D80000 is always NAK.
Upon receipt of a response, the remote control sends an ACK after about 45ms.
The time between the remote control sending an ACK and then sending a new command is about 36ms.

Response

1) Message format

ACK STX Byte(0) Byte(1) ... Byte(n) Checksum ETX
Checksum is the Modulo256 of the sum of Byte(0) to Byte(n)

2) Timer

Bytes Values Description
Byte(0) G -
Byte(1) 3 -
Byte(2) 0, 1, 2, 3 Timers disabled, ON Timer, OFF Timer, Both timers
Byte(3) 0x36~0x78 ON Timer (1~12 hours)
Byte(4) 0x36~0x78 OFF Timer (1~12 hours)
Byte(5) 0 -

Timer setting (hours) = (Value – 0x30) / 6.

3) Coarse indoor, outdoor temperature (℃)

Bytes Values Description
Byte(0) G -
Byte(1) 9 -
Byte(2) see below Coarse indoor temperature
Byte(3) see below Coarse outdoor temperature
Byte(4) 0xFF -
Byte(5) 0x30 -

Temperature = (Value – 0x80) / 2.

4) Total energy consumption (kWh)

Bytes Values Description
Byte(0) G -
Byte(1) M -
Byte(2) 0~F Data[3]
Byte(3) 0~F Data[2]
Byte(4) 0~F Data[1]
Byte(5) 0~F Data[0]

Total energy consumption = Data[0~3] → Decimal / 10.

5) Compressor status (ON/OFF)

Bytes Values Description
Byte(0) S -
Byte(1) g -
Byte(2) 0, 1 Compressor OFF, Compressor ON

6) Power status (ON/OFF)

Bytes Values Description
Byte(0) S -
Byte(1) A -
Byte(2) 0, 1 Power OFF, Power ON

7) Operation mode

Bytes Values Description
Byte(0) S -
Byte(1) B -
Byte(2) 0, 2, 3, 4, 6 Auto, Dry, Cooling, Heating, Fan only

8) ON Timer setting

Bytes Values Description
Byte(0) S -
Byte(1) D -
Byte(2) 0~9 Minutes tens
Byte(3) 0~9 Minutes hundreds
Byte(4) 0~1 Minutes thousands

9) OFF Timer setting

Bytes Values Description
Byte(0) S -
Byte(1) E -
Byte(2) 0~9 Minutes tens
Byte(3) 0~9 Minutes hundreds
Byte(4) 0~1 Minutes thousands

10) Swing setting

Bytes Values Description
Byte(0) S -
Byte(1) F -
Byte(2) 0, 1, 2, 7 Disabled, Up & down, Left & right, Both
Byte(3) 0, F -

Byte(3) is 0 when Byte(2) = Disabled, F otherwise.

11) Cross flow fan speed setpoint (rpm)

Bytes Values Description
Byte(0) S -
Byte(1) K -
Byte(2) 0~9 Speed tens
Byte(3) 0~9 Speed hundreds
Byte(4) 0~1 Speed thousands

12) Cross flow fan speed (rpm)

Bytes Values Description
Byte(0) S -
Byte(1) L -
Byte(2) 0~9 Speed tens
Byte(3) 0~9 Speed hundreds
Byte(4) 0~1 Speed thousands

13) Louver vertical angle setpoint (degree)

Bytes Values Description
Byte(0) S -
Byte(1) M -
Byte(2) 0~9 Angle units
Byte(3) 0~9 Angle tens
Byte(4) 0~1 Angle hundreds
Byte(4) +, - Angle sign

When the louver is in the closed position, the vertical angle is 120°.

14) Louver vertical angle (degree)

Bytes Values Description
Byte(0) S -
Byte(1) N -
Byte(2) 0~9 Angle units
Byte(3) 0~9 Angle tens
Byte(4) 0~1 Angle hundreds
Byte(4) +, - Angle sign

Hope this help.

@revk
Copy link
Owner

revk commented Jul 30, 2024

Wow!!!

Ok we have most of that, but there are a couple of ones we can add.

@MassiPi
Copy link

MassiPi commented Aug 3, 2024

this is a wonderful work, but i wonder why i use mostyle different commands 🤣
being serious, i assume there are different S21 protocol versions.
For example, i have F1 that gives me all basic info (mode, fan, power), you have not.
F5 for me is swing state, you have not.

however, some of these commands get an answer also on my unit. Thanks!
just wondering why there is the info of target and real angle of VERTICAL louver, but not HORIZONTAL

have you tried also SETTING values? (i assume via D commands)? would be nice to set target position of louver :) will it be DK?

@misterobotique
Copy link
Author

misterobotique commented Aug 3, 2024

I've only posted the commands that I believe are not fully documented or commands that are still unknown.
The commands you mentioned including the following work with my air conditioner:

Byte(0) Byte(1) Description
F 1 Power (ON/OFF), operation mode, temperature setpoint (℃), wind speed
F 5 Swing setting
R a Outdoor temperature (℃)
R H Indoor temperature (℃)
R I Refrigerant temperature (at the evaporator coil inlet) (℃)
R X Temperature setpoint (℃)

For the temperature setpoint of F1, when operation mode = dry the temperature is how much the indoor temperature at start of dry operation is allowed to be warmed up/cooled down while removing moisture (see table below).

Value Description Remark
0x82 +2℃ Low dehumidification effect
0x81 +0.5~1.5℃
0x80 0℃
0x8F -0.5 ~ -1.5℃
0x8E -2℃ High dehumidification effect

My air conditioner model can only move the louver up and down, so I wasn't able to find which command can fetch the louver horizontal angle setpoint and actual one (if existing).

I've just started to play with commands for setting values and so far I've confirmed D1 and D5 work.

@MassiPi
Copy link

MassiPi commented Aug 3, 2024

ok this makes sense :) thanks a lot, i'm having some fun..
the only issue i see is that the more commands we send, the longer it takes for update, so we need to lower the refresh frequency

don't you have Rd working?

@misterobotique
Copy link
Author

Yes, Rd is also working (forget to add it in the previous table of known and working commands).

@MassiPi
Copy link

MassiPi commented Aug 4, 2024

any idea on the meaning of Rd response? mine is commonly 20 or 40, i see around talking about frequency but to me it seems more a percentage of load..

@misterobotique
Copy link
Author

misterobotique commented Aug 4, 2024

Regarding Rd response, I would agree with the idea that it is the inverter compressor frequency (Hz).
According to ChatGPT, the normal operating frequency range for the compressor in consumer-oriented air conditioners is around 20-30 Hz for minimal cooling, 40-80 Hz for moderate cooling and 90-120 Hz for maximum cooling.
In my case, with a temperature setpoint of 27℃ I've seen values like 26Hz in the morning when it's around 30℃ outside and around 65Hz in the afternoon when it's above 37℃ outside.

For so, I've defined Rd response as follow:

Byte Description Value
Byte(0) - S
Byte(1) - d
Byte(2) Frequency units
Byte(3) Frequency tens
Byte(4) Frequency hundreds

But I wasn't able to confirm it's indeed the compressor frequency as the wired remote control I use for reverse engineering doesn't display neither poll this information from the air conditioner.

@MassiPi
Copy link

MassiPi commented Aug 4, 2024

i can't find official values in the tech document of my external unit, but it makes sense to be frequency, i'll use it in that way :)

@MassiPi
Copy link

MassiPi commented Aug 4, 2024

Ok on my system (old Perfera) i do not have additional responses than yours (so i assume i can't set horizzontal lid angle), but i have a lot of NAK where you get info.
On R commands i only miss RW, but on F i have much more holes (F9 | FA | FB | FC | FG | FK | FL | FM | FN | FP | FQ | FR | FS | FT). I assume it's a matter of unit maturity and features..

@MassiPi
Copy link

MassiPi commented Aug 5, 2024

sadly i get NAK for both DK and DM commands, so probably target fan speed and target angle can't be set :(

@Sonic-Amiga
Copy link
Contributor

Hello guys!

I have recently ordered an old stock BRP069B41 online controller specifically for dissection, and after some fighting with geo-blocking i even managed to set it up to work with an A/C simulator, However, it currently sits in "ret=SERIAL IF FAILURE,err=252" state. I am assuming that this means "incompatible A/C model", because communication actually works fine. And if i stop the simulator, error code changes to 251 (and it stops responding to /aircon/* completely, only to /common/basic_info), so the A/C is indeed online.

It currently sends 4 queries in a loop:

Got command: F2
 -> unknown ('F2')
Got command: F1
 -> power 0 mode 3 temp 22.5
Got command: F3
 -> powerful ('F3') 0
Got command: F4
 -> unknown ('F4')

I am thinking that F4 and F2 are responsible for A/C model identification. I hardcoded replies, which my FTXF20D sends. I was planning to play with these values and see how the controller reacts to changes. But first i need to get it fully running.

So hence my first request for help. Can any of you from EU share me replies of your A/C to F2 and F4 commands ? Especially wanted are replies from any model on this list:
FTXM-M
CTXM-M
ATXM-M
FTXTM-M
BRP069A45
FTXG-LS
FTXG-LW
FTXJ-MW *
FTXJ-MS *

These are listed on https://www.daikin.eu/en_us/product-group/control-systems/onecta/connectable-units.html as compatible with my parrticular box.

Please reply with data and your A/C model. Just in case if someone cares: these data can't be used to identify you personally.

Another interesting finding is 'FU' command. The controller sends it only once upon startup. My A/C doesn't know it, i checked. So, simulator currently replies with NAK, just like a real unit. I tried to modify the sim to reply with 4 zeroes. Controller status didn't change, but interestingly it responds with a byte of 0x15 instead of ACK before proceeding.

If anyone is interested, you can find my modified simulator here https://github.com/Sonic-Amiga/ESP8266-Faikin/tree/main/Tools/Simulators . I will upstream changes, of course, once i have some more interesting findings.

@Sonic-Amiga
Copy link
Contributor

UPD: The controller appeared fully working with my another unit, ATX20K2V1B. The unit is older and runs BRP069A41; it was available here back then... Dam, that's an ealier revision of the same unit!

Need to Faikin-ize it to shake some info out of it.

@hedgepigdaniel
Copy link

Model F2 response F4 response
CTXM60RVMA, CTXM35RVMA 0247323D3B00807103 024734300080305B03
CTXM25RVMA 0247323D3B00807103 0247343000A0307B03

@Sonic-Amiga what responses do your units send?

@Sonic-Amiga
Copy link
Contributor

Snip from the simulator, containing the answer:

		 case '2':
		    // BRP069B41 sends this as first command. If NAK is received, it keeps retrying
			// and doesn't send anything else. Suggestion - query AC features
		    if (debug)
		       printf(" -> unknown ('F2')\n");
			response[3] = 0x34; // No idea what this is, taken from my FTXF20D
			response[4] = 0x3A;
			response[5] = 0x00;
			response[6] = 0x80;

		    s21_reply(p, response, buf, S21_PAYLOAD_LEN);
			break;
		 case '3':
		    if (debug)
		       printf(" -> powerful ('F3') %d\n", powerful);
			response[3] = 0x30; // No idea what this is, taken from my FTXF20D
			response[4] = 0xFE;
			response[5] = 0xFE;
			response[6] = powerful ? 2 : 0;

		    s21_reply(p, response, buf, S21_PAYLOAD_LEN);
			break;
		 case '4':
		    if (debug)
		       printf(" -> unknown ('F4')\n");
		    response[3] = 0x30; // No idea what this is, taken from my FTXF20D
			response[4] = 0x00;
			response[5] = 0xA0;
			response[6] = 0x30;

			s21_reply(p, response, buf, S21_PAYLOAD_LEN);
			break;

As to my older ATX20 unit, i have no idea; and i am waiting for my connectors order to arrive so that i could make an adapter for some of ESP hardware i have on hands. So, it doesn't have Faikin currently, so i can't actively research it. Hope parts to arrive next week.

@Sonic-Amiga
Copy link
Contributor

Thank you very much, we're moving.
I started changing replies one by one. First i changed F4, the result was the same, error 252. Then i also changed F2, and controller moved on:

$ ./faikin-s21.exe -p COM3 -v
Got command: F2
 -> unknown ('F2')
Got command: F1
 -> power 0 mode 3 temp 22.5
Got command: F3
 -> powerful ('F3') 0
Got command: F4
 -> unknown ('F4')
Got command: F5
 -> swing 0
Got command: F8
 -> Unknown command, sending NAK
Got command: F8
 -> Unknown command, sending NAK

When it gets NAK, it resends the command in an infinite loop. So now i need to implement F8 and probably more. Stay tuned!
BTW, you may also order some experiments with my BRP. I wonder if i could share it online...

@Sonic-Amiga
Copy link
Contributor

Wooohooo, off we go, it's alive! Status OK, control works!
The code pushed to my repo.

@Sonic-Amiga
Copy link
Contributor

So, very interesting. This is the log when it worked:

$ ./faikin-s21.exe -p COM3 -v
Got command: F8
 -> unknown ('F8')
Got command: F9
 -> Unknown command, sending NAK
Got command: F6
 -> powerful ('F6') 0
Got command: F7
 -> eco 0
Got command: FB
 -> Unknown command, sending NAK
Got command: FG
 -> Unknown command, sending NAK
Got command: FK
 -> Unknown command, sending NAK
Got command: FM
 -> Unknown command, sending NAK
Got command: FN
 -> Unknown command, sending NAK
Got command: FP
 -> Unknown command, sending NAK
Got command: FQ
 -> Unknown command, sending NAK
Got command: FS
 -> Unknown command, sending NAK
Got command: FT
 -> Unknown command, sending NAK
Got command: Rd
 -> Unknown command, sending NAK
Got command: F2
 -> unknown ('F2')
Got command: F1
 -> power 0 mode 3 temp 22.5
Got command: F3
 -> powerful ('F3') 0
Got command: F4
 -> unknown ('F4')
Got command: F5
 -> swing 0
Got command: RL
Got command: F2
 -> unknown ('F2')
Got command: F1
 -> power 0 mode 3 temp 22.5
Got command: F3
 -> powerful ('F3') 0
Got command: F4
 -> unknown ('F4')
Got command: F5
 -> swing 0
Got command: RH
 -> 'H' sensor = +245
Got command: F2
 -> unknown ('F2')
Got command: F1
 -> power 0 mode 3 temp 22.5
Got command: F3
 -> powerful ('F3') 0
Got command: F4
 -> unknown ('F4')
Got command: F5
 -> swing 0
Got command: RN
 -> Unknown command, sending NAK
Got command: F2
 -> unknown ('F2')
Got command: F1
 -> power 0 mode 3 temp 22.5
Got command: F3
 -> powerful ('F3') 0
Got command: F4
 -> unknown ('F4')
Got command: F5
 -> swing 0
Got command: RI
 -> 'I' sensor = +185
Got command: F2
 -> unknown ('F2')
Got command: F1
 -> power 0 mode 3 temp 22.5
Got command: F3
 -> powerful ('F3') 0
Got command: F4
 -> unknown ('F4')
Got command: F5
 -> swing 0
Got command: Ra
 -> 'a' sensor = +205
Got command: F2
 -> unknown ('F2')
Got command: F1
 -> power 0 mode 3 temp 22.5
Got command: F3
 -> powerful ('F3') 0
Got command: F4
 -> unknown ('F4')
Got command: F5
 -> swing 0
Got command: RX
 -> Unknown command, sending NAK
Got command: F2
 -> unknown ('F2')
Got command: F1
 -> power 0 mode 3 temp 22.5
Got command: F3
 -> powerful ('F3') 0
Got command: F4
 -> unknown ('F4')
Got command: F5
 -> swing 0
Got command: F2
 -> unknown ('F2')
Got command: F1
 -> power 0 mode 3 temp 22.5
Got command: F3
 -> powerful ('F3') 0
Got command: F4
 -> unknown ('F4')
Got command: F5
 -> swing 0
Got command: F2
 -> unknown ('F2')
Got command: F1
 -> power 0 mode 3 temp 22.5
Got command: F3
 -> powerful ('F3') 0
Got command: F4
 -> unknown ('F4')
Got command: F5
 -> swing 0
Got command: F2
 -> unknown ('F2')
Got command: F1
 -> power 0 mode 3 temp 22.5
Got command: F3
 -> powerful ('F3') 0
Got command: F4
 -> unknown ('F4')
Got command: F5

So, it looped: F2 F1 F3 F4 F5; and every iteration it also queried one sensor ('R'). Majority of them aren't implemented in the simulator yet.

But i am unable to reproduce this. After i restarted the sim and controller, after F8 it started wanting F9. Then FB. Something is off; perhaps i unintentionally exploited some bug.

@Sonic-Amiga
Copy link
Contributor

I reproduced my success following the algorithm:
Every time we get F8, increment a counter. Drop it 15 times (do not respond), then reset the counter to zero and say NAK
Eventually the controller gives up probing and goes online (see log above)

F8 response from my faikin-ized unit is 30 32 30 30, i. e. '0020' (we read it in reverse like other values)
If i implement this response, the controller does not calm down and wants F9, then tons of other stuff (almost all english alphabet), then proceeds to 'Mx`, where x is more characters. I gave up on that, too many commands. Interestingly enough, my FTX20 knows all of them.

I have also just tried 30 30 30 30, and also 00 00 00 00. Different thing happens; the controller now wants MM

Conclusion: F8 is used to query for additional features.

@Sonic-Amiga
Copy link
Contributor

Further confirmation to the theory is the log:

Got command: F8
 -> unknown ('F8')
Got command: RH
 -> 'H' sensor = +245
Got command: Ra
 -> 'a' sensor = +205

So, it does not go for F9 (which, we know, reports home and outside temp in some 'new' form), but instead asks for RH and Ra. Protocol version maybe ?

@Sonic-Amiga
Copy link
Contributor

Confirmed. F8 = "protocol version". Known responses are '0020' and '0010'. '0000' does the same as '0010'; i guess they do "if (version > '1')" sort of check.

Version 1 has interesting 'MM' command, it replies with 'MFFFF' (yes, just one command byte, 5 bytes total). No idea what that is, grabbed from my FTXF20. I tried different second chars (MM, MN, MA), they all seem to produce an identical response.

Hack with timeouting removed, the controller is online with simulated A/C.

Funny that Faikin mis-detected 'M' response as loopback, i'll fix it.

@misterobotique
Copy link
Author

With my Japanese model, the command F8 returns: G 8 0 2 0x00 0x00.
Command F2 returns: G 2 4 : 0x00 0x80.
Command F4 returns: G 4 0 0x00 0xA0 the first time then always G 4 0 0x00 0x80

I've also tried to send different commands, like "A" or "HG" or "cd" and so on but only got responses from the following:

Command Response
A STX C A ETX
B ACK
G 0xC5
M STX M F F F F e ETX
V STX V 0 0 A 0 ' ETX

Sonic-Amiga added a commit to Sonic-Amiga/ESP8266-Faikin that referenced this issue Aug 10, 2024
Reverse-engineered from original Daikin BRP069B41 online controller, which
is now able to work with this simulator.

See revk#408 for some documented findings

Signed-off-by: Pavel Fedin <[email protected]>
@Sonic-Amiga
Copy link
Contributor

@hedgepigdaniel So, i am currently simulating CTXM60RVMA (not exactly, however) . I can connect to this A/C using old "Online controller" app, and i can see:

  • The unit has vertical, horizontal and 3D swing modes
  • The unit does not have "night" fan speed.
    Is this correct or not ?
    If correct, does your second unit, CTXM25RVMA, have different set of these features ? Which one ?

@misterobotique The same question goes to you.

@Sonic-Amiga
Copy link
Contributor

@misterobotique

Command F2 returns: G 2 4 : 0x00 0x80.
Command F4 returns: G 4 0 0x00 0xA0 the first time

Sorry, couldn't understand how to interpret this. The payload (i. e. what follows response code: 'G2', 'G4') should be 4 bytes. Can you show raw dump ?

@Sonic-Amiga
Copy link
Contributor

Sonic-Amiga commented Aug 10, 2024

@hedgepigdaniel Lotta fun... If i respond '0247343000A0307B03' to F4, the controller says error 252, which is i am assuming "incompatible model". And that's the very same string my FTX20 reports, by the way.

@misterobotique
Copy link
Author

misterobotique commented Aug 11, 2024

@Sonic-Amiga
Mixing ASCII and hexadecimal was confusing, sorry.
F8 returns: 02 47 38 30 32 00 00 E1 03.
F2 returns: 02 47 32 34 3A 80 80 E7 03.
F4 returns: 02 47 34 30 00 A0 00 4B 03 the first time then always 02 47 34 30 00 80 00 2B 03

@hedgepigdaniel
Copy link

@hedgepigdaniel So, i am currently simulating CTXM60RVMA (not exactly, however) . I can connect to this A/C using old "Online controller" app, and i can see:

The unit has vertical, horizontal and 3D swing modes
Correct
The unit does not have "night" fan speed.
Is this correct or not ?
Incorrect. The IR remote has a "indoor unit quiet mode" with the night icon, and it clearly does reduce the fan speed compared to the auto mode. However, after setting night mode using the IR remote, Faikin sees it in auto mode. Setting it in night mode via Faikin seems to work correctly in that the fan is still low, and refreshing the UI shows it still in night mode.

If correct, does your second unit, CTXM25RVMA, have different set of these features ? Which one ?

As far as I can tell, the entire CTXM25RVMA, CTXM35RVMA, CTXM60RVMA have exactly the same set of features except that in the CTXM60RVMA there is only a single "intelligent eye" human presense sensor mode - on and off, whereas in the smaller units there are 3 settings - off, blow towards people, blow away from people. Same IR remote for all of them.

@hedgepigdaniel
Copy link

And for all of CTXM25RVMA, CTXM35RVMA, CTXM60RVMA, F8 response is 024738303230304103 or "0200"

@misterobotique
Copy link
Author

@hedgepigdaniel So, i am currently simulating CTXM60RVMA (not exactly, however) . I can connect to this A/C using old "Online controller" app, and i can see:

  • The unit has vertical, horizontal and 3D swing modes
  • The unit does not have "night" fan speed.
    Is this correct or not ?
    If correct, does your second unit, CTXM25RVMA, have different set of these features ? Which one ?

@misterobotique The same question goes to you.

SxxWTES-W, SxxWTEP-W and SxxWTEV-W series only have the following features:

  • vertical swing mode
  • "night" fan speed
  • "comfort" fan speed

@Sonic-Amiga
Copy link
Contributor

Does anyone here own BRP069C41 controller ? I'd like to ask to run it with simulator; i'll give detailed instructions. I am experiencing problems; and i'd like to distinguish simulation problems vs network problems.

@sm-Fifteen
Copy link

Ok, so I monitored Rz00-RzFF for a few hours, and it seems pretty clear to me that the "parameter" part is to be read in reverse, because most of the "floating" ones are in one large cluster from RzE3 to RzBE. The way in which most of these vary also tells me that the value needs to be interpreted in reverse, like everywhere else. I didn't include other R signals, which in retrospect would probably have been useful to compare if any of these vary together, but it at least gives a clearer idea of which ones are static, which ones are floating, and which ones naturally vary.

This is what I gathered logged into a CSV file, with F1 included to show when I turned the unit on and changed the temperature. To cut down on the noise and make patterns easier to identify, values are only logged if they have changed.

faikin_rz_replies.csv

@Sonic-Amiga: Rz52 and Rz72 did not vary at all during the 4 hour period I was measuring.

@sm-Fifteen
Copy link

sm-Fifteen commented Oct 6, 2024

Ok, I ran it some more tests with extra R sensors for reference, and here's my interpretation of the results so far:

faikin_rz_replies4.csv

  • Rz21 and RzE1 look like a pretty good contenders for the motion sensor (notice how they only change alongside with RX, the target temperature, even though the setpoint stays the same the whole time)
    • RzB1 changes a bit more often, but it also a fairly promising candidate
  • RzD3 has a different value every time I poll it. I'm guessing it's either a timer or a received command counter of sorts It's a counter in seconds.
  • RzFE, Rz0F, Rz2F and Rz3F only started changing when I turned on the unit and when I set the fan to manual speed and/or 3D motion. They may represent fin/louvre motor encoder data.
  • RzC3 is very interesting, because it only changes value when I turn either unit on or off (the other unit is only turned on from around 14h41 to 14h48), so it may represent some sort of system state. I'll have to keep an eye on it.
  • I have zero idea what RzCF, RzEF and RzFF might be for, they vary slightly in a way that seems completely unaffected by whether the unit is on or off. Maybe air pressure or input voltage?
  • RzB2 changes when the unit turns on and goes back to zero when it turns off, in sync with F1 and probably RA.
  • RzA1 and Rz31 (both identical) is pretty clearly the raw value of Rb, as they always both vary in step and have the same value (plus an extra zero for Rb). I'm guessing RzA1 uses the hex representation, but I didn't test for values that high.
  • Rz01 seems like it could be related to fan mode
  • RzC0, RzD0, RzE0, RzF0 and Rz11 change when the unit turns on, but not when it turns back off.
  • Rz62 looks like the external temperature sensor, it pretty much varies in step with Ra (but not all the time) and mostly follows its variations (but also not quite all the time).
  • RzD1 is the raw compressor speed value, they always only vary in step and the hex value is always equal to the decimal value in Rd
  • Rz81 could be the raw value for the liquid temperature sensor, it mostly varies in step with RI, whether the unit is turned on or off
  • Rz71 and RzF1 could both be the raw indoor temperature sensor, hard to tell because they both can be pretty noisy and I'm currently polling both of them as well as RH a few seconds appart from each other at the moment

Rz02, Rz22, Rz32 and Rz61 will require further investigation

Everything else in the Rz00-RzFF space is either floating (like the entire block from RzD4 to RzDC) or appears to be static values (like the initial Rz00 to RzB0 range).

EDIT: D3 goes from "56" (0x65, 101) to "8C" (0xC8, 200) before it wraps around, oddly enough.

@sm-Fifteen
Copy link

Can anyone verify that the Rz behaviors I mentionned above at least appear to match the behavior on their units? By the looks of it, Rz looks like some kind of raw register access, and I can't verify that these are the same across models and/or protocol versions.

@Sonic-Amiga
Copy link
Contributor

Sorry, only after return from vacation (30th oct). No time, need to prepare myself.

@hedgepigdaniel
Copy link

hedgepigdaniel commented Oct 9, 2024

Can anyone verify that the Rz behaviors I mentioned above

Yes, a cursory investigation shows that my V2 units report similar values.

Rz62 looks like the external temperature sensor

Mine return different values amongst units on the same outdoor unit and the same temperature sensor - so I don't think so.

RzD1 is the raw compressor speed value

matches for each outdoor unit - makes sense

Rz21 and RzE1 look like a pretty good contenders for the motion sensor
RzB1 changes a bit more often, but it also a fairly promising candidate

In all three cases, I don't see an obvious correlation based on the sensor setting or actual human presence. I wonder if 21/E1 is the "load" value that increases as the difference between actual and target temperatures change? B1 seems to be a hex number that is 0 when the unit is off.

@sm-Fifteen
Copy link

In all three cases, I don't see an obvious correlation based on the sensor setting or actual human presence.

Huge bummer if you're right about this, because that would imply that the sensor is not exposed at all.

I wonder if 21/E1 is the "load" value that increases as the difference between actual and target temperatures change? B1 seems to be a hex number that is 0 when the unit is off.

That would be RzA1 and Rz31, which both always seem to match and vary with Rb, which I've already established to correspond to ΔD, the indoor frequency command signal.

Mine return different values amongst units on the same outdoor unit and the same temperature sensor - so I don't think so.

If you have multizone, can you also check RzC3?

@hedgepigdaniel
Copy link

hedgepigdaniel commented Oct 9, 2024

If you have multizone, can you also check RzC3?

Hex values for each group of indoor units on the same outdoor:
12, 12, 12
40, 02

that would imply that the sensor is not exposed at all.

Why - are you confident that we have already found and completely tested all possible commands? I'm not hopeful about the presence sensor, but I can't say with confidence that it's not available somehow.

@sm-Fifteen
Copy link

sm-Fifteen commented Nov 4, 2024

It has finally gotten cold enough over here for me to catch a defrost cycle (as evidenced by the fan stopping and the indoors liquid temp "RI" dropping in the single digits) while probing. While none of the "00"-"FF" Rz registers have been showing anything very interesting during said defrost cycle, I did notice that Rb (currently identified as the indoor frequency command signal) jumps to "900" (9) without any associated changes to RX (target indoor temp.) and RH (target indoor temp.), even though Rb is "supposed to" be how many half-degrees Celcius there are between each in order to adjust compressor and fan speed. This is very interesting, because even powerful mode changes the target temperature in order to reach maximum operation power, so this type of operation is unlike anything I've seen so far. Will require further investigation.

EDIT: RzA1 and Rz31 are NOT the same. They are almost always in sync, but when Rb becomes "900" when switching to defrost mode, only RzA1 seems to follow (becoming "90"), while Rz31 stays the same (in my case it stayed at "00").

@sm-Fifteen
Copy link

sm-Fifteen commented Nov 13, 2024

Ok, I really think I've cracked RzC3. Here's my current hypothesis for what the states mean (all bytes are in wire order):

RzC3 (which resplies with "SzC3XX") is the compressor state

"0" variant code "2" variant code Meaning (guess) Reasoning
00 02 Compressor normal (active or idle) Only if Rb is zero. Rd can be non-zero if a different unit is using the compressor.
10 12 3 minutes compressor cooldown Happens every time Rd becomes zero (excluding defrost), and lasts about 3 minutes each time before switching to 00/02
40 42 Compressor "in use by me" Happens only if Rb is non-zero , reliably triggered by boost mode
80 82 Compressor reversing (no cooldown) Happens only before and after defrosting
C0 C2 Compressor defrost Always happens with a sharp drop in RI and, Rb jumping to 900 and RK staying at 0 the whole time

Reminder:

  • Rd is compressor frequency
  • Rb is "how hard this unit is pulling"
  • RI is indoors fluid temperature
  • RK is fan speed tap (target speed, one of just a dozen discrete values)

I've not observed other values so far, though I've not retested dry mode to look for RzC3 values.

Could someone else confirm that RzC3 behaves the zame way on their unit? The last thing I'd want is for Rz to be some kind of raw memory dump and to actually be unique per model.

EDIT: I initially figured that 2 meant heating and 0 meant cooling, but after doing some more targeted tests, it's become clear that this isn't the case. My current guess is that 0 means "no other unit is turned on" and 2 means "another unit could be using the compressor". Still not 100% clear whether it also changes based on master/slave roles. Will need to run some more tests to confirm that.

Also, there's no signal for "Warming up for hot start" (which shows up as normal activity, so 4X/0X), even though I know P1P2 thermostats acknowledge that status and display it the same way they do with defrosting.

EDIT2: Actually, it looks like the one signal I had stumbled on at the beginning by mistake would have been a clone of that one.

With that said, Rz is the one I'm interested in. The values I'm seeing clearly indicate it represents some kind of system state, but I'm having trouble making sense of them. It looks like the format differs between both units.

For the slave unit, i'm getting values like Sz\xcc342, which I'm interpreting like this

  • \xCC: Unknown, constant for both units
  • 3: Compressor is in cooling mode (I think?)
  • 4: This unit is running (flips to zero when turned off or conflicting with master)
  • 2: Another unit may take priority (switches to 0 is the master is turned off or in fan mode)

This would be in line with the hypothesis that this last character (the one flipping between 0 and 2) represents another unit being online.

EDIT3: The exact value range has me think this could also be the hex representation of a bitfield, but that's probably going to be hard to verify if we can't find anymore states.

@sm-Fifteen
Copy link

Could someone with a Protocol v2 or v3.x unit confirm that RzB2 and RzC3 behave as documented in the wiki for them? I just want to make sure that the behavior is the same for everyone.

@sam-m7
Copy link
Contributor

sam-m7 commented Nov 23, 2024

Could someone with a Protocol v2 or v3.x unit confirm that RzB2 and RzC3 behave as documented in the wiki for them? I just want to make sure that the behavior is the same for everyone.

It's not cold enough here so I can't check the defrost cycles. Here are my results from quickly querying the commands on a few active/not active units.

RzB2 matched with the wiki. I could check unit on, unit on and idle, unit actively heating.

RzC3 didn't completely match.

Unit State Response
This unit is actively heating/cooling seen C344 and C340
This indoor unit is idle or offline, but other indoor units are online seen C306 and C302
All indoor units are off seen C304 and C300
Compressor unavailable, other units are online (just switched to idle) seen C312
Compressor just stopped and is unavailable (just switched to idle) seen C310
One indoor unit is idle, compressor not in use seen C300 (on the indoor unit that was idle, but on) and C302 (on the indoor unit that was off)

@sam-m7
Copy link
Contributor

sam-m7 commented Nov 23, 2024

I was trying to find the command for the floor heating option of the new floor standing indoor units (Perfera). The units have protocol version 3.4. Unfortunately I wasn't very successful so far. The units come with the cloud based wifi modules (BRP069C4x, connected to S801).
I've measured the voltages a few days ago, from an electrical standpoint S801 looks like S21. I've measured:

  1. 5V
  2. ~4V
  3. ~4V
  4. ~13/14V (not sure anymore)
  5. GND

So if the Faikin module would come with the correct connector, it could probably be a drop-in replacement for the original Wifi modules I think, without the need to buy/make a new cable or even open the PCB enclosure of the AC. But so far I've only attached it in snoop mode, with only the power supply lines (GND, 14V) and RX connected so far (hoping it's just S21 on another port).
Unfortunately this revealed that the protocol is not recognized by the Faikin (as far as I can see). I do receive data with dump mode enabled in X50A, CN_Wired, Altherma_S mode (not in S21 mode), but it always shows an error, like bad checksum or something like that in the MQTT messages.

The data looked like this: "0232861222830222C302320602328612228C12220D023286162......" if someone has an idea.

@Sonic-Amiga
Copy link
Contributor

Hi!
I have never tested snoop mode,i believe it could only be partially working.
These long strings indeed look like x50. Additionally, 049C controller apparently works with x50 protocol. It actually knows both, and if i connect it to S21 simulator, it talks valid s21, but refuses to work on cloud side ("unit is offline")
I have a suggestion that different models of the controller have the same core s/w, but they are programmed with white list of a/c models to work with

@Sonic-Amiga
Copy link
Contributor

Sonic-Amiga commented Nov 24, 2024

+14V is correct power value BTW. 5V pin is not used by these controllers.

@sm-Fifteen
Copy link

Could someone with a Protocol v2 or v3.x unit confirm that RzB2 and RzC3 behave as documented in the wiki for them? I just want to make sure that the behavior is the same for everyone.

It's not cold enough here so I can't check the defrost cycles. Here are my results from quickly querying the commands on a few active/not active units.

RzB2 matched with the wiki. I could check unit on, unit on and idle, unit actively heating.

RzC3 didn't completely match.

Ok, interesting, it seems like you have an extra bit on the ASCII bitfield for RzC3 that my unit doesn't, 0x40. From your table, I'd hazard a guess that maybe it means "Other units have their valve open", but you would have to do more tests on your end to isolate whether that's actually what it stands for.

For reference, what's your unit model?

@Sonic-Amiga
Copy link
Contributor

Sonic-Amiga commented Nov 24, 2024

@sam-m7 Testing RzC3 on my ATX20K2V1B (protocol v2):
Turned off: C304
Running in heat mode: C344
It's not a multi-split system, so cannot have indoor unit mode contention here. It's -1C outside, i am now running it to catch defrost cycle.
UPD: C384 - defrost starting (reversing in progress)
C3C4 - defrost in progress

So all matches; bit '4' (1 << 2) isn't known.

@Sonic-Amiga
Copy link
Contributor

The data looked like this: "0232861222830222C302320602328612228C12220D023286162......" if someone has an idea.

Very strange; most likely garbled data. 02 is a valid STX for S21, by the way...
This guy also has Perfera; and it clearly speaks S21.
But stop, i am confused, your previous message assumes S21 works fine. Or does that refer to another unit ?

@sam-m7
Copy link
Contributor

sam-m7 commented Nov 25, 2024

Could someone with a Protocol v2 or v3.x unit confirm that RzB2 and RzC3 behave as documented in the wiki for them? I just want to make sure that the behavior is the same for everyone.

It's not cold enough here so I can't check the defrost cycles. Here are my results from quickly querying the commands on a few active/not active units.
RzB2 matched with the wiki. I could check unit on, unit on and idle, unit actively heating.
RzC3 didn't completely match.

Ok, interesting, it seems like you have an extra bit on the ASCII bitfield for RzC3 that my unit doesn't, 0x40. From your table, I'd hazard a guess that maybe it means "Other units have their valve open", but you would have to do more tests on your end to isolate whether that's actually what it stands for.

For reference, what's your unit model?

I don't know. I can't really make something of the last ASCII value. It seems like it's locked to 0, 2 or 4 depending on the indoor unit. For example there were two outdoor units, both compressors were on and on each one, one indoor unit was heating and the other was off. Still, one of the off indoor units showed C302 and the other C306. When turning the C302 one on, it changed to C342. So there is another value for indoor unit heating now.

Indoor units are FVXM-A (with different performance classes)

@sam-m7
Copy link
Contributor

sam-m7 commented Nov 25, 2024

The data looked like this: "0232861222830222C302320602328612228C12220D023286162......" if someone has an idea.

Very strange; most likely garbled data. 02 is a valid STX for S21, by the way... This guy also has Perfera; and it clearly speaks S21. But stop, i am confused, your previous message assumes S21 works fine. Or does that refer to another unit ?

No, it's on the same unit. FVXM-A has S21, where I have connected the Faikins so far. It works for most features, I'm only missing the Floor warming option (upper lid is closed), which the Faikin currently doesn't have. Since the official app has this option, I thought I would try to listen into the data of the original wifi module, which is connected on a different port (S801) and can even stay attached (and keeps working), when a Faikin is connected to S21.

Yes, I've noticed a lot of 02 in the data, and was thinking if it could be S21 but with the baud-rate of X50A, Altherma_S, CN_Wired, since I've seen in the code, that those have the same baud-rate and with those protocols selected Faikin does receive data (although it can't make anything of it). But I think for valid S21, I should also find a lot of 0302, as 03 is ETX and should then be followed by 02 for a new message? But while I do find this, it doesn't happen that often and only with the same data next to it. So for all I know it might also be a completely different protocol. Unfortunately I have no idea how X50A is supposed to look, I also haven't found any documentation on it.

It might be worth a try to compile Faikin with the baud-rate of X50A for S21 and see if it can do something of the messages, but I haven't set up the build environment/tried it so far.

@sam-m7
Copy link
Contributor

sam-m7 commented Nov 25, 2024

Hi! I have never tested snoop mode,i believe it could only be partially working. These long strings indeed look like x50. Additionally, 049C controller apparently works with x50 protocol. It actually knows both, and if i connect it to S21 simulator, it talks valid s21, but refuses to work on cloud side ("unit is offline") I have a suggestion that different models of the controller have the same core s/w, but they are programmed with white list of a/c models to work with

Yes, I have read this earlier in the thread. Interesting that the cloud controller works with X50 on your side, maybe Faikin is not detecting it correctly.

@Sonic-Amiga
Copy link
Contributor

Took a quick look at code; "snoop" option is handled in any way only for S21. I guess there's some clash. I advice to disable all protocols except S21; and also disable pins inversion (it's already programmed in GPIO). Perhaps snoop mode only works with hidden "protofix" option, which is only accessible over MQTT. Not sure. I guess nobody has tested it for some time.

@Sonic-Amiga
Copy link
Contributor

Hello everyone!
I have managed to upgrade my BRP069B41 into Thai BRP072C42 , which supports newer protocols. At least some info is on the way.

@sam-m7
Copy link
Contributor

sam-m7 commented Nov 26, 2024

Took a quick look at code; "snoop" option is handled in any way only for S21. I guess there's some clash. I advice to disable all protocols except S21; and also disable pins inversion (it's already programmed in GPIO). Perhaps snoop mode only works with hidden "protofix" option, which is only accessible over MQTT. Not sure. I guess nobody has tested it for some time.

I think I've done that already. Used protofix at first (it was an older Faikin controller, where this was still set to S21 and also no swap RX/TX was set I think). With protofix to S21 the Faikin has not received anything, the same was the case for protofix removed and only S21 activated and every other protocol deactivated. Only when I've selected X50A, Altherma_S or CN_Wired (always with every other protocol disabled), it has shown data. Which is why I assumed this had something to do with the baud-rate. But it has always shown erros for those protocols and it seamed like it would try, as the messages/errors look different for each protocol, but couldn't interpret it correctly.

@Sonic-Amiga
Copy link
Contributor

Some update. I haven't had time to update also S21 doc, but with my upgraded controller i've got new get_monitordata fields, which gave me all FU commands: https://github.com/revk/ESP32-Faikin/wiki/Daikin-online-controller-reverse-engineering#airconget_monitordata . These have to do with A/C identification. Yes, the unit can be fully tracked. The only Daikin's excuse is that they actually don't program the full data; on real A/C's i have seen these fields are empty, containing only zeroes or spaces.

@sm-Fifteen
Copy link

I'm curious because I haven't seen any doc on the matter yet: Is X50 only different from S21 at a physical level (pinout, baud rate, etc.) or are the commands different as well?

@revk
Copy link
Owner

revk commented Nov 28, 2024

The commands are totally different.

@sm-Fifteen
Copy link

I'm also starting to suspect that the A command is similar to Rz where it has a bad length check on my unit and interprets checksum and ETX as command payload.

It's expecting a full command length of 4 characters (Axxx) like many others and returns 6 characters by repeating what it got as an argument, plus an ASCII hex value (CxxxFF). If it's anything like RzXX, there's going to be wraparound and floating values here as well, and we have no official controller messages to use as references.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests