Controlling IR devices using Orvibo AllOne IR blaster and openHAB
Background
I have been an openHAB user for around 3 months and have the majority of my house lights converted to INSTEON using dimmer switches as well as INSTEON Micro On/Off modules installed internally to control all of the roller shutters. Before using openHAB, I had used the INSTEON app to control the lights and shutters. The INSTEON way of setting up groups was time consuming and the app rarely worked externally even though I forwarded the ports correctly.
This guide focuses on the next step of my openHAB configuration which was setting up the Orvibo AllOne IR blaster to control my Air Conditioner (split system).
My Air Conditioner is brand new but does not contain any âsmartâ features to control it, it just came with an Infrared remote. This guide will explain how to use the Orvibo Python library and learn and emit IR commands using two different sitemap display types in openHAB: On/Off switch and Button press.
Install Exec binding
The guide makes use of the exec binding to run python scripts. You will need to have this installed.
Getting Orvibo Python library (cherezovâs)
The Python library created by @Pavel_Cherezov is excellent. It enables you to control both the AllOne product and the S20 Socket product.
Download the zip file from Github hereâŠ
The only file I am using is orvibo.py that you will find in the orvibo folder.
I used FileZilla to transfer the file to /home/pi/orvibo/orvibo.py
Learning and testing IR codes manually
Launch a terminal session and change directory to /home/pi/orvibo
Run the orvibo.py using the python3 interpreter.
This shows that I have both an irda device and a socket device.
The IP address of my AllOne IR blaster is 192.168.1.82
Note: In my modem, I have added my orvibo devices to the static lease list so the DHCP server will assign them the same IPs each time.
As an example I will be using my air conditioner remote.
The next command with the -t argument saves the IR code to a file called test-ac-on.ir.
As soon as you hit enter to run the command, your AllOne will light up red and wait for you to point your remote and press a button to learn.
The final command with the -e argument emits the IR code from the file called test-ac-on.ir.
As soon as you enter enter, your AllOne will transmit the code, print out the device details and say Done.
Repeat the above steps to save an .ir file for every button press you would like to learn.
You will end up with a collection or .ir files.
Items and Sitemap
Now comes the time to make the Switch item that is going to represent the air conditioner being on or off.
I defined an item in my items file called AirConditioner. It runs the Orvibo Python script with the -e argument for emitting IR.
Switch AirConditioner âAir Conditionerâ <climate> {exec=â>[ON:python3 /home/pi/orvibo/orvibo.py -i 192.168.1.82 -e /home/pi/orvibo/ac-turn-on.ir] >[OFF:python3 /home/pi/orvibo/orvibo.py -i 192.168.1.82 -e /home/pi/orvibo/ac-turn-off.ir]â} Switch ACPowerful âPowerfulâ <climate> {exec=â>[ON:python3 /home/pi/orvibo/orvibo.py -i 192.168.1.82 -e /home/pi/orvibo/powerful.ir]â, autoupdate=âfalseâ}
Note: The autoupdate set to false enables this to be a push button rather than On/Off.
I have dedicated a frame for Climate in my sitemap file. Here is a section of my sitemap file.
Frame label=âClimateâ { Switch item=AirConditioner Switch item=ACPowerful mappings=[ON=âPowerfulâ] }
The mappings parameter enables me to have a single button with Powerful text inside.
Final result
This is the final result and what it looks like on my phone.
In the future I wish to add more buttons. It currently works extremely well with openHAB. I have had 100% reliability.
A big thank you to the openHAB developers, @Pavel_Cherezov and the community forum.
Enjoy.
-robinson