After years of playing around with Philips Hue and never being really happy about it, I switched to Home Assistant. I installed it on a Raspberry Pie, added a ZigBee USB-Stick and never looked back.
It’s simply amazing. Fully customisable, everything local. And zero problems.
There was only one thing I wished it had. Infrared output. I wanted to remote control devices that only had IR-Input. I tried two Broadlink devices, and both sucked. The first just didn’t want to connect to a properly secured wifi, the other one was buggy as hell. I needed something better. And I found it.
Setting it up is sadly a bit harder than the usual “a couple of clicks” in Home Assistant.
Things you need:
To enable the support for the Tuya IR, you need to install a small script:
- Create a folder called
custom_zha_quirksin your config directory
- Copy the ts1201.py into that directory
- Add these lines to the
config.yamlto enable the file:
zha: custom_quirks_path: custom_zha_quirks
- Restart Home Assistant
Now you should have everything configured to try it out.
Add the device to your system
Initiate the pairing process by pressing the button on the device for around 5 seconds till the LED starts blinking. You will be able to add the device in Home Assistant now.
Navigate to the ZHA configuration page and click on the “Add Devices” button. The device should show up as “Tuya Zigbee IR Blaster ZS06”. Click on it and wait for the pairing process to finish.
After the device was added, navigate to it and click on the “…” button in the device info box. Click on “Manage zigbee device” to open the device configuration page. There you can send commands to the device.
Select the “
ZosungIRControl” cluster and the “
IRLearn” command. Your dialog
now should look like this:
Press “Issue Zigbee command” and then the blue led should start to light up, indicating that the device is waiting for an IR code.
After you pressed a button on the remote, you should see a message in the logs.
Navigate to the log page in Home Assistant:
Download the full file. In the file search for “
Ir message really totally
received:”. The following line should contain the IR code you need to send to
emulate the button press.
You can now test the code by selecting the “IRSend” command and paste the code into the “code” field. Click on “Issue Zigbee command” and the device should send the IR code.
If everything works, you can now create a script to send the code. For that you
need to grab the
ieee code that is shown in the device info box after you
expanded the “Zigbee info”. The
cluster_id is the ID of the
cluster, in my case 0xe004. Convert that to decimal and you get 57348. The
command in my case is “IRSend (id: 0x0002)”, which translates to decimal 2 and
the command type is always “server”.
The final script should look like this:
cluster_id: 57348 # = 0xe004
Now you have everything you need to control your IR devices.
The only downside of this approach is that you need to look up the IR codes for every button in the output of the log file. I would love to have a way to see the codes in real time, but I haven’t found a way to do that yet.