Home Assistant and IR gateway problems


#1

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


#2

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.


#3

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:


#5

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.


#6

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 ?


#7

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:


#8

Did you tried global cache database ?


#9

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


#10

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


#11

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


#12

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


#13

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


#14

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: