Home Assistant and IR gateway problems

Hi!

So I’ve been looking for some DIY solution for two-way communication between IR remotes and HA and I’ve found OpenMqttGateway. After some reading I decided to give it a try. I got NodeMCU v2.0 and all the parts to wire it together. It works…sort of :slight_smile: I’ve been able to make OMG work with HA and my PC stereo speakers, but failed dwith my AC that was my main goal. More information below.

I have few issues/questions.

The range is really poor, like… I dunno, half a meter maybe? And target has to bee in direct line of sight, the IR emitter has to be literally pointing at it. This is strange because I have not seen problems like this reported. Just to answer obvious questions. Yes I provide 5V to the board and I did check my wiring :ok_hand:

I don’t know how to deal with codes that are the same and are a toggle, like power on/off of my stereo speakers I’m using with my PC. They don’t have separate codes for on and off actions so I can’t use (I think) payload_on and payload_off in HA to get them from the state topic. I’ve been playing around with true/false values for optimistic and retain, but did not help much. Also because of the same code I can’t seem to get the bidirectional connection to work. HA switch stays in the same position all the time (until I manually flip it in HA) and does not reflect physical remote button presses. I also played with raw data, I can make publish it to /commands/IR_Raw topic and I see it flip the speakers on and off. I could use raw data in HA, but since it’s different everytime (at least that is what I see it as) - end result will be similar to previous attempt.

Main thing I wanted to drive is my Haier AC unit. I see it is supported by IRremoteESP8266, I tried IRrecvDumpV2 and it worked like a charm. I see codes and what is more important I see state of the unit, since there are methods to get temperature, fan speed and other options in the library. What I was wondering is if this is super hard to add it to OMG?

For the AC I’m also wondering if there is a way to use the AC state to do some kind of neat UI for it or it all has to e switches, buttons and that’s it?

Thanks for all the work @1technophile and all contributors!

Kind regards
M

Hi,

Thanks for taking time to describe your request, did you take a look at this solution for raw sending ? So as to send data for AC you will need to update pubsubclient.h max payload value to 1024 also.

Thank you for your suggestion good sir. I forgot to mention that I di my research before posting and already tried that :slight_smile: I thought I had it on 512, so I went in to ZgatewayIR but it already had 1024 :slight_smile: Do I need to change pubsubclient.h as well or this method call overrides MQTT_MAX_PACKET_SIZE definition in it by explicitly providing packet size to the method?

Hm…maybe I do need to update pubsubclient…this suggested change in ZgatewayIR is for receive not send and was due OMG getting smaller raw data than IRrecvDumpv2… :thinking:

Ok, so I tried raising payload size to 1024 in pubsubclient.h, didn’t help.

I’m using this data I got with IRrecvDumpv2:

Timestamp : 000044.031
Encoding : HAIER_AC_YRW02
Code : A6CCED0062681E2A000000000071 (112 bits)
Mesg Desc.: Power: On, Button: 0 (Temp Up), Mode: 2 (Cool), Temp: 28C, Fan: 6 (Low), Turbo: 0 (Off), Swing: 12 (Auto), Sleep: Off, Health: Off
Library : v2.4.3

Raw Timing[229]:

  • 3108, - 3034, + 3074, - 4418, + 614, - 1608, + 588, - 524,
  • 588, - 1636, + 620, - 518, + 564, - 546, + 566, - 1656,
  • 560, - 1638, + 618, - 520, + 592, - 1632, + 564, - 1658,
  • 588, - 524, + 588, - 522, + 610, - 1614, + 592, - 1632,
  • 584, - 526, + 586, - 524, + 588, - 1636, + 618, - 1606,
  • 610, - 1612, + 614, - 498, + 614, - 1610, + 616, - 1606,
  • 620, - 492, + 592, - 1632, + 564, - 546, + 586, - 526,
  • 616, - 522, + 562, - 550, + 582, - 528, + 594, - 518,
  • 584, - 526, + 616, - 524, + 560, - 552, + 590, - 1632,
  • 614, - 1610, + 586, - 526, + 586, - 524, + 588, - 550,
  • 592, - 1606, + 620, - 518, + 584, - 526, + 588, - 1636,
  • 590, - 1634, + 562, - 550, + 592, - 1630, + 584, - 526,
  • 616, - 496, + 616, - 520, + 562, - 548, + 612, - 498,
  • 614, - 498, + 586, - 1638, + 618, - 1606, + 620, - 1604,
  • 612, - 1612, + 566, - 546, + 616, - 522, + 590, - 522,
  • 562, - 1660, + 594, - 518, + 586, - 1638, + 588, - 524,
  • 588, - 1634, + 562, - 550, + 612, - 500, + 592, - 544,
  • 560, - 552, + 590, - 522, + 620, - 518, + 584, - 526,
  • 566, - 544, + 568, - 544, + 588, - 550, + 564, - 548,
  • 564, - 548, + 584, - 526, + 586, - 550, + 590, - 522,
  • 592, - 520, + 592, - 518, + 584, - 526, + 614, - 524,
  • 590, - 522, + 590, - 520, + 612, - 500, + 592, - 546,
  • 566, - 544, + 590, - 522, + 590, - 522, + 590, - 548,
  • 584, - 526, + 588, - 524, + 618, - 494, + 590, - 548,
  • 592, - 518, + 564, - 546, + 586, - 526, + 616, - 520,
  • 562, - 550, + 562, - 548, + 614, - 498, + 614, - 522,
  • 590, - 522, + 590, - 520, + 592, - 520, + 594, - 1630,
  • 596, - 1628, + 618, - 1606, + 590, - 520, + 592, - 546,
  • 586, - 526, + 588, - 1608, + 618

uint16_t rawData[229] = {3108, 3034, 3074, 4418, 614, 1608, 588, 524, 588, 1636, 620, 518, 564, 546, 566, 1656, 560, 1638, 618, 520, 592, 1632, 564, 1658, 588, 524, 588, 522, 610, 1614, 592, 1632, 584, 526, 586, 524, 588, 1636, 618, 1606, 610, 1612, 614, 498, 614, 1610, 616, 1606, 620, 492, 592, 1632, 564, 546, 586, 526, 616, 522, 562, 550, 582, 528, 594, 518, 584, 526, 616, 524, 560, 552, 590, 1632, 614, 1610, 586, 526, 586, 524, 588, 550, 592, 1606, 620, 518, 584, 526, 588, 1636, 590, 1634, 562, 550, 592, 1630, 584, 526, 616, 496, 616, 520, 562, 548, 612, 498, 614, 498, 586, 1638, 618, 1606, 620, 1604, 612, 1612, 566, 546, 616, 522, 590, 522, 562, 1660, 594, 518, 586, 1638, 588, 524, 588, 1634, 562, 550, 612, 500, 592, 544, 560, 552, 590, 522, 620, 518, 584, 526, 566, 544, 568, 544, 588, 550, 564, 548, 564, 548, 584, 526, 586, 550, 590, 522, 592, 520, 592, 518, 584, 526, 614, 524, 590, 522, 590, 520, 612, 500, 592, 546, 566, 544, 590, 522, 590, 522, 590, 548, 584, 526, 588, 524, 618, 494, 590, 548, 592, 518, 564, 546, 586, 526, 616, 520, 562, 550, 562, 548, 614, 498, 614, 522, 590, 522, 590, 520, 592, 520, 594, 1630, 596, 1628, 618, 1606, 590, 520, 592, 546, 586, 526, 588, 1608, 618}; // HAIER_AC_YRW02
uint8_t state[14] = {0xA6, 0xCC, 0xED, 0x00, 0x62, 0x68, 0x1E, 0x2A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x71};

When I used the same data in IRsendDemo example it worked.

Hello,

Could you give us the complete command line you are doing so as to publish the raw data to your broker and what the serial monitor is saying ?

I’m publishing this payload:

3108,3034,3074,4418,614,1608,588,524,588,1636,620,518,564,546,566,1656,560,1638,618,520,592,1632,564,1658,588,524,588,522,610,1614,592,1632,584,526,586,524,588,1636,618,1606,610,1612,614,498,614,1610,616,1606,620,492,592,1632,564,546,586,526,616,522,562,550,582,528,594,518,584,526,616,524,560,552,590,1632,614,1610,586,526,586,524,588,550,592,1606,620,518,584,526,588,1636,590,1634,562,550,592,1630,584,526,616,496,616,520,562,548,612,498,614,498,586,1638,618,1606,620,1604,612,1612,566,546,616,522,590,522,562,1660,594,518,586,1638,588,524,588,1634,562,550,612,500,592,544,560,552,590,522,620,518,584,526,566,544,568,544,588,550,564,548,564,548,584,526,586,550,590,522,592,520,592,518,584,526,614,524,590,522,590,520,612,500,592,546,566,544,590,522,590,522,590,548,584,526,588,524,618,494,590,548,592,518,564,546,586,526,616,520,562,550,562,548,614,498,614,522,590,522,590,520,592,520,594,1630,596,1628,618,1606,590,520,592,546,586,526,588,1608,618

to

home/OpenMQTTGateway/commands/IR_Raw

using MQTT.fx

The response is:

Hey I got a callback
3108,3034,3074,4418,614,1608,588,524,588,1636,620,518,564,546,566,1656,560,1638,618,520,592,1632,564,1658,588,524,588,522,610,1614,592,1632,584,526,586,524,588,1636,618,1606,610,1612,614,498,614,1610,616,1606,620,492,592,1632,564,546,586,526,616,522,562,550,582,528,594,518,584,526,616,524,560,552,590,1632,614,1610,586,526,586,524,588,550,592,1606,620,518,584,526,588,1636,590,1634,562,550,592,1630,584,526,616,496,616,520,562,548,612,498,614,498,586,1638,618,1606,620,1604,612,1612,566,546,616,522,590,522,562,1660,594,518,586,1638,588,524,588,1634,562,550,612,500,592,544,560,552,590,522,620,518,584,526,566,544,568,544,588,550,564,548,564,548,584,526,586,550,590,522,592,520,592,518,584,526,614,524,590,522,590,520,612,500,592,546,566,544,590,522,590,522,590,548,584,526,588,524,618,494,590,548,592,518,564,546,586,526,616,520,562,550,562,548,614,498,614,522,590,522,590,520,592,520,594,1630,596,1628,618,1606,590,520,592,546,586,526,588,1608,618
IR_Raw
MQTTtoIR ack pub.

MY answers will be delayed a bit…I start my vacation tomorrow :slight_smile:

Did you tried global cache database ?

Sadly there’s no codes there for my Haier unit :frowning:

I need to add haier decoding to omg. You will have it end of august the latest

Does this mark the release of v1 with all of the goodies like OLED display and FastLED?

Nope, not yet. I hope that we can release v0.8 in september but i m not the only one involved.

1 Like

I wish i could a little better… I would have definitely be involved :frowning:

Thank you Florian for all your work on OMG. Haier support is one thing, but the other issues I have are also sth that really push me to out-of-the-box solutions like Broadlink. It’s maybe just too much things I want to do at once :slight_smile:

Ok, that’s a super hard necro revival, but…I think Haier implementation/decoding is still not in OMG isn’t it @1technophile?

It is into OMG since february :wink:

Oh…I thought so but I tried today (I know…year later :smiley:) and I still get unknown protocol when I upload the sketch and see serial monitor.

Did you tried with the last development branch?

There is now a datastring data published from OMG that you can republish to reproduce:

Here is an example:
{"datastring":"11,DA,27,00,42,02,04,5A,11,DA,27,00,00,39,26,00,40,00,00,06,60,00,00,C1,80,00,58","bits":27,"protocol_name":"IR_DAIKIN"}

Tried just now, still getting this in serial monitor.

Creating IR buffer
Rcv. IR
3112,3026,3094,4396,618,1606,620,490,618,1606,648,460,648,490,560,1664,592,1604,642,496,594,1630,566,1630,616,520,608,504,614,1608,618,1606,612,500,608,502,626,1600,588,1632,624,1600,616,494,644,494,594,1602,594,516,592,546,612,500,618,494,624,512,566,548,608,500,590,520,626,486,622,514,612,498,620,1604,622,488,620,516,592,1604,592,546,610,1586,592,1630,616,496,622,1600,586,1636,590,520,616,1608,588,1632,594,1628,608
–no pub. unknown protocol–

It’s either I don’g get something or I need some additional configuration. I did try with remote for my Sony Bravia TV and that was recognized ok :?

Could you publish what you are seeing on your mqtt broker?

I tried sending to home/OpenMQTTGateway/commands/IR_Raw but not getting any output and AC does not make a beep :slight_smile: