IR transmitters

Tags: #<Tag:0x00007f212f361eb8> #<Tag:0x00007f212f361c10> #<Tag:0x00007f212f361918>

(.) #8

Hi everyone. New openHAB user here.

I have just purchased a Orvibo. Waiting for it to get delivered.

Can’t wait to code it to work with openHAB.

(Kim Skatun) #9

looks promising…

(.) #10

Just thought I would post a quick status update.

I have my Orvibo AllOne IR blaster working with the Python library here…
I’m going to mount it to my ceiling.

It works great. I currently have it controlling my Air Conditioner (Split system) with a simple On/Off switch (set to a fixed temperature) and “Powerful” button in openHAB. Next will be the home entertainment stuff and temperature options for the AC.

It was actually quite simple to get working with openHAB thanks to the Python library. I had it all up and running the way I wanted in about half an hour.

I was thinking of writing a small guide if anyone is interested?

(steve1) #11

I’m interested.

(damir_pavkovic) #12

I’m interested too.

(Enc-X) #13

I’ve just implemented such hack - esp8266 based ir receiver / transmitter over mqtt. I can send standard codes by ID and receive any standard codes (RC5, NEC, Phillips etc)
in OH I configure for example:
Switch ir_philips_volp "Vol+" <ir> (gIR) {mqtt=">[mosquitto:esp8266/02/sender/RC5/12:command:ON:1040]"} Number ir_in_lg "LG remote command [%d]" <ir> (gIR) {mqtt="<[mosquitto:esp8266/02/receiver/NEC/32:state:default]"}

I focused on my devices so not all codes are supported.

Hardware is very simple - IR receiver connected directly to ESP GPIO and IR LED connected via 1 transistor.

(.) #14

I would like to also create an ESP8266 based solution for another room rather than purchasing another Orvibo AllOne.

For those that are interested, here is my guide on how to set up the Orvibo AllOne with openHAB…

(damir_pavkovic) #15

Can you make a small tutorial for construction of your’s hardware based on ESP, and implementation of everything in openHUB?

Robinson solution with Orvibo is excellent but this also looks very promising.

(Enc-X) #16

Here you are:

(Mario) #17


Congratulations for this great code.

I tried it but can’t make it work. I think I need some examples of use.

I’m trying something easy, I guess: to send a ON command to a Yamaha RX-V2600 receiver.

I analysed the code from the original remote with AnalysIR and it’s:

Hex: 7E817E81
Binary: 01111110 10000001 01111110 10000001

If I replay the IR code from AnalysIR it the receiver turns on.

Now, I don’t quite understand how to send the MQTT message for mqtt-ir-transceiver to send the code.

My device “mqtt_prefix” is “irtrans01” so I tried sending:
Topic: "irtrans01/sender/NEC/32"
Payload: “7E817E81” and also tried “0x7E817E81”

I can see in the serial monitor “*IR: Send NEC:7” (or “*IR: Send NEC:0” when payload = “0x7E817E81”)

Propably I don’t understand the format. Looks like passing a hex is incorrect as it only accepts numbers.
Any help is appreciated.

(Enc-X) #18

I didn’t think about hex, I use ony dec. Convert hex to dec.

You can read codes via receiver module, use topic to read codes:


and you can see format, size and code (in dec format)

(Mario) #19

Thank you.

I’ts working now but there is still some kind of problem.

When I send the code -> Hex: 7E817E81 (decimal 2122415745) it works fine.

When I send the code -> Hex: 807F817E (decimal 2155839870) it doesn’t work.

When I send the code -> Hex: 817E817E ‭(decimal 2172551550) it doesn’t work.

In the last two cases the monitor window show “*IR: Send NEC:2147483647”, so I guess the problem has to do with the limit of the variable holding the code (msgInt).

I can see msgInt should be already an unsigned long as it’s declared as “unsigned long msgInt = msgString.toInt();”, so I don’t know where the problem is (maybe in the “toInt()”?).

Sorry, I’m not a good enough programmer to fix it.

(Enc-X) #20

I’ve checked your codes - you are right. The problem was toInt() - I missed that it returns long not unsigned long. See new code - now should work.

(Mario) #21

Thank you. Now this part is fixed but I think there is still some issue with long numbers as the codes that fit in a signed long works but no the bigger numbers that need unsigned long.

When I send the code -> Hex: 7E817E81 (decimal 2122415745) it works fine.

When I send the code -> Hex: 807F817E (decimal 2155839870) it doesn’t work. And according to AnalysIR this is what is sent:


Here you can see the correct code send by the remote (in yellow) and the code sent by the sketch (in green):

I have no clue what the problem is (other than the size of the number).

(Enc-X) #22

When you receive this code via mqtt transceiver - how mqtt message and topic looks like ?
May your device have different bit-lenght? I forget about it - see new code. Note that I didn’t check it yet.

(Mario) #23

I’m sorry I do not have an IR detector connected to my ESP8266.

I think the issue may be within the IRremoteESP8266 library as I just tested and same problem happens with the original IRSendDemo sketch included with the library. I just opened an issue here:

According to AnalysIR the bit-lenght is always 32bits. You can see here some random keys of the remote pressed captured and analysed by AnalysIR:

(Mario) #24

I changed the irsend.sendNEC(msgInt, irBitsInt); line in the code and it looks better (I closed the issue as I had a similar mistake in my testing with the IRSendDemo sketch.

I’m still receiving a wrong code (when I send 807F817E I receive 7E81FE01). It looks similar and partially reversed, don’t know why (is swaped as: ABCD => DCxx.

807F817E: 10000000 01111111 10000001 01111110
7E81FE01: 01111110 10000001 11111110 00000001

As a sidenote, after changing the code I have to use irtrans01/sender/NEC/32 as irtrans01/sender/NEC send nothing.

Let me do some more testing to clear whats going on, right now I’m not sure. I will report later…

(Mario) #25

I’m really tired. After most of the day testing different things I still don’t know what’s going on.

I added a IR receiver to the ESP8266 and it gives me the same code AnalysIR does but looks like some times it works and some times dons’t. Also some codes works fine 100% of times and some others almost never.

Many times the start bit (should be around 9us) has a gap, always at the same position (like 5us high, 2us low and 2us high.

I tried different sketches, different hardware and also visualized the IR signal with an oscilloscope.

I’m going to rest and will continue tomorrow or the weekend.

(Enc-X) #26

Try test with simple code on Arduino hardware and just transmit your codes. I’m afraid that ESP implementation of IR library is not so good as for Arduino. Unfortunatelly I can’t test because I don’t have device with problems.

(Mario) #27

I managed to make it work.

Looks like the problem I had is only with certain IR codes, so I just avoided them. Fortunately all the codes I need for what I want to do with my Yamaha receiver are working now.

Thank you very much for your code. It’s fantastic!