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

Cooper&Hunter Protocol based on Gree #1508

Closed
k-korn opened this issue Jun 26, 2021 · 8 comments · Fixed by #1509
Closed

Cooper&Hunter Protocol based on Gree #1508

k-korn opened this issue Jun 26, 2021 · 8 comments · Fixed by #1509
Assignees

Comments

@k-korn
Copy link

k-korn commented Jun 26, 2021

Version/revision of the library used

2.7.18

Intro

The hardware is as follows:

  • esp-01+TSSOP+IR Leds device to send/receive IR signals, managed over MQTT.
  • Couple of other home appliances perfectly accepting commands from IRremoteESP8266
  • Saleae Logic Analyzer to see what happens after IR receiver
  • Cooper&Hunter AC, not currently controllable with this library.

Previous Works

As mentioned in #602, some other software had success in controlling C&H with Gree protocol, so I have tried comparing signals sent by this library on Gree protocol with what is actually sent by C&H remote, and binary protocol indeed matches.

Timings, however, are slightly different - inter-message space is 19980ms instead of 19000ms for C&H, for example.
So "as is" Gree protocol does not work

Raw Data

I've attached a dump of actual C&H remote signals in Saleae Logic format (viewable with https://www.saleae.com/downloads/, no actual hardware needed to view):
c_h-examples.zip

The Suggestion

Cooper&Hunter AC can be controlled if we replace constants in https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Gree.cpp#L22 with the following:

const uint16_t kGreeHdrMark = 9000;
const uint16_t kGreeHdrSpace = 4500;
const uint16_t kGreeBitMark = 620;
const uint16_t kGreeOneSpace = 1670;
const uint16_t kGreeZeroSpace = 570;
const uint16_t kGreeMsgSpace = 19980;

(most significant change is kGreeMsgSpace)

The Issue

However, I am unsure how to properly add new AC protocol to the library with proper detection, etc - so this is not a pull request, but an issue instead.
Gree protocol with the changes outlined above works perfectly for me controlling C&H air conditioner - so it may be helpful to others with similar hardware.

@NiKiZe
Copy link
Collaborator

NiKiZe commented Jun 26, 2021

We really like to have the "rawData" that you get with IRrecvDumpV2+.
Also verify what receiver you actually have, as stated in FAQ and issue template.

Please give full brand and model of both unit and remote.

@k-korn
Copy link
Author

k-korn commented Jun 26, 2021

We really like to have the "rawData" that you get with IRrecvDumpV2+.

My hardware (esp-01) makes it difficult to have both serial console and IR receiver to be available simultaneously, but I'll try to obtain that data.
Here are some decoded binary messages (32bit first half + spacer + 32bit second half): ch-dumps.txt

Also verify what receiver you actually have, as stated in FAQ and issue template.

Please give full brand and model of both unit and remote.

Remote: YB1F2 (Google search even shows it's Gree branded, but my has C&H logo on it)
Unit: CH-S09FTXG

@crankyoldgit
Copy link
Owner

FYI, try the Kelvinator protocol, it is very similar to the Gree protocol, and has the 20ms gap as you're describing.

@k-korn
Copy link
Author

k-korn commented Jun 26, 2021

FYI, try the Kelvinator protocol, it is very similar to the Gree protocol, and has the 20ms gap as you're describing.

It is indeed similar in timings, and even works on basic level (on/off, set temps, etc).
However, actual features (number of fan modes, overall message length of 8 bytes and not 16, etc),
in Cooper&Hunter look more similar to
https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Gree.h#L36
than to
https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/ir_Kelvinator.h#L37

@crankyoldgit
Copy link
Owner

Remote: YB1F2 (Google search even shows it's Gree branded, but my has C&H logo on it)
Unit: CH-S09FTXG

Thanks for that. I've added it to the supported list.

Timings, however, are slightly different - inter-message space is 19980ms instead of 19000ms for C&H, for example.
So "as is" Gree protocol does not work

I've reviewed previous data we have, and your word on your data, and my personal experience with the Kelvinator protocol which overlaps a lot with the Gree Protocol, and it lines up. It looks like the value should be closer to 20ms (19980us) so I've created a branch with it updated: https://github.com/crankyoldgit/IRremoteESP8266/tree/Issue1508 / PR #1509

Can you please download it, try it out, & let us know how it goes?

@crankyoldgit crankyoldgit self-assigned this Jun 26, 2021
@crankyoldgit crankyoldgit added enhancement Pending Confirmation Waiting for confirmation from user labels Jun 26, 2021
@k-korn
Copy link
Author

k-korn commented Jun 26, 2021

I've reviewed previous data we have, and your word on your data, and my personal experience with the Kelvinator protocol which overlaps a lot with the Gree Protocol, and it lines up. It looks like the value should be closer to 20ms (19980us) so I've created a branch with it updated: https://github.com/crankyoldgit/IRremoteESP8266/tree/Issue1508 / PR #1509

Can you please download it, try it out, & let us know how it goes?

Yes, that works perfectly.
So the one actual change needed is indeed kGreeMsgSpace=19000 to 19980

@crankyoldgit
Copy link
Owner

Thanks for confirming.

@crankyoldgit crankyoldgit removed the Pending Confirmation Waiting for confirmation from user label Jun 26, 2021
crankyoldgit added a commit that referenced this issue Jun 26, 2021
crankyoldgit added a commit that referenced this issue Jul 6, 2021
_v2.7.19 (20210706)_

**[Bug Fixes]**
- Illegal Heap write in rawbuf when the capture has overflowed. (#1516 #1517)
- PANASONIC_AC: Fix Low and High fan speeds (#1515)
- Fix MDNS in IRServer and IRMQTTServer example code (#1498 #1499)
- IRac: Fix off-by-one error in Coolix's sleep setting. (#1500)
- Fix undefined constant (#1490)

**[Features]**
- Add detailed support for Kelon ACs (#1494)
- Experimental basic support for Teknopoint A/C protocol (#1486 #1504)
- Daikin64: Add support for Heat mode (#1492)
- Basic support for `HAIER_AC176` 176 bit protocol. (#1480 #1481)

**[Misc]**
- GREE: Update inter-message gap timing (#1508 #1509)
- IRac: Change Coolix to send special messages after a normal message. (#1501 #1502)
- Fix compiler warnings causing Travis failures. (#1491)
- Update supported model info (#1477 #1485 #1488 #1489)
- Add HTML viewport meta tag to IRServer and IRMQTTServer examples (#1467 #1469)
crankyoldgit added a commit that referenced this issue Jul 6, 2021
* Regenerate Doxygen documentation

* v2.7.19 release
_v2.7.19 (20210706)_

**[Bug Fixes]**
- Illegal Heap write in rawbuf when the capture has overflowed. (#1516 #1517)
- PANASONIC_AC: Fix Low and High fan speeds (#1515)
- Fix MDNS in IRServer and IRMQTTServer example code (#1498 #1499)
- IRac: Fix off-by-one error in Coolix's sleep setting. (#1500)
- Fix undefined constant (#1490)

**[Features]**
- Add detailed support for Kelon ACs (#1494)
- Experimental basic support for Teknopoint A/C protocol (#1486 #1504)
- Daikin64: Add support for Heat mode (#1492)
- Basic support for `HAIER_AC176` 176 bit protocol. (#1480 #1481)

**[Misc]**
- GREE: Update inter-message gap timing (#1508 #1509)
- IRac: Change Coolix to send special messages after a normal message. (#1501 #1502)
- Fix compiler warnings causing Travis failures. (#1491)
- Update supported model info (#1477 #1485 #1488 #1489)
- Add HTML viewport meta tag to IRServer and IRMQTTServer examples (#1467 #1469)
@crankyoldgit
Copy link
Owner

FYI, the committed & merged changes thus far have been included in the newly released version of the library. i.e. v2.7.19

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

Successfully merging a pull request may close this issue.

3 participants