-
Notifications
You must be signed in to change notification settings - Fork 836
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
Can help join HITACHI RAR-2P2 remote (264 bit) #1729
Comments
Do you have at least one Raw dump using |
Hello, |
Please post the raw dump in the issue as text from at least one of the commands. |
attached the raw dump hot/power off/ fan 1 /27°C**
this is what I identified State 25 et 26 :mode et FAN FAN Auto : 5A state 27 et 28 : ON ou OFF |
* Add send (`sendHitachiAc264()`) & decode support. * Add unit tests coverage including real world data. * Fix up some typos. * Minor refactor of some code. For #1729
I've added "basic" support for the protocol in PR #1730 / Branch: https://github.com/crankyoldgit/IRremoteESP8266/tree/rar-2p2 Please download that, test it works (both sending & decoding please), and base your analysis on those results in your spreadsheet/documentation. It should be 33 bytes in LSB order now. |
here are the results with IRrecvDumpV3 Timestamp : 002824.971 https://docs.google.com/spreadsheets/d/1qDnKM3ZslWrR-skgQjaConq3U2b7RuzZK1tA64WYRBM/edit?usp=sharing |
Looks good so far. |
Yes i am tested with the program CommonAcControl, the console bip when sending hitachi344 message but she does not start. |
You can't use the "common" IRac stuff yet for this protocol. You'll need to use the more basic IR send example code. |
I am tested with IRsenddemo to modify and the console start. |
Excellent. Thanks for confirming. I'll merge that PR |
thank you. |
* Add send (`sendHitachiAc264()`) & decode support. * Add unit tests coverage including real world data. * Fix up some typos. * Minor refactor of some code. For #1729
Ok, you're now at this stage: https://github.com/crankyoldgit/IRremoteESP8266/wiki/Adding-support-for-a-new-AC-protocol#working-out-the-details We have already established the bit ordering and the checksum (i.e. every second byte after So, you need to analyse which bit(s) is critical to power etc. eg. You need to do that sort of documentation for all the controls you want supported. When you have that all done, let me know and I'll write the code for it. Bonus points if you can document it like: IRremoteESP8266/src/ir_Hitachi.h Lines 177 to 213 in 93af543
|
hello, this is what I defined is it suitable // / Représentation native d'un message A/C Hitachi 264 bits.
union HitachiAC264Protocole{
uint8_t raw[ kHitachiAc264StateLength ] ; // /< L'état dans le code natif.
structure {
struct {
// Byte 0~10
uint8_t pad0[11];
// Byte 11
uint8_t Button :8;
// Byte 12
uint8_t :8;
// Byte 13
uint8_t :2;
uint8_t Temp :6;
// Byte 14
uint8_t :8;
// Byte 14~24
uint8_t pad1[10];
// Byte 25
uint8_t Mode :4;
uint8_t Fan :4;
// Byte 26
uint8_t :8;
// Byte 27
uint8_t Power :8;
// Byte 28
uint8_t :8;
// Byte 29~32
uint8_t pad2[4];
} ;
} ;
// HitachiAc264
const uint8_t kHitachiAc264ButtonPowerMode = 0x13;
const uint8_t kHitachiAc264ButtonFan = 0x42;
const uint8_t kHitachiAc264ButtonTempDown = 0x43;
const uint8_t kHitachiAc264ButtonTempUp = 0x44;
const uint8_t kHitachiAc264ButtonSwing = 0x81;
//Temp min max for Cool Hot Dry (Fan no T°)
const uint8_t kHitachiAc264MinTemp = 16; // 16C
const uint8_t kHitachiAc264MaxTemp = 32; // 32C
const uint8_t kHitachiAc264Fan = 1;
const uint8_t kHitachiAc264Cool = 3;
const uint8_t kHitachiAc264Dry = 5;
const uint8_t kHitachiAc264Heat = 6;
const uint8_t kHitachiAc264FanLow = 1;
const uint8_t kHitachiAc264FanMedium = 3;
const uint8_t kHitachiAc264FanHigh = 4;
const uint8_t kHitachiAc264FanAuto = 5;
const uint8_t kHitachiAc264FanDry = 1; //mode dry only speed low
const uint8_t kHitachiAc264FanLowfan = 1;// mode Fan no speed fan auto
const uint8_t kHitachiAc264FanMediumfan = 3;
const uint8_t kHitachiAc264FanHighfan = 4;
const uint8_t kHitachiAc264PowerOn = 0xD1;
const uint8_t kHitachiAc264PowerOff = 0xC1; |
Which location do these values go into? |
Why are these fan speeds the same? |
these values relate to byte 11 (button) |
const uint8_t kHitachiAc264FanLowfan = 1;// mode Fan no speed fan auto these 3 lines can be deleted and add that in FAN mode auto speed is not possible. |
When using multiple lines of code you need to use "```", not "`". |
* Supports Power, Temp, Mode, & Fanspeed. That's it. - Effectively a parent class of `IRHitachiAc424`. * Add `IRac` integration. * Update & add unit tests. Fixes #1729
Per #1729 (comment) This pretty much confirms `handleToggles()` isn't the problem.
@NiKiZe Just extended the test to verify |
@step3528 Can you please include a copy of the "info" page on IRMQTTServer too please, after you've tried to turn it off via the Web Interface? It might give some useful info. :-/ |
I did not modify the file
General MQTT Information Climate Information I must have a problem at home because I tried with LG and IRrecvDumpV3.ino detected ON |
This (and some other debugging) pretty much confirms the core library is doing what we hope/expect. The problem pretty much has to be a bug in IRMQTTServer or a user-side problem. For #1729
@step3528 I'm really stumped. I've tested everything I can think of in the library itself. It all appears to be working as expected, and producing the correct hex/state codes. I'm going to try hair-brained hail-mary suggestions/solutions now. Can you delete the library code you have on your computer. Download the latest copy from that branch, and build @NiKiZe Basically the only things left to verify are: |
Sorry @crankyoldgit I have trouble expressing myself. I have the same problem with LG. I will reinstall IRMQTTServer. |
Ahhhh. That's helpful info. i.e. LG being broken too. That gives me something to work on. |
Add a test for the IRMQTTServer path that creates the packet. maybe there is on/off issues that is not propagating from generic to specific AC classes? (sorry short on time ATM) |
@NiKiZe Yeah. I'm going to have to instrument IRMQTTServer more I think to debug what might be going on there. I temporarily added debug stuff to print Lines 1326 to 1345 in 56e48e2
In the following (new) test: IRremoteESP8266/test/ir_Hitachi_test.cpp Lines 2213 to 2232 in 56e48e2
it was working as expected. e.g.
So that leads me to think I'm doing something wrong in the |
So mode off is power off? |
yes, it sends the message off with cool mode Mesg Desc.: Power: Off, Mode: 3 (Cool), Temp: 25C, Fan: 5 (Auto), Button: 19 (Power/Mode)
yes power off has no action |
Ahhhh. That makes all the difference in pinpointing the issue. You need to change this parameter to IRremoteESP8266/examples/IRMQTTServer/IRMQTTServer.h Lines 138 to 152 in 030b403
i.e. #define MQTT_CLIMATE_HA_MODE false I'll look into fixing it (power doing what is expected via the web interface) in your scenario. That's sort of a bug. But now I know what is causing it at least. Phew!! |
* Supports Power, Temp, Mode, & Fan speed. That's it. - Effectively a parent class of `IRHitachiAc424`. * Add `IRac` integration. * Update & add unit tests. Fixes #1729
- Fix the case when `MQTT_CLIMATE_HA_MODE` is enabled & Home Assistant is NOT being used, and `power` is turned off via the http interface, that it also sets the `mode` to Off, and viceversa. Mode "Off" also sets Power "Off". - Move some literal strings to constants for consistency. - Helps with potential internationalisation. - Bump version patch number. Ref #1729 Fixes #1739
- Fix the case when `MQTT_CLIMATE_HA_MODE` is enabled & Home Assistant is NOT being used, and `power` is turned off via the http interface, that it also sets the `mode` to Off, and viceversa. Mode "Off" also sets Power "Off". - Move some literal strings to constants for consistency. - Helps with potential internationalisation. - Bump version patch number. Ref #1729 Fixes #1739
_v2.8.2 (20220314)_ **[Bug Fixes]** - ESP32-C3: Fix reboot/crashes on ESP32-C3s when receiving. (#1768 #1751) **[Features]** - HITACHI_AC296: Add `IRac` class support & tests. (#1776 #1758 #1757) - Support for Hitachi RAS-70YHA3 (remote RAR-3U3) (#1758 #1757) - LG: Add Swing Toggle support for Model `LG6711A20083V` (#1771 #1770) - IRMQTTServer: add `MQTT_SERVER_AUTODETECT_ENABLE` via mqtt mDNS (#1769) - Experimental basic support for Kelon 168 bit / 21 byte protocol. (#1747 #1745 #1744) - MitsubishiAC: Tweak repeat gap timing. (#1760 #1759) - Gree YAP0F8 (Detected as Kelvinator) vertical position set support (#1756) - Make KELON (48 bit) protocol decoding stricter. (#1746 #1744) - IRMQTTServer V1.6.1 (#1740 #1739 #1729) - HITACHI_AC264: Add minimal detailed support. (#1735 #1729) - LG2: Improve Light toggle msg handling. (#1738 #1737) - MIDEA: Add support for Quiet, Clean & Freeze Protect controls. (#1734 #1733) - Add basic support for HITACHI_AC264 264bit protocol. (#1730 #1729) - ESP32-C3: Work around for some C3 specific compiler issues again. (#1732 #1695) **[Misc]** - MIDEA: Update supported devices (#1774 #1773 #1716) - Update devices supported by ELECTRA_AC (#1766 #1765) - Improve documentation for `encodePioneer()` (#1761 #1749) - Update (un)supported DAIKIN128 devices. (#1752) - Refactor `decodeCOOLIX()` code & add another test case. (#1750 #1748) - Simplify code based on state_t being initialised by default. (#1736 #1699) - Add comments to help Teknopoint users. (#1731 #1728) - Fix library version string calculation. (#1727 #1725) - Confirm we can reproduce `TurnOnFujitsuAC.ino` via IRac/IRMQTTServer. (#1726 #1701)
##_v2.8.2 (20220314)_ **[Bug Fixes]** - ESP32-C3: Fix reboot/crashes on ESP32-C3s when receiving. (#1768 #1751) **[Features]** - HITACHI_AC296: Add `IRac` class support & tests. (#1776 #1758 #1757) - Support for Hitachi RAS-70YHA3 (remote RAR-3U3) (#1758 #1757) - LG: Add Swing Toggle support for Model `LG6711A20083V` (#1771 #1770) - IRMQTTServer: add `MQTT_SERVER_AUTODETECT_ENABLE` via mqtt mDNS (#1769) - Experimental basic support for Kelon 168 bit / 21 byte protocol. (#1747 #1745 #1744) - MitsubishiAC: Tweak repeat gap timing. (#1760 #1759) - Gree YAP0F8 (Detected as Kelvinator) vertical position set support (#1756) - Make KELON (48 bit) protocol decoding stricter. (#1746 #1744) - IRMQTTServer V1.6.1 (#1740 #1739 #1729) - HITACHI_AC264: Add minimal detailed support. (#1735 #1729) - LG2: Improve Light toggle msg handling. (#1738 #1737) - MIDEA: Add support for Quiet, Clean & Freeze Protect controls. (#1734 #1733) - Add basic support for HITACHI_AC264 264bit protocol. (#1730 #1729) - ESP32-C3: Work around for some C3 specific compiler issues again. (#1732 #1695) **[Misc]** - MIDEA: Update supported devices (#1774 #1773 #1716) - Update devices supported by ELECTRA_AC (#1766 #1765) - Improve documentation for `encodePioneer()` (#1761 #1749) - Update (un)supported DAIKIN128 devices. (#1752) - Refactor `decodeCOOLIX()` code & add another test case. (#1750 #1748) - Simplify code based on state_t being initialised by default. (#1736 #1699) - Add comments to help Teknopoint users. (#1731 #1728) - Fix library version string calculation. (#1727 #1725) - Confirm we can reproduce `TurnOnFujitsuAC.ino` via IRac/IRMQTTServer. (#1726 #1701)
FYI, the changes mentioned above have now been included in the new v2.8.2 release of the library. |
Hi guys.
esphome:
name: tuya-ir
platform: ESP8266
board: esp01_1m
includes:
- include/hitachi_ir.h
libraries:
- crankyoldgit/IRremoteESP8266@^2.8.2
platformio_options:
build_flags:
- -DSEND_HITACHI_AC264
- -DDEBUG_AC
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
logger:
api:
password: !secret esphome_api_password
ota:
password: !secret esphome_api_password
# Use the blue LED as a status light.
# Blink slowly = Temporary issue (WiFi/MQTT disconnected, sensor unavailable, ...)
# Blink quickly = Error encountered
status_led:
pin: GPIO4
# Configure the IR receiver. Handy to pickup confirmation messages
# from your AC (or capture commands from the actual remote)
remote_receiver:
pin:
number: GPIO5
inverted: true
mode:
input: true
pullup: true
# high 55% tolerance is recommended for some remote control units
tolerance: 55%
dump: raw # all or raw for my case
# Configure the IR LED: this one sends commands to other devices
remote_transmitter:
pin: GPIO14
carrier_duty_percent: 50%
# Configure the AC unit you have. Mine is a Hitachi.
switch:
- platform: template
name: Turn On A/C
turn_on_action:
- remote_transmitter.transmit_raw:
carrier_frequency: 38kHz
# Hitachi AC 24C FanLow SwingOff
code: [3442, -1657, 440, -1260, 440, -410, 439, -410, 464, -386, 440, -409, 440, -412, 438, -410, 440, -409, 467, -383, 444, -406, 466, -383, 441, -409, 465, -1235, 439, -410, 464, -386, 440, -410, 463, -387, 463, -385, 465, -385, 465, -385, 443, -407, 440, -410, 439, -410, 465, -384, 465, -385, 440, -410, 440, -410, 439, -411, 439, -410, 440, -410, 440, -1259, 441, -409, 440, -1259, 441, -1258, 443, -1257, 439, -1261, 443, -1255, 441, -1259, 466, -383, 440, -1260, 440, -1259, 440, -1259, 445, -1255, 440, -1260, 438, -1260, 440, -1259, 440, -1260, 465, -1235, 444, -405, 465, -385, 440, -409, 465, -385, 439, -411, 439, -410, 440, -410, 465, -384, 465, -385, 441, -412, 437, -1262, 438, -1259, 440, -410, 439, -410, 464, -1235, 440, -1259, 440, -1260, 441, -1258, 441, -409, 463, -386, 466, -1234, 463, -1237, 440, -409, 441, -408, 440, -414, 460, -1236, 439, -410, 441, -410, 439, -1259, 442, -408, 466, -384, 466, -1233, 441, -1259, 440, -411, 463, -1235, 441, -1257, 442, -408, 465, -1235, 441, -1258, 464, -385, 441, -1259, 440, -1260, 442, -407, 441, -409, 440, -1259, 440, -410, 464, -385, 466, -384, 468, -382, 466, -383, 465, -1235, 466, -1232, 466, -385, 442, -1257, 466, -1233, 466, -1234, 439, -411, 439, -410, 464, -386, 467, -385, 463, -384, 465, -1235, 440, -1259, 439, -411, 464, -1235, 439, -1260, 440, -1260, 466, -1236, 440, -1257, 440, -409, 464, -385, 441, -1259, 441, -409, 440, -410, 439, -412, 439, -409, 440, -409, 465, -385, 466, -388, 436, -410, 439, -1259, 441, -1259, 465, -1235, 439, -1260, 441, -1258, 465, -1235, 439, -1260, 440, -1259, 442, -408, 468, -381, 441, -409, 465, -385, 439, -411, 440, -409, 440, -410, 444, -406, 441, -1262, 436, -1261, 440, -1258, 439, -1260, 441, -1258, 442, -1258, 440, -1260, 439, -1259, 440, -410, 440, -410, 440, -410, 439, -410, 466, -383, 440, -411, 441, -408, 440, -411, 439, -1259, 466, -1233, 465, -1235, 440, -1262, 438, -1258, 487, -1212, 467, -1233, 440, -1260, 440, -409, 440, -410, 440, -409, 441, -409, 465, -385, 464, -385, 442, -410, 464, -383, 442, -1258, 465, -1234, 442, -1257, 465, -1235, 440, -1259, 441, -1258, 466, -1234, 444, -1255, 465, -386, 438, -411, 464, -387, 463, -385, 464, -386, 465, -385, 440, -410, 465, -385, 439, -1259, 441, -1259, 440, -1259, 464, -1235, 440, -1260, 438, -1261, 466, -1233, 440, -1260, 439, -1260, 441, -1258, 440, -410, 464, -386, 464, -1235, 465, -384, 465, -385, 442, -408, 441, -409, 439, -411, 439, -1260, 464, -1235, 465, -384, 441, -1259, 440, -1260, 440, -1258, 466, -1238, 437, -408, 467, -383, 465, -385, 443, -1256, 465, -384, 465, -1235, 443, -1256, 465, -385, 464, -1236, 442, -1258, 438, -1261, 438, -411, 465, -1234, 466, -388, 462, -383, 466, -1234, 443, -407, 445, -1254, 465, -384, 442, -409, 438, -410, 466, -385, 441, -409, 440, -409, 464, -1235, 440, -410, 440, -1259, 440, -1260, 441, -1258, 440, -1260, 439, -1260, 469, -1230, 440, -410, 465, -385, 440, -1258, 442, -409, 440, -411, 438, -410, 440, -409, 441, -410, 440, -1258, 465, -1235, 465, -385, 440, -1258, 441, -1259, 466, -1237, 437, -1259, 465]
- platform: template
name: Turn On A/C Swing Toggle
turn_on_action:
- remote_transmitter.transmit_raw:
carrier_frequency: 38kHz
# Hitachi AC 24C FanLow Toggle
code: [3440, -1656, 441, -1258, 445, -406, 440, -409, 465, -384, 466, -384, 466, -384, 440, -410, 465, -384, 442, -408, 441, -408, 467, -383, 456, -394, 464, -1235, 465, -385, 466, -384, 465, -385, 440, -409, 446, -404, 441, -409, 465, -384, 465, -388, 436, -412, 439, -409, 464, -386, 465, -384, 466, -385, 465, -384, 466, -383, 442, -408, 441, -409, 465, -1234, 464, -386, 465, -1234, 466, -1233, 441, -1259, 440, -1260, 440, -1259, 465, -1234, 440, -410, 464, -1235, 443, -1257, 440, -1259, 465, -1234, 442, -1258, 441, -1259, 439, -1260, 465, -1234, 441, -1258, 439, -411, 441, -408, 442, -408, 466, -384, 439, -411, 465, -384, 440, -410, 465, -385, 465, -385, 440, -409, 440, -1261, 463, -1235, 440, -410, 441, -408, 465, -1234, 466, -1234, 440, -1260, 440, -1259, 441, -409, 441, -408, 441, -1258, 440, -1263, 437, -410, 465, -384, 466, -383, 465, -1235, 441, -409, 469, -381, 465, -1234, 440, -410, 464, -388, 462, -1234, 466, -1234, 441, -408, 465, -1234, 442, -1259, 467, -382, 441, -1261, 441, -1256, 440, -410, 440, -1259, 444, -406, 464, -385, 466, -384, 441, -409, 440, -410, 465, -384, 440, -1260, 464, -385, 465, -1234, 441, -1259, 468, -1231, 466, -1233, 441, -1259, 464, -1235, 441, -409, 465, -384, 466, -387, 464, -384, 463, -386, 466, -383, 440, -1259, 465, -1235, 440, -409, 465, -1235, 465, -1234, 440, -1260, 441, -1258, 439, -1261, 464, -384, 441, -410, 460, -1239, 466, -384, 469, -381, 461, -388, 464, -388, 437, -410, 464, -386, 442, -408, 464, -386, 445, -1255, 465, -1233, 465, -1235, 441, -1260, 441, -1256, 441, -1259, 440, -1259, 465, -1234, 441, -409, 464, -386, 466, -384, 440, -409, 440, -411, 439, -410, 464, -385, 466, -384, 469, -1231, 440, -1259, 440, -1259, 441, -1259, 444, -1255, 442, -1258, 438, -1261, 440, -1259, 440, -410, 440, -410, 440, -410, 439, -410, 466, -384, 465, -384, 465, -385, 464, -385, 466, -1234, 465, -1234, 466, -1234, 440, -1262, 436, -1261, 439, -1260, 464, -1235, 441, -1258, 463, -387, 464, -386, 466, -383, 467, -383, 441, -409, 441, -408, 465, -386, 464, -386, 441, -1257, 441, -1258, 466, -1234, 440, -1259, 440, -1260, 465, -1234, 440, -1260, 439, -1260, 440, -409, 441, -409, 466, -384, 441, -409, 465, -384, 465, -385, 465, -385, 439, -411, 468, -1231, 440, -1259, 441, -1258, 440, -1260, 440, -1259, 466, -1233, 466, -1233, 465, -1235, 441, -1258, 466, -1235, 440, -412, 441, -405, 441, -1259, 465, -384, 465, -385, 466, -384, 465, -385, 440, -410, 465, -1236, 463, -1234, 465, -384, 441, -1259, 441, -1258, 440, -1261, 439, -1258, 443, -408, 464, -386, 464, -386, 463, -1237, 443, -405, 441, -1259, 440, -1258, 441, -410, 464, -1235, 441, -1259, 465, -1233, 442, -408, 465, -1235, 440, -409, 443, -407, 441, -1259, 442, -407, 466, -1234, 440, -409, 441, -409, 440, -410, 464, -385, 441, -408, 467, -384, 466, -1233, 440, -410, 464, -1236, 439, -1259, 440, -1260, 440, -1259, 441, -1259, 440, -1259, 440, -410, 440, -409, 440, -1260, 441, -408, 464, -388, 463, -384, 465, -385, 465, -387, 463, -1234, 440, -1260, 440, -409, 466, -1234, 439, -1260, 441, -1258, 466, -1234, 440]
- platform: template
name: Turn Off A/C
turn_on_action:
- remote_transmitter.transmit_raw:
carrier_frequency: 38kHz
# Hitachi AC TurnOff:
code: [3438, -1658, 442, -1259, 439, -410, 465, -385, 440, -409, 466, -384, 440, -410, 440, -409, 465, -384, 467, -383, 466, -384, 441, -409, 441, -409, 439, -1260, 465, -384, 466, -384, 465, -384, 441, -410, 440, -409, 440, -410, 466, -384, 441, -408, 441, -409, 465, -384, 447, -403, 441, -409, 440, -409, 454, -400, 462, -385, 465, -383, 466, -384, 439, -1261, 463, -386, 465, -1234, 441, -1259, 448, -1251, 440, -1261, 439, -1259, 440, -1260, 440, -410, 463, -1236, 439, -1260, 465, -1234, 465, -1234, 441, -1260, 439, -1259, 440, -1260, 464, -1235, 441, -1258, 465, -386, 440, -408, 466, -385, 439, -410, 466, -384, 440, -410, 439, -409, 466, -385, 464, -385, 440, -409, 441, -1259, 440, -1259, 439, -412, 465, -384, 466, -1233, 465, -1234, 465, -1235, 466, -1233, 440, -410, 466, -383, 442, -1258, 441, -1259, 464, -385, 466, -384, 464, -386, 440, -1259, 440, -410, 440, -410, 464, -1234, 467, -383, 440, -410, 465, -1234, 466, -1234, 439, -411, 464, -1235, 439, -1260, 465, -385, 443, -1256, 465, -1234, 464, -386, 439, -1261, 470, -1230, 439, -410, 440, -409, 466, -1233, 466, -384, 440, -410, 465, -385, 440, -409, 466, -389, 436, -1258, 466, -1233, 440, -410, 440, -1261, 439, -1260, 439, -1260, 440, -409, 441, -409, 464, -385, 441, -409, 440, -410, 439, -1260, 464, -1235, 465, -385, 464, -1236, 458, -1241, 441, -1259, 440, -1259, 440, -1259, 441, -409, 442, -407, 466, -1234, 439, -411, 466, -383, 466, -384, 465, -384, 442, -408, 440, -410, 464, -386, 465, -384, 442, -1258, 465, -1234, 440, -1259, 465, -1234, 440, -1260, 441, -1259, 440, -1259, 441, -1258, 440, -410, 465, -384, 441, -409, 440, -410, 467, -384, 463, -385, 441, -410, 439, -410, 440, -1259, 441, -1259, 465, -1234, 441, -1262, 440, -1255, 466, -1233, 466, -1234, 440, -1260, 440, -412, 462, -385, 440, -409, 464, -386, 442, -408, 465, -385, 464, -385, 440, -411, 439, -1259, 465, -1235, 440, -1259, 468, -1231, 440, -1261, 439, -1260, 442, -1256, 440, -1259, 441, -410, 445, -406, 464, -384, 464, -385, 466, -384, 441, -409, 440, -409, 440, -411, 463, -1235, 441, -1263, 461, -1234, 465, -1235, 440, -1260, 439, -1260, 440, -1259, 464, -1235, 466, -384, 465, -385, 441, -408, 466, -384, 440, -410, 464, -385, 441, -413, 435, -411, 440, -1259, 440, -1260, 440, -1259, 440, -1262, 436, -1261, 440, -1258, 441, -1259, 440, -1259, 464, -1235, 456, -1249, 439, -406, 465, -385, 464, -1235, 440, -410, 440, -410, 439, -411, 441, -408, 465, -384, 440, -1260, 465, -1234, 464, -386, 466, -1233, 440, -1260, 464, -1234, 442, -1258, 465, -385, 440, -410, 439, -410, 439, -411, 439, -410, 441, -1260, 467, -1231, 468, -382, 440, -1259, 440, -1260, 464, -1235, 466, -1233, 468, -1231, 442, -409, 464, -385, 465, -1234, 441, -410, 464, -1235, 440, -410, 441, -408, 466, -383, 441, -410, 465, -385, 440, -409, 464, -1235, 465, -385, 440, -1259, 440, -1259, 465, -1235, 441, -1258, 440, -1260, 440, -1259, 440, -409, 463, -388, 438, -1260, 466, -384, 469, -381, 466, -383, 467, -383, 465, -385, 453, -1246, 465, -1235, 441, -408, 440, -1259, 466, -1234, 465, -1234, 441, -1259, 440]
climate:
- platform: custom
lambda: |-
auto my_hitachiac = new HitachiAC();
App.register_component(my_hitachiac);
return {my_hitachiac};
climates:
- name: "Master Bedroom AC"
#include "esphome.h"
#include "IRremoteESP8266.h"
#include "IRsend.h"
#include "ir_Hitachi.h"
///This code is relevant for cases where the IR control for an AC is available in IRremoteESP8266, but isn't supported yet in Esphome
const uint16_t kIrLed = 14; // ESP8266 GPIO pin to use. Recommended: 0 (D3).
const bool inverted = false;
const bool use_modulation = true;
IRHitachiAc264 ac(kIrLed, inverted, use_modulation);
// Setup files. This is the equivalent of the code written in the setup loop of Arduino
class HitachiAC : public Component, public Climate { public: void setup() override {
// Setup pins etc
ac.begin();
// AC model. This is only relevant in cases where the ir_company.h requires a model (i.e. the signals change by model)
// ac.setModel(R_LT0541_HTA_A);
delay(200);
// Setting up base conditions, so that the system doesn't send garbage to begin with
ac.setTemp(24);
ac.setFan(kHitachiAc264FanAuto);
// ac.setSwingV(true);
ac.off();
// Setting up base conditions transferred to Home Assistant, so that there's no garbage at initialization
this->mode = mode;
this->fan_mode = CLIMATE_FAN_AUTO;
this->swing_mode = CLIMATE_SWING_VERTICAL;
this->target_temperature = 24;
this->publish_state();
}
// Traits: This tells home assistant what "traits" are supported by AC in terms of heating/cooling/fan speeds/swing modes. These are used by Home Assistant to customize the AC card on your dashboard
climate::ClimateTraits traits() {
auto traits = climate::ClimateTraits();
traits.set_supports_current_temperature(false);
traits.set_supports_two_point_target_temperature(false);
traits.set_supported_modes({
climate::CLIMATE_MODE_OFF,
climate::CLIMATE_MODE_HEAT,
climate::CLIMATE_MODE_DRY,
climate::CLIMATE_MODE_COOL,
climate::CLIMATE_MODE_FAN_ONLY,
//Adding this leads to esphome data not showing on Home Assistant somehow, hence skipping. Others please try and let me know
});
traits.set_supported_fan_modes({
climate::CLIMATE_FAN_AUTO,
climate::CLIMATE_FAN_LOW,
climate::CLIMATE_FAN_MEDIUM,
climate::CLIMATE_FAN_HIGH,
});
traits.set_supported_swing_modes({
climate::CLIMATE_SWING_OFF,
climate::CLIMATE_SWING_VERTICAL,
});
traits.set_visual_min_temperature(16);
traits.set_visual_max_temperature(30);
traits.set_visual_temperature_step(1);
return traits;
}
//Code for what to do when the mode of the AC is changed on the dashboard
void control(const ClimateCall &call) override {
if (call.get_mode().has_value()) {
// User requested mode change
ClimateMode mode = *call.get_mode();
// Send mode to hardware
//You need an condition of each of the supported modes mentioned in the traits section above
//For each mode, you need to find the relevant mode from the list of constants. This list can be found in the relevant .h library from IRremoteESP8266 library. In this case the file is "ir_Hitachi.h". Typically the function should be the same - .setMode. However, best check the relevant .h library.
if (mode == CLIMATE_MODE_OFF) {
ac.off();
} else if (mode == CLIMATE_MODE_HEAT) {
ac.on();
ac.setMode(kHitachiAc264Heat);
} else if (mode == CLIMATE_MODE_DRY) {
ac.on();
ac.setMode(kHitachiAc264Dry);
} else if (mode == CLIMATE_MODE_COOL) {
ac.on();
ac.setMode(kHitachiAc264Cool);
} else if (mode == CLIMATE_MODE_FAN_ONLY) {
ac.on();
ac.setMode(kHitachiAc264Fan);
}
// Publish updated state
this->mode = mode;
this->publish_state();
}
//Code for what to do when the fan speed / mode is changed on the dashboard
if (call.get_fan_mode().has_value()) {
// User requested fan mode change
ClimateFanMode fan_mode = *call.get_fan_mode();
// Send fan mode to hardware
if (fan_mode == CLIMATE_FAN_AUTO) {
ac.setFan(kHitachiAc264FanAuto);
} else if (fan_mode == CLIMATE_FAN_LOW) {
ac.setFan(kHitachiAc264FanMin);
} else if (fan_mode == CLIMATE_FAN_MEDIUM) {
ac.setFan(kHitachiAc264FanMedium);
} else if (fan_mode == CLIMATE_FAN_HIGH) {
ac.setFan(kHitachiAc264FanHigh);
}
this->fan_mode = fan_mode;
this->publish_state();
}
//Code for what to do when the swing mode is changed on the dashboard
//Check what function is available in the relevant .h file. For example, .setSwingV is the relevant function in ir_Hitachi.h, but it is .setSwingVertical in some others
if (call.get_swing_mode().has_value()) {
// User requested fan mode change
ClimateSwingMode swing_mode = *call.get_swing_mode();
// Send fan mode to hardware
if (swing_mode == CLIMATE_SWING_OFF) {
ac.setSwingVToggle(false);
} else if (swing_mode == CLIMATE_SWING_VERTICAL) {
ac.setSwingVToggle(true);
}
this->swing_mode = swing_mode;
this->publish_state();
}
//Code for what to do when the temperature is changed on the dashboard
if (call.get_target_temperature().has_value()) {
// User requested target temperature change
float temp = *call.get_target_temperature();
// Send target temp to climate
ac.setTemp(temp);
this->target_temperature = temp;
this->publish_state();
}
//Send the IR code you've built basis all the above data
ac.send();
#if DEBUG_AC
ESP_LOGD("DEBUG", "Home A/C remote is in the following state:");
ESP_LOGD("DEBUG", "%s\n", ac.toString().c_str());
#endif // DEBUG_AC
}
};
|
@anklav24 Have you managed to find a solution to this? |
@ppkstat No, I keep using raw commands. |
That's unfortunate. I'll let you know if I find a solution, but that;s not
very likely since I am not a developer.
Have you tried posting this in the home assistant forums? In any case,
thank you for your work.
…On Sat, 19 Aug 2023 at 17:10, Aleksandr Lobanov ***@***.***> wrote:
@ppkstat <https://github.com/ppkstat> No, I keep using raw commands.
—
Reply to this email directly, view it on GitHub
<#1729 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BA5CPSNMQWF2WAVWZHQEDUDXWDCONANCNFSM5LMAJ64Q>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
@ppkstat I tried. There's no answer there like in irremote library repo too. |
Version/revision of the library used
Version of the library : 2.8.1
Describe the bug
My air conditioner is Hitachi RAK-25NH5 with RAR-2P2 remote, which is unrecognizable, can help to join?
the protocol appears to be just a shorter version of HITACHI.
view #1134
same value for Temperature
I created this file.
https://docs.google.com/spreadsheets/d/1qDnKM3ZslWrR-skgQjaConq3U2b7RuzZK1tA64WYRBM/edit?usp=sharing
The text was updated successfully, but these errors were encountered: