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

Panasonic AC On and Off timer #544

Closed
MikkelTb opened this issue Oct 3, 2018 · 40 comments
Closed

Panasonic AC On and Off timer #544

MikkelTb opened this issue Oct 3, 2018 · 40 comments
Assignees
Labels
enhancement Hacktoberfest Hacktoberfest participation

Comments

@MikkelTb
Copy link

MikkelTb commented Oct 3, 2018

HI.

I find the Data in Panasonic protocol, which contain "Time", "On" and "Off"

Remote control: (toggel on/off) -> 23C, Fan Auto, Swing Auto, Quiet Off, Powerful Off
AC -> CS-ME14CKPG
Remote -> A75C2311
(my AC does not have a Vertical Swing)
 
On Timer set to 16:00
Off Timer set to 6:30
Time for push the Button 18:16

uint8_t state[27] = {0x02, 0x20, 0xE0, 0x04, 0x00, 0x00, 0x00, 0x06, 0x02, 0x20, 0xE0, 0x04, 0x00, 0x4E, 0x2E, 0x80, 0xAF, 0x00, 0xCA, 0x6B, 0x98, 0x10, 0x00, 0x01, 0x48, 0x04, 0xDB};

Byte nr 14 (0x4E) Contain information about State of On/Off timer
Byte nr. 19 to 21 (0xCA, 0x6B, 0x98) Contain the timer value
Byte nr 25 and 26 (0x48, 0x04)Contain the Time now

Byte nr.: 14
Both Cancel -> 0x48 -> 0100 1000
On -> 0x4A -> 0100 1010
Off -> 0x4C -> 0100 1100
On And Off -> 04E -> 0100 1110
Bit nr 6 and 7 show the state of On and Off timer

Byte 19 to 21 (0xCA, 0x6B, 0x98)
This represent the timer which, On timer 16:10, and Off timer 6:30
16:10 -> 16*60+10 -> 970 -> 0011 1100 1010 -> 3CA
CA is byte nr 19.
3 is comming from "0x6B" 0x6B -> 0110 1011 < But only the last 3 bit is taking
The last 3 bit -> 011
0xCA -> 1100 1010
011 1100 1010 <- 16:10

6:30 -> 6*60+30 -> 390 -> 0001 1000 0110 -> 186
from 0x6B, the first 4 bit is use -> 0110 1000
from 0x98, the first bit is not in use -> 1001 1000
001 1000 0110 -> 0x186 <- 6:30

Byte nr 25 and 26 (0x48, 0x04) Contain the Time now
The clock was 18:16
18:16 -> 18*60+16 -> 1096 -> 0100 0100 1000 -> 0x448
Byte nr 26 first, and only the last 3 bit, then Byte 25

I hope it make sens

@crankyoldgit
Copy link
Owner

@MikkelTb Nice work!

Yes, after reading it a few time, I think I've got it.

Just to confirm the edge cases. Can you please do the same analysis (for Bytes 19-21 and 25-26) for when the timers are 0:00 (which should be trivial), and for when the clock is 0:00 (again should be trivial) AND for when the clock is 23:59, and the timers at 23:50 i.e. their max values.
I suspect that will be 23*60+59 == 1439 == 0x59F = 0b10110011111 & 23*60+50 == 1430 == 0x596 == 0b10110010110 respectively. i.e. 11-bits long.
The 0:00 cases should be just 0's.

Once we've confirmed/checked that info. I'll code it up.
Also, could you please check what model number/series the head unit is please? Also the remote too.
See #540 (comment) where @shyne99 found theirs.

@crankyoldgit crankyoldgit self-assigned this Oct 4, 2018
@crankyoldgit crankyoldgit added enhancement Hacktoberfest Hacktoberfest participation labels Oct 4, 2018
@crankyoldgit
Copy link
Owner

(my AC does not have a Vertical Swing)

Are you sure about that? As the data/code seems to think it does, yet doesn't have Horizontal swing.

@MikkelTb
Copy link
Author

MikkelTb commented Oct 4, 2018

Hi,

I will provide the data for the timer, as soon I get home from work ;-)

My AC has Swing "Up and Down", and not a Swing for "Left and right"

Up and Down must be Horizontal

@MikkelTb
Copy link
Author

MikkelTb commented Oct 4, 2018

AC -> CS-ME14CKPG
Remote -> A75C2311

Picture of my Remote
image
image

This is my AC, but only with 3. indoor units, and with 3. Remote control
image

@crankyoldgit
Copy link
Owner

@MikkelTb I got impatient and coded up what I think it probably is based on the available data.

Can you please try out this branch? https://github.com/markszabo/IRremoteESP8266/tree/panasonic-timers

I still want that data I asked for from earlier. ;-)

@MikkelTb
Copy link
Author

MikkelTb commented Oct 4, 2018

Remote control: (toggel on/off) -> 23C, Fan Auto, Swing Auto, Quiet Off, Powerful Off
AC -> CS-ME14CKPG

On Timer set to 00:00
(Off timer set to 6:00 but is not active)
Start Time 18:11
uint8_t state[27] = {0x02, 0x20, 0xE0, 0x04, 0x00, 0x00, 0x00, 0x06, 0x02, 0x20, 0xE0, 0x04, 0x00, 0x4A, 0x2E, 0x80, 0xAF, 0x00, 0x00, 0x68, 0x98, 0x10, 0x00, 0x01, 0x43, 0x04, 0x05};

(On timer set to 0:00 but is not active)
Off Timer set to 00:00
Start Time 18:13
uint8_t state[27] = {0x02, 0x20, 0xE0, 0x04, 0x00, 0x00, 0x00, 0x06, 0x02, 0x20, 0xE0, 0x04, 0x00, 0x4C, 0x2E, 0x80, 0xAF, 0x00, 0x00, 0x08, 0x80, 0x10, 0x00, 0x01, 0x45, 0x04, 0x91};

On Timer set to 00:10
(Off timer set to 0:00 but is not active)
Start Time 00:00  
uint8_t state[27] = {0x02, 0x20, 0xE0, 0x04, 0x00, 0x00, 0x00, 0x06, 0x02, 0x20, 0xE0, 0x04, 0x00, 0x4A, 0x2E, 0x80, 0xAF, 0x00, 0x0A, 0x08, 0x80, 0x10, 0x00, 0x01, 0x00, 0x00, 0x50};

On Timer set to 00:00
(Off timer set to 0:00 but is not active)
Start Time 23:50
uint8_t state[27] = {0x02, 0x20, 0xE0, 0x04, 0x00, 0x00, 0x00, 0x06, 0x02, 0x20, 0xE0, 0x04, 0x00, 0x4A, 0x2E, 0x80, 0xAF, 0x00, 0x00, 0x08, 0x80, 0x10, 0x00, 0x01, 0x96, 0x05, 0xE1};

On Timer set to 00:00
(Off timer set to 0:00 but is not active)
Start Time 23:59
uint8_t state[27] = {0x02, 0x20, 0xE0, 0x04, 0x00, 0x00, 0x00, 0x06, 0x02, 0x20, 0xE0, 0x04, 0x00, 0x4A, 0x2E, 0x80, 0xAF, 0x00, 0x00, 0x08, 0x80, 0x10, 0x00, 0x01, 0x9F, 0x05, 0xEA};

Byte 25 and 26
0x9F, 0x05 -> 0x59F -> 1439 -> (23*60+59)=1439

Byte 19,20 and 21
0x00, 0x08, 0x80
4 first bit in byte 20, and the byte 19 -> 0x800 -> b1000 0000 0000 <- Remove the first bit from left ->b000 0000 0000

Byte 21 and the last 4 bit in byte 20 -> 0x800 ->b1000 0000 0000 <- Remove the first bit from left ->b000 0000 0000

@MikkelTb
Copy link
Author

MikkelTb commented Oct 4, 2018

Hi @crankyoldgit .

I have testede the latest release, and it seem to Work.

But it does not Work on my AC

I have done a small test.
1# Set up the setting in the program to reflect the remote control, and send the command to IR led, and received on IR receiver.

2# Send the settings from the remote to the IR receiver.

(And sorry i have add "const uint8_t kPanasonicAcSwingHOff = 0x00;" in "ir_Panasonic.h")

1#
Panasonic A/C remote is in the following state:
Power: 1,  Mode: 4, Temp: 23C, Fan Speed: 7, Model: 3, Time: 1380, Ontime: 960, OffTime: 390
IR Code: 0x0220E0040000000602

Timestamp : 000053.200
Encoding  : PANASONIC_AC
Code      : 0220E004000000060220E00400472E80AF00C06B980000016405D7 (216 bits)
Mesg Desc.: Model: 3 (DKE), Power: On, Mode: 4 (HEAT), Temp: 23C, Fan: 7 (AUTO), Swing (Vertical): 15 (AUTO), Swing (Horizontal): 0 (Not in use), Quiet: Off, Powerful: Off, Clock: 23:00, On Timer: 16:00, Off Timer: 6:30
Library   : v2.5.1

 
uint8_t state[27] = {0x02, 0x20, 0xE0, 0x04, 0x00, 0x00, 0x00, 0x06, 0x02, 0x20, 0xE0, 0x04, 0x00, 0x47, 0x2E, 0x80, 0xAF, 0x00, 0xC0, 0x6B, 0x98, 0x00, 0x00, 0x01, 0x64, 0x05, 0xD7};
 
 2#
Timestamp : 000077.414
Encoding  : PANASONIC_AC
Code      : 0220E004000000060220E004004E2E80AF00C06B981000016405EE (216 bits)
Mesg Desc.: Model: 3 (DKE), Power: Off, Mode: 4 (HEAT), Temp: 23C, Fan: 7 (AUTO), Swing (Vertical): 15 (AUTO), Swing (Horizontal): 0 (Not in use), Quiet: Off, Powerful: Off, Clock: 23:00, On Timer: 16:00, Off Timer: 6:30
Library   : v2.5.1

 
uint8_t state[27] = {0x02, 0x20, 0xE0, 0x04, 0x00, 0x00, 0x00, 0x06, 0x02, 0x20, 0xE0, 0x04, 0x00, 0x4E, 0x2E, 0x80, 0xAF, 0x00, 0xC0, 0x6B, 0x98, 0x10, 0x00, 0x01, 0x64, 0x05, 0xEE};

Byte nr.: 14 and 22 is different from The Code, to the remote.

Byte 14
Code -> 0x47 -> b0100 0111
Remote -> 0x4E -> b0100 1110
The 2 bit for timer on, is okay b0100 1110 but what the 2 other bit is, i do not know

Byte 22
Code -> 0x00
Remote -> 0x10
I do not know what byte 22 is, all data from my remote, has that value 0x10 in byte 22

@crankyoldgit
Copy link
Owner

Re-stating this:
Could you please check what model series the head unit is please?
See #540 (comment) where shyne99 found theirs.

@crankyoldgit
Copy link
Owner

crankyoldgit commented Oct 4, 2018

Can you also include the source code you are using to produce the synthetic states/messages?

@MikkelTb
Copy link
Author

MikkelTb commented Oct 4, 2018

Hi @crankyoldgit

IRrecvDumpV2.zip
20181005_001445

Just let me know, if you want anything else.

@crankyoldgit
Copy link
Owner

I do not know what byte 22 is, all data from my remote, has that value 0x10 in byte 22

Byte 22/state[21] is used for Quiet & Powerful mode by all the other existing model series. I suspect that you have a different model that we don't have support for yet. Hence the questions about trying to confirm what model series the head unit is (i.e. the thing that is inside your house etc). See the link to the comment about where to find the model series code.

Byte 14
Code -> 0x47 -> b0100 0111
Remote -> 0x4E -> b0100 1110
The 2 bit for timer on, is okay b0100 1110 but what the 2 other bit is, i do not know

The bits in Byte 14/state[13] are as follows.
The top four are the operating mode. e.g. b01000000 is heat mode. i.e. setMode()
The next bit down (b00001000) ... I have no idea yet. It may be specific to your model/series.
The next two (0b00000110) you've decoded as the off & on timer switches respectively.
The last bit (0b00000001) is the Power on/off switch. i.e. 1 = On, 0 = Off. At least for all the models seen thus far. i.e. setPower(), on(), off(). Maybe it's different on your device?

@crankyoldgit
Copy link
Owner

Thanks for the image. Like you. I've go no idea what series that is (But by the production date, it's OLD ;-)
I'll do some research to see what I can find/make up for it. :-)

In the meantime. Can you do some captures/tests to check if Byte 14/state[13] and the text description behaves as expected for the Power On/Off control via the remote?

@crankyoldgit
Copy link
Owner

I found a manual online, there also seems to be an "Odour wash" button on the remote, can you see what changes in the state[] with that too please.

@MikkelTb
Copy link
Author

MikkelTb commented Oct 4, 2018

OLD 😖 I got the system in 2008, and it was brand new.... but yes the date is 2003...

I will try to solved/test the Byte 14/state[13] on my AC.

And thanks for you work 👍

@MikkelTb
Copy link
Author

MikkelTb commented Oct 4, 2018

"Odour wash" yes I have that button. But I have never figure out what that means. But I will collect some information

@crankyoldgit
Copy link
Owner

Well, we can see if it changes the state[] at all at least.

@shyne99
Copy link

shyne99 commented Oct 5, 2018

Looks like a CKP serie from the label

@MikkelTb
Copy link
Author

MikkelTb commented Oct 5, 2018

      "Odour wash" yes I have that button. But I have never figure out what that means. But I will collect some information

This is the information, when i push the button (i press the button 5 times):

Timestamp : 057505.742
Encoding : UNKNOWN
Code : 1FB51F79 (132 bits)
Library : v2.5.1

uint16_t rawData[263] = {3496, 1734, 506, 366, 448, 1294, 504, 368, 498, 374, 452, 418, 448, 424, 444, 428, 450, 422, 446, 426, 450, 420, 448, 424, 452, 418, 448, 422, 444, 1300, 498, 374, 504, 368, 448, 424, 452, 418, 448, 424, 444, 428, 450, 422, 446, 1296, 500, 1242, 502, 1242, 504, 368, 498, 374, 452, 1292, 504, 366, 450, 422, 444, 426, 450, 420, 446, 424, 452, 418, 448, 424, 444, 428, 450, 422, 444, 426, 450, 420, 446, 424, 452, 418, 448, 422, 444, 428, 450, 422, 446, 426, 452, 420, 446, 426, 452, 418, 448, 424, 442, 428, 448, 422, 444, 426, 450, 420, 446, 426, 452, 418, 448, 424, 444, 428, 450, 422, 444, 1298, 500, 1244, 500, 372, 444, 428, 450, 422, 446, 426, 452, 418, 448, 10020, 3500, 1732, 498, 372, 452, 1290, 506, 366, 450, 422, 446, 426, 452, 420, 448, 424, 452, 418, 448, 422, 444, 426, 450, 420, 446, 426, 452, 420, 446, 1296, 500, 370, 444, 428, 450, 422, 446, 426, 452, 420, 446, 424, 442, 428, 448, 1294, 502, 1240, 504, 1238, 506, 366, 448, 422, 444, 1298, 498, 374, 452, 418, 448, 424, 444, 428, 450, 422, 446, 426, 450, 420, 446, 424, 452, 418, 448, 422, 444, 428, 450, 420, 446, 1298, 498, 1244, 500, 1242, 502, 368, 446, 1298, 500, 1244, 500, 372, 444, 428, 450, 1292, 504, 368, 446, 1296, 502, 370, 444, 426, 452, 1290, 504, 1238, 506, 366, 450, 422, 446, 1298, 498, 1246, 500, 372, 444, 428, 450, 1294, 452, 420, 446, 1296, 448, 422, 444}; // UNKNOWN 1FB51F79

Timestamp : 057507.664
Encoding : UNKNOWN
Code : 1FB51F79 (132 bits)
Library : v2.5.1

uint16_t rawData[263] = {3502, 1728, 502, 370, 498, 1246, 498, 372, 504, 366, 450, 422, 444, 426, 450, 422, 446, 426, 452, 420, 446, 424, 442, 428, 448, 422, 444, 428, 450, 1320, 476, 368, 500, 372, 442, 428, 450, 422, 444, 426, 452, 420, 446, 424, 452, 1318, 478, 1238, 498, 1246, 498, 372, 504, 366, 448, 1294, 502, 368, 498, 374, 452, 418, 448, 424, 444, 428, 450, 422, 446, 426, 450, 420, 446, 424, 452, 418, 448, 424, 444, 428, 450, 422, 446, 426, 452, 420, 446, 424, 442, 428, 448, 424, 444, 426, 450, 420, 446, 426, 452, 420, 448, 424, 444, 428, 450, 420, 444, 426, 450, 422, 446, 424, 454, 418, 448, 424, 444, 1326, 470, 1246, 500, 372, 506, 366, 448, 422, 444, 428, 450, 422, 446, 10022, 3498, 1732, 498, 374, 452, 1290, 506, 366, 450, 422, 446, 426, 452, 420, 446, 424, 452, 418, 448, 422, 444, 428, 450, 422, 446, 426, 452, 420, 446, 1324, 474, 370, 444, 426, 450, 420, 446, 424, 452, 420, 448, 424, 444, 428, 450, 1294, 502, 1240, 504, 1238, 506, 366, 450, 422, 446, 1298, 498, 372, 454, 418, 448, 424, 444, 428, 450, 422, 446, 426, 452, 420, 446, 424, 442, 428, 448, 422, 444, 428, 450, 420, 446, 1296, 500, 1244, 502, 1240, 504, 368, 446, 1296, 500, 1242, 502, 370, 446, 424, 452, 1292, 506, 366, 450, 1294, 502, 368, 446, 424, 452, 1290, 496, 1246, 498, 374, 452, 420, 446, 1296, 500, 1242, 502, 368, 446, 426, 452, 1290, 444, 428, 450, 1294, 502, 370, 446}; // UNKNOWN 1FB51F79

Timestamp : 057513.378
Encoding : UNKNOWN
Code : 1FB51F79 (132 bits)
Library : v2.5.1

uint16_t rawData[263] = {3498, 1734, 496, 374, 502, 1240, 504, 366, 500, 370, 496, 376, 450, 420, 446, 426, 452, 418, 448, 424, 444, 428, 448, 422, 444, 426, 450, 420, 446, 1296, 500, 372, 506, 366, 448, 422, 446, 426, 452, 420, 446, 424, 452, 418, 448, 1294, 502, 1240, 504, 1240, 504, 366, 500, 370, 444, 1298, 498, 374, 504, 368, 448, 422, 444, 428, 450, 422, 446, 426, 452, 420, 446, 424, 454, 418, 448, 422, 446, 426, 450, 420, 446, 426, 452, 418, 448, 422, 444, 428, 450, 422, 444, 426, 450, 420, 446, 424, 452, 418, 448, 424, 444, 428, 450, 420, 446, 426, 452, 420, 448, 424, 442, 428, 448, 422, 444, 426, 450, 1292, 504, 1266, 478, 366, 502, 370, 446, 426, 452, 420, 450, 420, 442, 10024, 3496, 1736, 442, 428, 450, 1294, 502, 368, 446, 424, 452, 418, 448, 424, 442, 428, 450, 422, 446, 426, 452, 420, 448, 424, 452, 418, 450, 422, 444, 1298, 498, 372, 452, 420, 448, 424, 444, 428, 450, 422, 446, 426, 452, 420, 446, 1296, 502, 1242, 502, 1240, 504, 368, 448, 424, 444, 1300, 496, 374, 452, 420, 448, 424, 442, 428, 450, 422, 444, 426, 452, 420, 446, 424, 452, 420, 448, 422, 444, 426, 450, 420, 446, 1298, 448, 1296, 500, 1242, 502, 370, 446, 1296, 500, 1244, 502, 368, 446, 426, 452, 1290, 506, 366, 448, 1294, 502, 368, 446, 424, 452, 1290, 444, 1298, 498, 374, 450, 420, 448, 1296, 450, 1294, 502, 368, 446, 426, 452, 1290, 444, 428, 450, 1294, 452, 420, 448}; // UNKNOWN 1FB51F79

Timestamp : 057514.616
Encoding : UNKNOWN
Code : 1FB51F79 (132 bits)
Library : v2.5.1

uint16_t rawData[263] = {3504, 1728, 502, 368, 498, 1244, 502, 370, 496, 376, 502, 368, 446, 424, 452, 420, 448, 422, 444, 428, 450, 422, 444, 426, 450, 420, 446, 424, 452, 1290, 496, 376, 502, 370, 446, 426, 452, 420, 448, 424, 442, 428, 450, 422, 446, 1298, 498, 1244, 500, 1242, 502, 370, 498, 374, 452, 1318, 478, 366, 502, 370, 446, 426, 450, 420, 448, 424, 452, 418, 450, 422, 444, 428, 450, 422, 446, 426, 452, 420, 446, 424, 442, 428, 448, 422, 444, 426, 450, 420, 446, 424, 452, 418, 448, 424, 444, 428, 448, 422, 446, 426, 450, 420, 446, 424, 454, 418, 448, 424, 444, 426, 452, 420, 446, 426, 452, 418, 448, 1294, 502, 1242, 504, 368, 498, 372, 454, 418, 448, 424, 444, 428, 450, 10018, 3504, 1728, 502, 368, 448, 1296, 500, 370, 444, 428, 450, 422, 446, 426, 450, 420, 446, 424, 442, 428, 448, 422, 444, 426, 450, 420, 446, 426, 452, 1292, 506, 366, 450, 422, 446, 426, 452, 420, 446, 424, 452, 418, 448, 422, 444, 1298, 498, 1246, 500, 1244, 502, 370, 446, 426, 450, 1292, 504, 366, 448, 424, 444, 428, 450, 422, 444, 426, 450, 420, 446, 424, 442, 428, 450, 422, 444, 426, 450, 420, 446, 426, 452, 1290, 506, 1236, 498, 1246, 500, 372, 452, 1290, 496, 1248, 498, 374, 452, 418, 448, 1296, 500, 370, 446, 1298, 498, 372, 452, 420, 448, 1294, 502, 1242, 504, 368, 448, 424, 454, 1290, 496, 1246, 498, 374, 452, 420, 446, 1296, 450, 420, 446, 1298, 448, 424, 452}; // UNKNOWN 1FB51F79

Timestamp : 057516.059
Encoding : UNKNOWN
Code : 1FB51F79 (132 bits)
Library : v2.5.1

uint16_t rawData[263] = {3498, 1732, 498, 372, 504, 1266, 480, 364, 502, 370, 446, 426, 452, 420, 448, 424, 454, 418, 448, 422, 446, 426, 450, 420, 446, 426, 452, 420, 448, 1294, 502, 370, 498, 374, 450, 420, 446, 424, 452, 418, 448, 422, 444, 426, 450, 1292, 504, 1238, 506, 1236, 498, 374, 502, 368, 446, 1324, 472, 372, 496, 376, 450, 422, 446, 426, 452, 420, 448, 424, 444, 428, 450, 422, 444, 428, 450, 420, 446, 426, 452, 418, 448, 424, 444, 428, 450, 422, 446, 426, 450, 420, 446, 424, 442, 428, 448, 422, 444, 426, 452, 420, 446, 426, 452, 420, 448, 424, 444, 428, 448, 422, 446, 426, 452, 420, 448, 424, 442, 1300, 496, 1246, 498, 374, 504, 368, 448, 422, 444, 426, 450, 422, 446, 10022, 3498, 1734, 496, 374, 452, 1292, 504, 366, 448, 422, 444, 426, 450, 420, 446, 426, 450, 420, 446, 424, 442, 428, 448, 422, 444, 428, 450, 422, 446, 1296, 500, 372, 444, 428, 450, 422, 446, 426, 450, 420, 446, 424, 452, 420, 448, 1294, 502, 1242, 504, 1240, 506, 366, 450, 422, 444, 1298, 498, 372, 452, 418, 450, 422, 444, 426, 450, 420, 446, 426, 452, 420, 446, 424, 442, 428, 448, 422, 444, 426, 450, 420, 446, 1296, 500, 1242, 502, 1242, 504, 368, 446, 1296, 500, 1242, 502, 370, 446, 426, 452, 1290, 506, 366, 450, 1294, 502, 368, 446, 424, 452, 1290, 496, 1248, 498, 374, 452, 420, 446, 1296, 502, 1242, 502, 368, 446, 424, 454, 1290, 444, 426, 450, 1292, 452, 418, 448}; // UNKNOWN 1FB51F79

@MikkelTb
Copy link
Author

MikkelTb commented Oct 5, 2018

      OLD 😖 I got the system in 2008, and it was brand new.... but yes the date is 2003...

I will try to solved/test the Byte 14/state[13] on my AC.
And thanks for you work 👍

😖 It look lik the "Powerful" and "Quiet" button, is turn arround in the protocol for my unit.

The First 2 is actual the "Powerful" i turn On and then Off
The secund 2 is actual the "Quiet" i turn On and then Off

Timestamp : 057734.383
Encoding : PANASONIC_AC
Code : 0220E004000000060220E004004E2E80AF00000EE01100010006B7 (216 bits)
Mesg Desc.: Model: 3 (DKE), Power: Off, Mode: 4 (HEAT), Temp: 23C, Fan: 7 (AUTO), Swing (Vertical): 15 (AUTO), Swing (Horizontal): 0 (Not in use), Quiet: On, Powerful: Off, Clock: 0:00, On Timer: 0:00, Off Timer: 0:00
Library : v2.5.1

uint8_t state[27] = {0x02, 0x20, 0xE0, 0x04, 0x00, 0x00, 0x00, 0x06, 0x02, 0x20, 0xE0, 0x04, 0x00, 0x4E, 0x2E, 0x80, 0xAF, 0x00, 0x00, 0x0E, 0xE0, 0x11, 0x00, 0x01, 0x00, 0x06, 0xB7};

Timestamp : 057736.707
Encoding : PANASONIC_AC
Code : 0220E004000000060220E004004E2E80AF00000EE01000010006B6 (216 bits)
Mesg Desc.: Model: 3 (DKE), Power: Off, Mode: 4 (HEAT), Temp: 23C, Fan: 7 (AUTO), Swing (Vertical): 15 (AUTO), Swing (Horizontal): 0 (Not in use), Quiet: Off, Powerful: Off, Clock: 0:00, On Timer: 0:00, Off Timer: 0:00
Library : v2.5.1

uint8_t state[27] = {0x02, 0x20, 0xE0, 0x04, 0x00, 0x00, 0x00, 0x06, 0x02, 0x20, 0xE0, 0x04, 0x00, 0x4E, 0x2E, 0x80, 0xAF, 0x00, 0x00, 0x0E, 0xE0, 0x10, 0x00, 0x01, 0x00, 0x06, 0xB6};

Timestamp : 057750.486
Encoding : PANASONIC_AC
Code : 0220E004000000060220E004004E2E80AF00000EE03000010006D6 (216 bits)
Mesg Desc.: Model: 3 (DKE), Power: Off, Mode: 4 (HEAT), Temp: 23C, Fan: 7 (AUTO), Swing (Vertical): 15 (AUTO), Swing (Horizontal): 0 (Not in use), Quiet: Off, Powerful: On, Clock: 0:00, On Timer: 0:00, Off Timer: 0:00
Library : v2.5.1

uint8_t state[27] = {0x02, 0x20, 0xE0, 0x04, 0x00, 0x00, 0x00, 0x06, 0x02, 0x20, 0xE0, 0x04, 0x00, 0x4E, 0x2E, 0x80, 0xAF, 0x00, 0x00, 0x0E, 0xE0, 0x30, 0x00, 0x01, 0x00, 0x06, 0xD6};

Timestamp : 057752.756
Encoding : PANASONIC_AC
Code : 0220E004000000060220E004004E2E80AF00000EE01000010006B6 (216 bits)
Mesg Desc.: Model: 3 (DKE), Power: Off, Mode: 4 (HEAT), Temp: 23C, Fan: 7 (AUTO), Swing (Vertical): 15 (AUTO), Swing (Horizontal): 0 (Not in use), Quiet: Off, Powerful: Off, Clock: 0:00, On Timer: 0:00, Off Timer: 0:00
Library : v2.5.1

uint8_t state[27] = {0x02, 0x20, 0xE0, 0x04, 0x00, 0x00, 0x00, 0x06, 0x02, 0x20, 0xE0, 0x04, 0x00, 0x4E, 0x2E, 0x80, 0xAF, 0x00, 0x00, 0x0E, 0xE0, 0x10, 0x00, 0x01, 0x00, 0x06, 0xB6};

@crankyoldgit
Copy link
Owner

Hey @MikkelTb Thanks for the data/feedback etc. I'm currently travelling so it will take me a while to look into this properly. Sorry for the delay(s).

@MikkelTb
Copy link
Author

MikkelTb commented Oct 7, 2018

@crankyoldgit

Thats okay, I still do some investigations on the protocol.

@MikkelTb
Copy link
Author

MikkelTb commented Oct 11, 2018

HI.

I have done two small modification to the "ir_Panasonic.h", and now it Work with my AC

The first one is swop Quiet, and Powerfull
//const uint8_t kPanasonicAcQuiet = 1; // 0b1
//const uint8_t kPanasonicAcPowerful = 0x20; // 0b100000

const uint8_t kPanasonicAcPowerful = 1; // 0b1
const uint8_t kPanasonicAcQuiet = 0x20; // 0b100000

The nest is change State[21] in the "kPanasonicKnownGoodState" from "0x00" to "0x10"
//const uint8_t kPanasonicKnownGoodState[kPanasonicAcStateLength] = {
// 0x02, 0x20, 0xE0, 0x04, 0x00, 0x00, 0x00, 0x06,
// 0x02, 0x20, 0xE0, 0x04, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00,
// 0x00, 0x0E, 0xE0, 0x00, 0x00, 0x81, 0x00, 0x00, 0x00};

const uint8_t kPanasonicKnownGoodState[kPanasonicAcStateLength] = {
0x02, 0x20, 0xE0, 0x04, 0x00, 0x00, 0x00, 0x06,
0x02, 0x20, 0xE0, 0x04, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00,
0x00, 0x0E, 0xE0, 0x10, 0x00, 0x81, 0x00, 0x00, 0x00};

I can turn it On, and Off now, and the State data look lige the remote control.

@crankyoldgit
Copy link
Owner

crankyoldgit commented Oct 11, 2018

Excellent. I'm still travelling, so my access to do development stuff is limited. I'll try to formulate a proper patch/system to handle this model. Your data above is fantastic to help with that. Kudos for that.

crankyoldgit added a commit that referenced this issue Oct 11, 2018
- Clock, On Timer, & Off Timer methods for the IRPanasonicAc class.
- Unit tests for those.
- Change SetSwingV() -> SetSwingVertical()
- Change SetSwingH() -> SetSwingHorizontal()

Ref: #544
crankyoldgit added a commit that referenced this issue Oct 11, 2018
* CKP series have Powerful and Quiet bits swapped
* Unit tests based on actual data from a CKP unit.
* Detect and set model info for CKP units.

For #544
@crankyoldgit
Copy link
Owner

@MikkelTb Can you please try out the code in the https://github.com/markszabo/IRremoteESP8266/tree/panasonic_ckp branch?

It should add support for you CKP series unit.
FYI, if you're constructing via the IRPanasonicAc class you'll need to choose your model type via setModel(kPanasonicCkp); and you'll need to do that before you make any setPowerful()/setQuiet() changes.

crankyoldgit added a commit that referenced this issue Oct 11, 2018
Panasonic A/C messages have a 16 byte/128 bit short state for
some special IR remote messages.

Ref: #540 & #544
@MikkelTb
Copy link
Author

MikkelTb commented Oct 13, 2018

Hi.

Great job you have done.

I have done one small change to you program

i have replace "&" with "==", now the program show the right Model.
if (remote_state[21] == 0x10)

panasonic_ac_remote_model_t IRPanasonicAc::getModel() {
if (remote_state[17] == 0x00) {
if (remote_state[23] & 0x80)
return kPanasonicJke;
if (remote_state[21] == 0x10)
return kPanasonicCkp;
}
if (remote_state[17] == 0x06 && (remote_state[13] & 0x0F) == 0x02)
return kPanasonicLke;
if (remote_state[23] == 0x01)
return kPanasonicDke;
if (remote_state[17] == 0x06)
return kPanasonicNke;
return kPanasonicUnknown;
}

One ting i discover, the Power "On" and "Off" is working diffrent on the Ckp Model.

The unit toggel the power On/Off when it get the Power On command.

I can se on the remote control, if i change any other "Function" like temperature/fan/swing and so on, the Power state is "Off".

The remote control does not know what state the AC unit is in. If i change the temperature, it send the change but with the "Power off". for that reason, it will only change the temperatur, and not change the "Power State"

In the code the swing is mentioned as "Vertical" for this unit.
The Ckp model is Diffrent from other units, the "Horizontal" and "Vertical" is swop, and it only have a "Horizontal" swing.

i stille testing, and it looks great.

@MikkelTb
Copy link
Author

Hi Again

I have testede the Fan, and swing (Vertical), timer on/off, Temperatur, Powerfull and quiet.
Everything is working, on the Ckp unit.

@MikkelTb
Copy link
Author

Hi.

The unit i have testede it on is:
AC -> CS-ME14CKPG
AC -> CS-ME12CKPG
AC -> CS-ME10CKPG
Remote -> A75C2311 (same type of remote for alle 3)

The Number (10,12 and 14) is the model and the diffrent is how mush power (heet/cool) the unit can provide to the air

@crankyoldgit
Copy link
Owner

@MikkelTb Thanks for that feedback. Appreciated.
As for the remote_state[21] == 0x10 vs. remote_state[21] & 0x10 bit. It needs to be the latter as remote_state[21] is changed by the swing states. i.e. If the swing is set to on, then it won't equal 0x10;
Can you provide me with copies of the state[] lines for the ones that are decoding to a different (non-CKP) model for you? I'll then see what I can do to improve detection.

Regarding the "power on" control etc., I'm a little confused, so I'll try to explain back to you what I think I understand and you can correct/update me where needed.

(All of this is assuming data from the normal original remote and just for the CKP model. i.e. NOT sending via the ESP)

  • For normal changes (e.g. temp, mode, swing, etc) the Power is read as "Off", even if the A/C unit is still running after receiving the command.
  • All the state[]s for the above line's operation changes are 27 bytes long.
  • Some special mode buttons state[]s are 16 bytes long. e.g. Odour Wash.
  • Similar to previously discussed/fixed Powerful & Quiet modes, the horizontal and vertical swing settings (setting and reporting) are swapped too. [Correct?]
  • There is no horizontal swing mode for the unit. [which currently is reported as vertical, correct?]

This leads me to some questions:

  • Is there a special (short) "Power On" message when you toggle the power button on the remote? or does the ESP just report the normal state[27] but decoded as "Power: On"?
  • Does it matter to the A/C unit when the ESP sends a command to the A/C unit to change a mode (temp, mode, fan speed, etc) if the setPower(true); is set? i.e. The ESP would detect the state as "Power: On", and the A/C unit would still a) Keep running, or start if it was previously off, and b) change to what ever else desired modes are requested?
    e.g.
// Assuming the A/C unit is already running in Heat mode at 30C, and fan speed of minimum before this is sent.
IRPanasonicAc pana(IR_LED_PIN_YOU_ARE_USING);
pana.setPower(true);
pana.setMode(kPanasonicAcCool);
pana.setTemp(21);
pana.setFan(kPanasonicAcFanMax);
pana.send();
// A/C unit should now be still on/working, but in Cool mode, at 21C and at max fan speed.

@MikkelTb
Copy link
Author

@crankyoldgit

[Yes] - For normal changes (e.g. temp, mode, swing, etc) the Power is read as "Off", even if the A/C unit is still running after receiving the command.
[Yes] - All the state[]s for the above line's operation changes are 27 bytes long.
[Yes] - Some special mode buttons state[]s are 16 bytes long. e.g. Odour Wash. and "Add 1h delay off"

SORRY my mistake i can see in the code that Vertical is up and Down, and that is what there is on my AC unit
[No] - Similar to previously discussed/fixed Powerful & Quiet modes, the horizontal and vertical swing settings (setting and reporting) are swapped too. [Correct?]
[No] - There is no horizontal swing mode for the unit. [which currently is reported as vertical, correct?]

[Yes] -Powerful & Quiet modes is swapped, and Work as it shold, in the latest version you made.


Every time the the AC get the setPower(true); the unit will toggel the State, If it was on, it will turn off, and if it was Off, it will turn On.

I do not think you have to change anytning in the code.
setPower(true); refers for this unit Toggle the Power On/Off
setPower(False); Refers for this unit all other function can be change, without change the Power state

@crankyoldgit
Copy link
Owner

Ah. Okay. Cool. I now think I understand the power setting thing. Thanks for clarifying that. I'll add a note in the code for that and leave it alone, or do something fancy. I'll figure something out. :-)

@MikkelTb
Copy link
Author

That sounds great. And thanks for implement the other stuff 👍

@crankyoldgit
Copy link
Owner

@MikkelTb
From before:
Can you provide me with copies of the state[] lines for the ones that are decoding to a different (non-CKP) model for you? I'll then see what I can do to improve detection.

@MikkelTb
Copy link
Author

@crankyoldgit

Unfortunately I do not have a another type of Panasonic AC.

So I will not be able to provide you with that kind of information.

@crankyoldgit
Copy link
Owner

@MikkelTb I was referring to your comment earlier of: "i have replace "&" with "==", now the program show the right Model."

i.e. Can you give me a copy of a state[] line where the model was being reported incorrectly before?

@MikkelTb
Copy link
Author

data from the software
IRrecvDumpV2 is now running and waiting for IR input on Pin 14
Default state of the remote.
Panasonic A/C remote is in the following state:
Mesg Desc.: Model: 4, Power: 0, Mode: 0, Temp: 0C, Fan Speed: 253, Swing (Vertical): 0, Quiet: 0, Powerful: 0, Time: 0, Ontime: 0, OffTime: 0
IR Code: 0x0220E0040000000602
Setting desired state for A/C.
Panasonic A/C remote is in the following state:
Mesg Desc.: Model: 4, Power: 0, Mode: 6, Temp: 23C, Fan Speed: 7, Swing (Vertical): 15, Quiet: 0, Powerful: 0, Time: 1380, Ontime: 960, OffTime: 390
IR Code: 0x0220E0040000000602
I received: 49
stateon Send
Panasonic A/C remote is in the following state:
Mesg Desc.: Model: 4, Power: 1, Mode: 6, Temp: 23C, Fan Speed: 7, Swing (Vertical): 15, Quiet: 0, Powerful: 0, Time: 1380, Ontime: 960, OffTime: 390
IR Code: 0x0220E0040000000602
Timestamp : 000044.671
Encoding : PANASONIC_AC
Code : 0220E004000000060220E00400672E80AF00C06B98100081640587 (216 bits)
Mesg Desc.: Model: 4 (JKE), Power: On, Mode: 6 (FAN), Temp: 23C, Fan: 7 (AUTO), Swing (Vertical): 15 (AUTO), Quiet: Off, Powerful: Off, Clock: 23:00, On Timer: 16:00, Off Timer: 6:30
Library : v2.5.1
uint8_t state[27] = {0x02, 0x20, 0xE0, 0x04, 0x00, 0x00, 0x00, 0x06, 0x02, 0x20, 0xE0, 0x04, 0x00, 0x67, 0x2E, 0x80, 0xAF, 0x00, 0xC0, 0x6B, 0x98, 0x10, 0x00, 0x81, 0x64, 0x05, 0x87};

(Data from my Remote control)
Timestamp : 000050.304
Encoding : PANASONIC_AC
Code : 0220E004000000060220E004004F2C80AF00000EE01000010006B5 (216 bits)
Mesg Desc.: Model: 5 (CKP), Power: On, Mode: 4 (HEAT), Temp: 22C, Fan: 7 (AUTO), Swing (Vertical): 15 (AUTO), Quiet: Off, Powerful: Off, Clock: 0:00, On Timer: 0:00, Off Timer: 0:00
Library : v2.5.1
uint8_t state[27] = {0x02, 0x20, 0xE0, 0x04, 0x00, 0x00, 0x00, 0x06, 0x02, 0x20, 0xE0, 0x04, 0x00, 0x4F, 0x2C, 0x80, 0xAF, 0x00, 0x00, 0x0E, 0xE0, 0x10, 0x00, 0x01, 0x00, 0x06, 0xB5};

@MikkelTb
Copy link
Author

I did two modifinication before i got the right model:

    case kPanasonicCkp:
	remote_state[23] = 0x01;
        remote_state[21] |= 0x10;
    default:
      break;

And

if (remote_state[21] == 0x10)
      return kPanasonicCkp;

crankyoldgit added a commit that referenced this issue Oct 14, 2018
* Support for short Panasonic A/C messages.
Panasonic A/C messages have a 16 byte/128 bit short state for
some special IR remote messages.
* Only report text for full panasonic A/C messages.

Ref: #540 & #544
crankyoldgit added a commit that referenced this issue Oct 14, 2018
@MikkelTb pointed out detection for some CKP states
was not working as expected.
Ref:
#544 (comment)
crankyoldgit added a commit that referenced this issue Oct 14, 2018
* CKP series have Powerful and Quiet bits swapped
* Unit tests based on actual data from a CKP unit.
* Detect and set model info for CKP units.

For #544
crankyoldgit added a commit that referenced this issue Oct 14, 2018
@MikkelTb pointed out detection for some CKP states
was not working as expected.
Ref:
#544 (comment)
@crankyoldgit
Copy link
Owner

@MikkelTb Thanks for that info. That's helped me try to narrow it down some more.
I've updated the branch: https://github.com/markszabo/IRremoteESP8266/tree/panasonic_ckp and created a PR (#554) for it.

Hopefully, it should now detect better for you. Let me know how it goes.

@MikkelTb
Copy link
Author

Hi @crankyoldgit

I will try it tomorrow. I have look in the code and it looks great 👍

@MikkelTb
Copy link
Author

I close this one, as the new program update, handle this function now.

And thanks to everybody, for helping with this, and special @crankyoldgit 👍

crankyoldgit added a commit that referenced this issue Oct 15, 2018
* Add support for Panasonic CKP series A/Cs.
* CKP series have Powerful and Quiet bits swapped
* Unit tests based on actual data from a CKP unit.
* Detect and set model info for CKP units.
* Make it clear how setPower() works on CKP devices.
Ref: #544
@crankyoldgit
Copy link
Owner

This is now live in the new v2.5.2 release of the library.

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

No branches or pull requests

3 participants