Skip to content

Commit f508756

Browse files
authored
Hitachi: Add RF07T4 remote to supported devices (#2286)
The RF07T4 remote uses the existing HITACHI_AC344 protocol and byte layout, so no code changes are needed. This just documents it as a known-working model, plus adds a unit test built from a real capture. Tested under real conditions: the remote was decoded from scratch against a Hitachi A/C, and the resulting byte map matched this library's HITACHI_AC344 layout exactly (button byte 11, temp byte 13, fan/mode byte 25, power byte 27, SwingH byte 35, including the same 0x92 0x6D preamble as the existing AC344 reference state). Frames built from that map have been driving the A/C reliably for several days -- power, mode, temp, fan and both swing axes. To be precise about what that does and doesn't prove: the decode side is verified against this library directly, by the new test. The send side was verified only in the sense that the byte layout is right -- those frames were transmitted from a Raspberry Pi via ir-ctl, reusing the remote's own captured pulse timings, not this library's nominal ones. So I can say the state encoding is correct, but I have not yet put sendHitachiAc344()'s timings (3300/1700 header, 400us marks, 1250/500 spaces) in front of the unit. Happy to test that and report back if it matters for acceptance. The new test decodes a genuine off-air capture: Power on, Cool, 24C, Fan auto. It needs setTolerance(40), because the capture came off a HX1838 demodulator through the Linux kernel's gpio-ir driver, which biases the mark/space boundary the opposite way to a typical TSOP capture -- marks read ~50us short and zero spaces ~90us long, while the bit periods themselves still line up. Same trick as the Mirage and Samsung tests. Two observations that don't affect this change, noted in case they're useful to someone later: this remote emits button code 0x41 for its dedicated "operation switch" (mode) key, which isn't among the kHitachiAc424Button* constants; and its Swing(V) key always transmits byte 37 bit 5 as 0, with the A/C toggling its own swing state on receipt, rather than the remote carrying the state.
1 parent 1aa31ea commit f508756

2 files changed

Lines changed: 85 additions & 0 deletions

File tree

src/ir_Hitachi.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
// Brand: Hitachi, Model: R-LT0541-HTA/Y.K.1.1-1 V2.3 remote (HITACHI_AC1)
2222
// Brand: Hitachi, Model: RAS-22NK A/C (HITACHI_AC344)
2323
// Brand: Hitachi, Model: RF11T1 remote (HITACHI_AC344)
24+
// Brand: Hitachi, Model: RF07T4 remote (HITACHI_AC344)
2425
// Brand: Hitachi, Model: RAR-2P2 remote (HITACHI_AC264)
2526
// Brand: Hitachi, Model: RAK-25NH5 A/C (HITACHI_AC264)
2627
// Brand: Hitachi, Model: RAR-3U3 remote (HITACHI_AC296)

test/ir_Hitachi_test.cpp

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1919,6 +1919,90 @@ TEST(TestDecodeHitachiAc344, RealExample) {
19191919
EXPECT_STATE_EQ(expected, irsend.capture.state, irsend.capture.bits);
19201920
}
19211921

1922+
// Decode a 'real' HitachiAc344 message from a Hitachi RF07T4 remote.
1923+
TEST(TestDecodeHitachiAc344, RealExampleRF07T4) {
1924+
IRsendTest irsend(kGpioUnused);
1925+
IRrecv irrecv(kGpioUnused);
1926+
irsend.begin();
1927+
irrecv.setTolerance(40); // Bump tolerance to match the receiver's bias.
1928+
1929+
// On, Cool, 24C, Fan Auto
1930+
uint8_t expected[kHitachiAc344StateLength] = {
1931+
0x01, 0x10, 0x00, 0x40, 0xBF, 0xFF, 0x00, 0xCC, 0x33, 0x92, 0x6D, 0x13,
1932+
0xEC, 0x60, 0x9F, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00,
1933+
0xFF, 0x53, 0xAC, 0xF1, 0x0E, 0x02, 0xFD, 0x12, 0xED, 0x80, 0x7F, 0x01,
1934+
0xFE, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF};
1935+
1936+
// Ref: https://github.com/crankyoldgit/IRremoteESP8266/pull/2286
1937+
const uint16_t rawData[691] = {
1938+
3211, 1789, 325, 1302, 382, 564, 353, 565, 352, 591, 326, 565, 351, 590,
1939+
326, 565, 352, 593, 349, 565, 351, 565, 352, 565, 351, 592, 325, 1335,
1940+
350, 566, 350, 591, 325, 589, 353, 563, 353, 591, 326, 591, 326, 566,
1941+
351, 564, 353, 565, 352, 590, 326, 616, 325, 563, 353, 565, 351, 590,
1942+
326, 566, 350, 590, 325, 591, 326, 1359, 326, 616, 324, 1359, 326, 1360,
1943+
326, 1334, 349, 1359, 326, 1359, 325, 1361, 324, 592, 325, 1384, 325,
1944+
1290, 394, 1360, 324, 1359, 326, 1360, 325, 1358, 326, 1359, 325, 1332,
1945+
352, 1384, 325, 592, 325, 568, 349, 591, 325, 565, 352, 590, 325, 592,
1946+
325, 591, 325, 616, 326, 591, 326, 591, 325, 1359, 325, 1359, 325, 565,
1947+
352, 590, 326, 1358, 326, 1385, 325, 1359, 325, 1359, 326, 564, 352,
1948+
590, 325, 1360, 324, 1360, 325, 591, 325, 616, 326, 590, 326, 1360, 325,
1949+
591, 325, 590, 326, 1359, 325, 591, 325, 564, 352, 1360, 350, 1359, 325,
1950+
592, 325, 1359, 325, 1360, 325, 590, 326, 1359, 325, 1359, 325, 615,
1951+
326, 1359, 325, 1333, 352, 563, 353, 591, 325, 1359, 326, 591, 326, 590,
1952+
325, 589, 352, 564, 352, 590, 326, 1360, 324, 1359, 325, 590, 326, 1358,
1953+
325, 1360, 325, 1384, 325, 590, 326, 566, 351, 591, 325, 591, 325, 563,
1954+
354, 1333, 352, 1359, 324, 616, 326, 1331, 354, 1359, 325, 1359, 326,
1955+
1359, 326, 1334, 350, 590, 326, 591, 325, 1384, 325, 566, 351, 591, 326,
1956+
591, 325, 564, 354, 590, 325, 565, 352, 592, 324, 591, 350, 1360, 325,
1957+
1360, 324, 1359, 325, 1330, 355, 1359, 325, 1360, 325, 1360, 324, 1384,
1958+
325, 590, 327, 591, 325, 566, 351, 565, 352, 591, 326, 564, 352, 592,
1959+
325, 616, 325, 1360, 324, 1361, 323, 1360, 325, 1359, 325, 1359, 326,
1960+
1358, 326, 1359, 325, 1384, 325, 566, 350, 591, 325, 590, 326, 592, 325,
1961+
591, 327, 590, 325, 566, 351, 616, 325, 1335, 350, 1359, 325, 1360, 325,
1962+
1359, 326, 1359, 325, 1361, 324, 1359, 325, 1359, 351, 591, 325, 590,
1963+
326, 592, 325, 591, 325, 591, 325, 591, 325, 591, 326, 616, 325, 1359,
1964+
325, 1360, 324, 1359, 326, 1360, 325, 1360, 324, 1359, 325, 1360, 325,
1965+
1385, 324, 591, 325, 592, 325, 591, 325, 591, 325, 591, 325, 591, 326,
1966+
591, 326, 616, 325, 1360, 325, 1336, 349, 1358, 325, 1359, 325, 1360,
1967+
325, 1359, 325, 1359, 325, 1384, 326, 1359, 325, 1360, 350, 566, 377,
1968+
540, 325, 1360, 376, 540, 325, 1358, 377, 541, 401, 540, 325, 565, 402,
1969+
1308, 350, 1334, 377, 539, 376, 1310, 349, 565, 351, 1360, 350, 1335,
1970+
350, 566, 351, 566, 350, 566, 350, 1335, 376, 1309, 350, 1335, 350,
1971+
1359, 351, 566, 350, 1335, 350, 1334, 351, 1340, 370, 540, 377, 540,
1972+
376, 540, 350, 592, 351, 565, 351, 1333, 351, 566, 350, 566, 351, 565,
1973+
350, 567, 349, 566, 351, 590, 352, 1333, 351, 566, 350, 1334, 350, 1334,
1974+
351, 1334, 350, 1335, 350, 1333, 352, 1359, 349, 566, 350, 1333, 351,
1975+
565, 351, 566, 351, 1334, 350, 565, 351, 566, 351, 590, 352, 1335, 349,
1976+
566, 350, 1333, 351, 1334, 351, 566, 351, 1333, 352, 1333, 351, 1358,
1977+
351, 566, 350, 567, 351, 565, 351, 566, 351, 565, 351, 565, 352, 565,
1978+
351, 1332, 378, 1333, 351, 1334, 351, 1335, 349, 1334, 350, 1333, 351,
1979+
1333, 352, 1333, 351, 590, 352, 1334, 350, 566, 351, 565, 351, 566, 351,
1980+
565, 352, 565, 351, 541, 376, 591, 350, 565, 352, 1333, 351, 1334, 351,
1981+
1334, 351, 1333, 351, 1334, 351, 1333, 351, 1361, 351, 566, 351, 565,
1982+
351, 565, 351, 565, 351, 565, 351, 564, 352, 565, 351, 594, 351, 1334,
1983+
351, 1334, 351, 1333, 351, 1334, 350, 1309, 376, 1334, 350, 1307, 377,
1984+
1361, 351, 540, 377, 565, 352, 538, 378, 540, 377, 564, 352, 564, 352,
1985+
540, 377, 593, 351, 1333, 351, 1333, 351, 1334, 351, 1333, 352, 1333,
1986+
352, 1332, 351, 1333, 351, 1362, 351, 538, 378, 539, 378, 539, 378, 565,
1987+
350, 539, 378, 540, 377, 565, 351, 593, 351, 1333, 351, 1308, 377, 1333,
1988+
351, 1334, 351, 1307, 378, 1309, 375, 1309, 376, 1345, 377};
1989+
1990+
irsend.reset();
1991+
irsend.sendRaw(rawData, 691, kHitachiAcFreq);
1992+
irsend.makeDecodeResult();
1993+
EXPECT_TRUE(irrecv.decode(&irsend.capture));
1994+
EXPECT_EQ(HITACHI_AC344, irsend.capture.decode_type);
1995+
ASSERT_EQ(kHitachiAc344Bits, irsend.capture.bits);
1996+
EXPECT_STATE_EQ(expected, irsend.capture.state, irsend.capture.bits);
1997+
1998+
IRHitachiAc344 ac(kGpioUnused);
1999+
ac.setRaw(irsend.capture.state);
2000+
EXPECT_EQ(
2001+
"Power: On, Mode: 3 (Cool), Temp: 24C, Fan: 5 (Auto), "
2002+
"Button: 19 (Power/Mode), Swing(V): Off, Swing(H): 1 (Right Max)",
2003+
ac.toString());
2004+
}
2005+
19222006
// Decode a synthetic HitachiAc344 message.
19232007
TEST(TestDecodeHitachiAc344, SyntheticExample) {
19242008
IRsendTest irsend(kGpioUnused);

0 commit comments

Comments
 (0)