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

Initial code to handle Hitachi A/C 13 & 53 byte codes. #461

Merged
merged 5 commits into from
May 20, 2018
Merged

Conversation

crankyoldgit
Copy link
Owner

HITACHI_AC1 is basically the same as HITACHI_AC except only 13 bytes long
and a Header Space that is the same length as the Header Mark.

Ref: #453

@crankyoldgit crankyoldgit self-assigned this May 14, 2018
@crankyoldgit crankyoldgit changed the title Initial code to handle Hitachi A/C 13 byte codes. Initial code to handle Hitachi A/C 13 & 53 byte codes. May 19, 2018
@crankyoldgit crankyoldgit requested a review from darshkpatel May 19, 2018 00:54
Copy link
Collaborator

@markszabo markszabo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One comment, otherwise LGTM :)

@@ -112,6 +112,7 @@ std::string typeToString(const decode_type_t protocol,
case GREE: result = "GREE"; break;
case HAIER_AC: result = "HAIER_AC"; break;
case HITACHI_AC: result = "HITACHI_AC"; break;
case HITACHI_AC1: result = "HITACHI_AC1"; break;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we also have a case HITACHI_AC2: result = "HITACHI_AC2"; here?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Totally. Excellent catch. Thanks.

Fixed plus found a few other subtle trivial omissions. e.g. code that should be included via #defines etc.

PTAL

HITACHI_AC1 is basically the same as HITACHI_AC except only 13 bytes long
and a Header Space that is the same length as the Header Mark.

Ref: #453
This should add basic support for another variant of Hitachi A/C protocol
per @darshkpatel capture in #417
* Refactor Hitachi A/C protocol support to share more common code.
* Unit tests for Hitachi 53 byte protocol.
* Minor code style cleanup.
* Relevant example code changes.
- Fix some code inclusion dependencies.
@crankyoldgit crankyoldgit merged commit 7f54c54 into master May 20, 2018
@crankyoldgit crankyoldgit mentioned this pull request May 20, 2018
crankyoldgit added a commit that referenced this pull request May 20, 2018
**[Bug Fixes]**
- Fix crash in IRMQTTServer when compiled under Arduino IDE. (#455)
- Default bit length not set for RCMM in IRMQTTServer example. (#456)
- Bad acknowledgements for some A/C protocols in IRMQTTServer example. (#460)

**[Features]**
- Allow disabling the use of delay() calls. (#450)
- Initial support for G.I. Cable protocol. (#458)
- Support of Hitachi A/C 13 & 53 byte messages. (#461)

**[Misc]**
- Auto Analyse Raw Data script converted to Python. (#454)
@crankyoldgit crankyoldgit deleted the hitachi1 branch June 1, 2018 13:42
@arpitshah87
Copy link

arpitshah87 commented Jan 1, 2020

Hi crankyoldgit,
I am having the same issue mentioned in #461 . I used latest version of library 2.7.1.
Here is my code I used for my Hitachi Series VI AC but did not work.

#include <Arduino.h>
#include <IRremoteESP8266.h>
#include <IRsend.h>
#include <ir_Hitachi.h>

const uint16_t kIrLed = 4; // ESP8266 GPIO pin to use. Recommended: 4 (D2).
IRHitachiAc ac(kIrLed); // Set the GPIO to be used to sending the message

void setup() {
ac.begin();
Serial.begin(115200);
}

void loop() {
Serial.println("Sending...");

// Set up what we want to send. See ir_Daikin.cpp for all the options.
ac.on();
ac.setFan(kHitachiAcFanAuto);
ac.setMode(kHitachiAcAuto);
ac.setTemp(24);
ac.setSwingVertical(false);
// Display what we are going to send.
Serial.println(ac.toString());

// Now send the IR signal.
ac.send();

unsigned char* ir_code = ac.getRaw();
Serial.print("IR Code: 0x");
for (uint8_t i = 0; i < kHitachiAc1StateLength; i++)
Serial.printf("%02X", ir_code[i]);
Serial.println();

delay(5000);
}

Am I missing any settings?
Appreciate your help....

@crankyoldgit
Copy link
Owner Author

crankyoldgit commented Jan 2, 2020

@arpitshah87 FYI, Please create a new issue via https://github.com/crankyoldgit/IRremoteESP8266/issues/new Don't append to an existing (old) pull request unless there was a problem in it. :-)

I'm going to need more information before I can help you. e.g. What's the output from IRrecvDumpV2 for your remote/AC unit?

Also, note that only HITACHI_AC and HITACHI_AC424 protocols have an "ac" class to support them. (That is, the have the ability to set attributes.) HITACHI_AC1 & HITACHI_AC2 do not as yet.

@arpitshah87
Copy link

@crankyoldgit , I am getting the following output.
Protocol : HITACHI_AC1
Code : 0xB2AE4D91F028B80000000020E8 (104 Bits)
uint16_t rawData[211] = {3410, 3342, 430, 1246, 454, 396, 454, 1218, 454, 1220, 454, 396, 454, 394, 482, 1190, 454, 396, 454, 1218, 454, 398, 454, 1218, 454, 396, 456, 1216, 454, 1246, 454, 1220, 454, 396, 454, 394, 482, 1192, 454, 396, 454, 368, 480, 1218, 454, 1220, 454, 396, 454, 1218, 454, 1246, 454, 370, 454, 394, 480, 1218, 428, 396, 454, 396, 480, 368, 456, 1216, 454, 1220, 454, 1246, 454, 1218, 454, 1246, 428, 396, 454, 394, 480, 368, 480, 342, 482, 368, 480, 370, 480, 1192, 454, 396, 454, 1218, 454, 396, 454, 396, 454, 368, 480, 1218, 454, 370, 456, 1244, 454, 1220, 452, 1246, 428, 396, 454, 394, 480, 370, 480, 342, 482, 368, 480, 368, 480, 342, 482, 368, 480, 368, 480, 368, 456, 368, 480, 370, 480, 370, 478, 342, 482, 368, 480, 368, 480, 342, 480, 370, 480, 370, 480, 370, 456, 368, 480, 370, 480, 370, 456, 368, 480, 370, 480, 370, 480, 342, 480, 370, 480, 370, 478, 344, 480, 370, 478, 370, 480, 370, 454, 368, 480, 370, 478, 370, 478, 344, 480, 1220, 452, 370, 454, 396, 476, 374, 456, 394, 456, 368, 478, 1220, 428, 1246, 454, 1218, 454, 398, 454, 1244, 428, 396, 454, 396, 454, 394, 454}; // HITACHI_AC1
uint8_t state[13] = {0xB2, 0xAE, 0x4D, 0x91, 0xF0, 0x28, 0xB8, 0x00, 0x00, 0x00, 0x00, 0x20, 0xE8};

Thanks for your reply I will wait for the "ac" class of HITACHI_AC1.

@crankyoldgit
Copy link
Owner Author

You could be waiting a while. Have a read of https://github.com/crankyoldgit/IRremoteESP8266/wiki/Adding-support-for-a-new-AC-protocol to see how you could speed that along. ;-)

Repository owner locked as off-topic and limited conversation to collaborators Jan 2, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants