Controlling IR devices from Home Assistant
The idea of this post is to have a remote control for devices that use IR (infrared), How can TV be?, music chain, a fan, the air conditioning, the projector… everything centralized and that we can control it from Home Assistant.
Well, that, 'non-smart' devices, that are controlled by a remote control or remote control using infrared or IR, we can control them with a 'universal remote control', In my case I use the Broadlink RM Mini3, which apart from being a small and cheap device will allow us to learn the buttons on our controls. Normally each IR device receives an IR code to perform a function, give more volume, light, to switch off… We will learn these codes and send them from Home Assistant when we are interested.
Once we receive our Broadlink RM Mini 3 We can reset it with a clip from behind if we need, and with the official Broadlink app on Android or iOS we will connect you to our Wifi network. The bad thing about this Broadlink RM Mini3 is that it only supports 2.4Ghz networks, so if your mobile is connected to the 5Ghz band it will give you horror. So temporarily I recommend that you force the SSID of your Wifi to 2.4Ghz on your AP., go through the process of putting it into your Wi-Fi network with your mobile and once the process is finished, re-enable the 5Ghz band. Another drawback to take into account is that it only allows 32 characters when writing your Wifi password, so be careful too.
Once the above has been resolved and we have the Broadlink RM Mini 3 connected to our network, (I recommend that you assign it a fixed IP address), the Home Assistant will have discovered it! that easy!
Now we have nothing left but to learn keys! It's time to power Home Assistant with the keys of the IR controls that we want to replace! If we go to the Developer Tools, In Services we can try to learn our first command, we select in service 'remote.learn_command’ and we introduce the following YAML, yes indeed, each one to put their corresponding name. This would be to learn the 'most volume’ from the Movistar decoder:
service: remote.learn_command data: entity_id: remote.broadlink_rm_mini3_remote device: deco_movistar command: deco_volumen_mas command_type: ir timeout: 10
And if we want to test that it works, From here we could send said key or another that we have learned, we put the following, and if everything has gone well, Home Assistant will increase the volume of our TV decoder:
service: remote.send_command data: entity_id: remote.broadlink_rm_mini3_remote device: deco_movistar command: deco_volume_more
And well, Then we can create Scripts or Automations that call these remote IR commands. To do this,, as you see in “Action type” we will indicate 'Call service’ and then 'Remote: Send Command’, We can now choose our Broadlink RM Mini3 entity and select a device and send it a command!
And then we can make personalized remote controls, or directly in our floor plan call any remote IR command, marvelous! On the house plan you click your finger on the fan, and, it lights up!
Hoping that some document will be useful to you, If you want you can nominate me for the Princess of Asturias 😉 Not for this document, if not so that the family values me! ha ha ha, A hug, smacker, May it go very well and thank those of you who share this content on social networks.!