433mhz, infrared IR to and from MQTT on ESP8266

hi even in advance value it won’t be same every time. is there anything I need to change in user config to make it same value everytime?

this is what i receive

local/home/IRtoMQTTAdvanced	Value 1234563567 Bit 32 Protocol -1
local/home/sensors/ir	1234563567
local/home/IRtoMQTTAdvanced	Value 8275 Bit 16 Protocol 6
local/home/sensors/ir	8275
local/home/IRtoMQTTAdvanced	Value 676528128 Bit 32 Protocol 3
local/home/sensors/ir	676528128
local/home/IRtoMQTTAdvanced	Value 542310400 Bit 32 Protocol 3

nop nothing to change, you can exclude the first two lines.
What is the brand of your device?

its called classic ultra plus… even tried with set top box remote and pioneer car stereo remote it won’t be same.

Protocol 6 correspond to JVC
Protocol 3 to NEC which is the most common that I have seen.

Here is some ideas:
-put a normal led in place of your IR led and check if it light on when sending
-verify your wire and voltage with a multimeter
-try first with some basic device like your tv or hifi

Can anybody point me to more information on how to add libraries for IR devices that aren’t supported out of the box? I guess it probably has to do with the IRRemoteESP8266 library, but since this is such an active thread I thought I’d ask here :slight_smile: I have an Arcadyan HMB2260 set top box from my interactive TV provider for which I found a LIRC file, I would very much like to integrate this in the OpenMQTTGateway and HA.

Today I’ve successfully installed an OpenMQTTGateway setup, everything’s working fine now but couldn’t have done it without all the information that is shared here so thanks all! And especially @1technophile for all the work so far, great job!

Hello @michielrutjes,

Thanks for the feedback, regarding the OpenMQTTGateway setup I would like to know what did you found on this thread in particular? So as to add is on the wiki and avoid other user to lose some time.

About your IR device did you try to see if your remote control appear as an unknown procotol by setting into user_config.h #define pubIRunknownPrtcl true
instead of false

If you see some value with that you can try to reproduce these values with different protocols (I will begin with the default one NEC and try others.

Hey @1technophile,

During the installation and setup I encountered some errors which I was able to resolve by searching this topic. I’m not exactly sure what the specific errors were, but I could find them just by searching this topic or the exact error :slight_smile:

If there was anything I would like to be added to the wiki it is information on adding other/custom devices. Maybe I haven’t looked hard enough, but I couldn’t find the solution you proposed and I think it’s very useful information.

But mostly thanks for your reply, I’m going to try your solution and see if it works!

Edit: Tried it, but it doesn’t work unfortunately… Any other approaches you can suggest?

Hello,

Could you try the IRremote ESP8266 example IRrecvDumpV2.ino alone and check if you see something?

Yes, getting some response! Here’s a snippet, can you make anything of this?

Encoding  : UNKNOWN
Code      : 2219828 (32 bits)
Timing[21]: 
     + 550, - 800     + 200, - 600     + 400, - 850     + 500, - 700
     + 300, - 500     + 200, -1750     + 200, - 400     + 650, -1350
     + 300, - 500     + 500, - 700     + 650
unsigned int  rawData[21] = {550,800, 200,600, 400,850, 500,700, 300,500, 200,1750, 200,400, 650,1350, 300,500, 500,700, 650};  // UNKNOWN 2219828

Encoding  : UNKNOWN
Code      : 65DEC3F5 (32 bits)
Timing[27]: 
     + 250, - 700     + 650, - 800     + 200, - 450     + 550, - 700
     + 650, - 800     + 200, -1650     + 300, - 450     + 200, - 400
     + 600, - 750     + 250, -1050     + 600, - 800     + 500, - 450
     + 250, - 700     + 300
unsigned int  rawData[27] = {250,700, 650,800, 200,450, 550,700, 650,800, 200,1650, 300,450, 200,400, 600,750, 250,1050, 600,800, 500,450, 250,700, 300};  // UNKNOWN 65DEC3F5

When you say it doesn’t work, do you succeed in controling other devices by IR or do you test with this device only?
Did you try to publish 2219828 to MQTTtoIR?

I’m not saying it doesn’t work, I’m saying I don’t know where to start :slight_smile: I never figured to publish the code to MQTT. Now I tried that, but without success.

Down here is a dump from repeatedly pressing the same button, resulting in different codes and different timings. Holding the button down for a while will give similar results. I really don’t know how to interpret what I’m seeing so any help is appreciated, thanks so much!

Encoding  : UNKNOWN
Code      : 4DB5DAAA (32 bits)
Timing[7]: 
     + 400, -1400     + 550, - 850     + 450, -8700     + 300
unsigned int  rawData[7] = {400,1400, 550,850, 450,8700, 300};  // UNKNOWN 4DB5DAAA

Encoding  : UNKNOWN
Code      : D8CB5DD (32 bits)
Timing[21]: 
     + 200, - 800     + 550, -1450     + 500, - 800     + 550, - 800
     + 200, -1800     + 200, -1250     + 450, -1450     + 200, - 450
     + 250, - 500     + 200, -1200     + 450
unsigned int  rawData[21] = {200,800, 550,1450, 500,800, 550,800, 200,1800, 200,1250, 450,1450, 200,450, 250,500, 200,1200, 450};  // UNKNOWN D8CB5DD

Encoding  : UNKNOWN
Code      : BFE48DD9 (32 bits)
Timing[7]: 
     + 450, -1400     + 550, - 950     + 400, -8500     + 500
unsigned int  rawData[7] = {450,1400, 550,950, 400,8500, 500};  // UNKNOWN BFE48DD9

Encoding  : UNKNOWN
Code      : 99F3D5B7 (32 bits)
Timing[11]: 
     + 450, - 800     + 150, - 550     + 500, - 850     + 450, -4050
     + 450, -4050     + 500
unsigned int  rawData[11] = {450,800, 150,550, 500,850, 450,4050, 450,4050, 500};  // UNKNOWN 99F3D5B7

Encoding  : UNKNOWN
Code      : E9E70E8C (32 bits)
Timing[7]: 
     + 500, -1600     + 400, - 850     + 450, -8550     + 400
unsigned int  rawData[7] = {500,1600, 400,850, 450,8550, 400};  // UNKNOWN E9E70E8C

Encoding  : UNKNOWN
Code      : 24AE7D4E (32 bits)
Timing[5]: 
     + 500, -1500     + 450, -1050     + 300
unsigned int  rawData[5] = {500,1500, 450,1050, 300};  // UNKNOWN 24AE7D4E

Encoding  : UNKNOWN
Code      : 8D60D670 (32 bits)
Timing[23]: 
     + 300, - 850     + 500, -1500     + 500, - 800     + 500, - 800
     + 200, - 400     + 300, - 450     + 250, - 450     + 250, -2350
     + 250, -1700     + 250, - 500     + 200, - 500     + 500
unsigned int  rawData[23] = {300,850, 500,1500, 500,800, 500,800, 200,400, 300,450, 250,450, 250,2350, 250,1700, 250,500, 200,500, 500};  // UNKNOWN 8D60D670

Encoding  : UNKNOWN
Code      : A1E919E7 (32 bits)
Timing[31]: 
     + 300, - 750     + 600, - 800     + 200, - 500     + 500, - 700
     + 650, - 800     + 200, -1100     + 200, - 400     + 300, - 450
     + 250, - 450     + 550, - 800     + 200, - 450     + 200, -1050
     + 250, - 400     + 300, - 400     + 650, - 800     + 200
unsigned int  rawData[31] = {300,750, 600,800, 200,500, 500,700, 650,800, 200,1100, 200,400, 300,450, 250,450, 550,800, 200,450, 200,1050, 250,400, 300,400, 650,800, 200};  // UNKNOWN A1E919E7

Could you test first with a more common device, like your tv or dvd player, if one of them is recognised we will validate your setup.

Sorry for not giving complete information. I tested the setup successfully with my Samsung TV, it works perfectly. I’ve recorded the codes with the IR receiver and was able to send them to the TV through MQTT and even a switch in HA.

ok no problem.

Maybe there is something to explore with https://irdb.globalcache.com/Home/Database

and https://github.com/markszabo/IRremoteESP8266/blob/master/examples/IRGCSendDemo/IRGCSendDemo.ino

I saw that Arcadyan is into the database.

If you succeed in controling your box with the senddemo example we are not so far on integrating it with MQTT

Just added beacons detection to the gateway, thanks to an HM 10 module the gateway is now able to detect BLE beacons and their corresponding signals:

home/BTtoMQTT/445F3666113E -085
home/BTtoMQTT/7F04B36BA3F2 -085
home/BTtoMQTT/63F9FE29FBC2 -088
home/BTtoMQTT/CCCCCCCD1A4C -075
home/BTtoMQTT/445F3666113E -086
home/BTtoMQTT/7F04B36BA3F2 -086
home/BTtoMQTT/462C2834FFE1 -090
home/BTtoMQTT/63F9FE29FBC2 -085

Usefull for presence detection.

It works! I managed to get the “play/pause” toggle programmed for the interactive tv, so now the tv is stalling every 10secs :wink:

What’s the next step from here? I think I can hack this into your program, but is there perhaps a more elegant way?

Great, could you post an example of what data you are sending, i will check how to handle it throught mqtt?

This is the variable that I put in the IRGCSendDemo program:

Arcadyan_play_pause[73] = {56000,1,37,18,36,36,36,18,18,36,36,36,36,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,36,18,18,36,36,18,18,36,18,2304,18,36,36,36,18,18,36,36,36,36,18,18,18,18,18,18,18,18,18,18,36,36,18,18,36,18,18,36,36,18,18,36,18,2304};

This is the GC code for Arcadyan Play/Pause:

“PLAY PAUSE TOGGLE”,“sendir,1:1,1,56000,1,37,18,36,36,36,18,18,36,36,36,36,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,36,18,18,36,36,18,18,36,18,2304,18,36,36,36,18,18,36,36,36,36,18,18,18,18,18,18,18,18,18,18,36,36,18,18,36,18,18,36,36,18,18,36,18,2304”,“0000 004A 0012 0011 0012 0024 0024 0024 0012 0012 0024 0024 0024 0024 0012 0012 0012 0012 0012 0012 0012 0012 0012 0012 0012 0012 0012 0012 0012 0012 0024 0012 0012 0024 0024 0012 0012 0024 0012 0900 0012 0024 0024 0024 0012 0012 0024 0024 0024 0024 0012 0012 0012 0012 0012 0012 0012 0012 0012 0012 0024 0024 0012 0012 0024 0012 0012 0024 0024 0012 0012 0024 0012 0900”,

Could be done by adding raw data treatment into the gateway, we will also need to increase the max packet size of mqtt pubsubclient library. Let me some days I will try.

Awesome! Thanks so much for all the help so far. I think adding support for raw data would be great since theoretically all the devices in the GC database could be added. Please let me know if there’s anything I can help with! I would gladly help to test.