Hardware for sending IR commands?

Does anyone know if there is a device that can turn commands sent from OpenHAB into IR data to control a TV? Would this even be the best way to do this? I took a quick look through the bindings hoping that would lead me to a product, but came up empty handed. Any help in this would be appreciated. Pretty much, I just want to control functions of my TV and sound system that I usually use on my remote through HABPanel on OpenHAB.


I made my own. I took an RPi, installed an IR LED on the GPIO pins and installed LIRC.
I wrote a simple Python script that gets commands from OH2 via MQTT and sends the commands to the TV.
The LIRC database didn’t have all the TV remote key sequences my TV supports but has enough for channel changing and turning ON/OFF. Using LIRC it is possible to add to the database by using an IR photo-detector but I haven’t done that.
I use a SONOS Playbar for sound so the SONOS binding handles volume levels.

1 Like

search for IR blaster. e.g. https://www.amazon.com/Wi-Fi-Smart-Remote-Controller-Supported/dp/B00NAYFI5K

Here you go:

And the binding:

Alternatively you could also use the Logitech Harmony stuff. But that’s more expensive. I use both, because i got a good deal on a Harmony lately. The harmony is more comfortable, the broadlink stuff is far cheaper.

1 Like

I second the RM3 - though I use a different method of control.
https://github.com/eschava/broadlink-mqtt (currently supports a single device)
https://github.com/psyciknz/broadlink-mqtt (currently supports multiple devices - but the eschava version will be moving to mulitple device support.

I use an ESP8266 with ESPeasy for hardware.
I use a zwave door switch as a trigger. So when the door is opened it sends an IR code to esp8266 that changes the TV to HDMI 2. When the door is closed, it sends the IR code for HDMI 1.

This allows me to simply open a drawer and my tv switches to my camera system connected to HDMI 2.

For less than $10 you could use your phone to send IR codes to the esp.

I’m about to build one of these are test out https://www.mysensors.org/build/ir

Thanks for all of the suggestions everyone - I really do appreciate it.

1 Like

I timbukthree the broadlink RM2 / RM3 devices, they will let you control everything with a remote through 1 app on your phone via the e control app, make macros, schedule items etc, and soon thanks to Cato we will be able to do all that and more with OH!
The RM3 (only IR) is really cheap, you can find them for around 13$, for that price its worth a try…

i got one coming now :smiley: looks good

I have a question for those who use ir blasting device. The problem I see with it is that there is no way to know the status of the device I want to controll. This is not a problem for IR commands that are stateless, but for example on/off switch is an ON command when device is off and OFF command when device is ON. For example when i turn the device on manualy, OpenHAB will still think it is off. So the question is how it is working for You ?

A couple of options I’ve thought about doing for AC but someone grabs the AC remote instead of openHab and turns on/off.

  • Have a IR Receiver somewhere near the AC unit which captures any commands sent to it and updates openHab (has the benefit of knowing what settings are currently set).
  • Monitor the power usage of the unit to tell if it is on or not. Downside is I still won’t know what settings are running but this would work for a wider range of devices that can be controlled by non IR.
  • Put a LED color sensor to monitor power LED (if it has one)

Hello can you explain the whole procedure? Examples of openhab, MQTT, Liric I would be grateful thank you

I have no plans to write a tutorial but if you wish to pursue this path, I would suggest you first look at the LIRC databse at http://www.lirc.org/ to see if the devices you want to control are currently supported. If they are not, you can still configure your own remote if you are willing to spend the time and effort to read your remote and create a new database entry.
Second, get an RPi. Basically any RPi would be okay, even an RPiZero or RpiZero W. Once you get it up and running you will need to install the LIRC software which you can do with apt-get.
Third, get an IR LED and connect to a GPIO port and test if it works. There are a lot of online resources that show how to do that. You can see an IR LED blinking by using your phone camera.
Fourth, install mosquitto.
Fifth, if you plan to control your device with Python, you will need to install the Python-lirc and MQTT libraries. I used paho-mqtt for my script and irsend to control the GPIO.
Sixth, create items in OH2 that are set up with the MQTT binding. Of course you will need to make sure you have already set up your MQTT Broker in OH2. Items in OH2 will only need to send messages to the RPi that is running your Lirc control script.
Seventh, add items to your sitemap or HABPanel.

If you ask specific questions about any one of these steps, I would be happy to respond.

1 Like

thank you As long as I have leisure time I will try to settle your advice

A good MQTT tutorial is homeautomationforgeeks.com that’ll get you started for sure

http://www.zmote.io/ works fine for me

1 Like

Please do not simply link to the main page of an outside source. I can’t even find a good MQTT tutorial there. One has to wonder…

Anyhow. To learn about MQTT there is probably no better resource than http://www.hivemq.com/blog/mqtt-essentials/

What about: http://www.irtrans.de