IR transmitters

ir
binding
hardware
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… https://github.com/cherezov/orvibo
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

Hi.

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:

irtrans01/receiver/#

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:

1;0;1000;0|2;1000;7445;1|3;8445;235;0|4;8680;1237;1|5;9917;4544;0|6;14461;555;1|7;15016;1707;0|8;16723;533;1|9;17256;597;0|10;17853;555;1|11;18408;576;0|12;18984;533;1|13;19517;576;0|14;20093;512;1|15;20605;597;0|16;21202;533;1|17;21735;597;0|18;22332;533;1|19;22865;597;0|20;23462;533;1|21;23995;597;0|22;24592;533;1|23;25125;597;0|24;25722;533;1|25;26255;1707;0|26;27962;555;1|27;28517;1685;0|28;30202;576;1|29;30778;1685;0|30;32463;533;1|31;32996;1707;0|32;34703;555;1|33;35258;1707;0|34;36965;555;1|35;37520;1707;0|36;39227;533;1|37;39760;1728;0|38;41488;555;1|39;42043;1707;0|40;43750;555;1|41;44305;576;0|42;44881;533;1|43;45414;576;0|44;45990;533;1|45;46523;597;0|46;47120;533;1|47;47653;576;0|48;48229;533;1|49;48762;597;0|50;49359;533;1|51;49892;597;0|52;50489;533;1|53;51022;1707;0|54;52729;555;1|55;53284;576;0|56;53860;533;1|57;54393;1707;0|58;56100;555;1|59;56655;1707;0|60;58362;555;1|61;58917;1707;0|62;60624;555;1|63;61179;1707;0|64;62886;555;1|65;63441;1707;0|66;65148;555;1|67;65703;1707;0|68;67410;555;1|69;67965;576;0|70;68541;533;1|71;69074;597;0|72;69671;533;1|73;70204;597;0|74;70801;533;1|75;71334;597;0|76;71931;555;1|77;72486;576;0|78;73062;533;1

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: https://github.com/markszabo/IRremoteESP8266/issues/27

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!

Mario.