I’d like to be able to add a templated remote, like we can do for an alarm control panel, for example (see docs).
My specific use case is that I’m using a ZigBee device which is not respecting ZigBee standards, so I’m using a quirk. But the quirk is not yet integrated, and it is not producing a Remote entity, so you need to call into its services directly, which is cumbersome. People are developing all types of hacks to be able to make this less painful, but it is very painful nonetheless.
A templated remote would ease a lot of that pain, allowing us to simply call the underlying learn/send ZigBee commands.
Such templated remote should be able to store the codes it learned somewhere. I don’t know the best way to do this, but I’ve seen the implementation from LocalTuya, where they save in a json file. Something like that would be good enough, but I don’t care about this details so much. What I can say about it is that it makes it very easy to reuse codes, for example, if you have more than one device of a type you simply edit the json file, copying the json nodes and changing the device name.
I was going to hack something quick as it does not seem like a super hard task but 1. I’m not an expert in Python and 2. this seems complex for someone that doesn’t know the inner workings of Home Assistant. I’ve seen a custom templated climate entity, and it seems simple. These projects would be what I’d use to build such an implementation.
They would be repetitive. If I have 10 devices I control with the IR blaster I’d need to create 10 template buttons with the exact same yaml, only varying the infrared code.
If I have a templated remote it would mimic the existing, physical device, which, at this moment, does not offer yet a Remote entity. Only the one entity for the existing one physical device.
Another reason I have for this is I’d have hundreds of unnecessary buttons. Because of the way air conditioners frequently work (all 4 at my home are like this), they send the whole configuration whenever you press any key (for example: temperature x cold x fan speed). This means I have to record hundreds of IR codes, and that would create hundreds of templated buttons.
At the moment I’m using a wifi IR remote which shows in HA as a Remote (I’m switching to ZigBee) and the climate template I linked. All I need to do is detect the change from HA and, using standard names, compose the name of the command, from the hundred codes I already recorded.
No, with the remote I’d need only one Remote, the one that matches the physical one.
The commands are saved in the device’s database, as I showed in the current example, with LocalTuya.
A template remote wouldn’t be hard to implement, but I don’t think it gives the user any benefits. It essentially would just allow you to create a switch that has the ability to send commands.
I have been working on getting everything in order, and there is one use case that has been taking much more time: learning the IR codes. With the built-in service call it is as easy as listing tens of codes, and then pressing the physical remote buttons in order. Now I need to do one by one, recording every code learned and pasting it in the file.
It is a lot of work.
I’m not sure if there is an easy way to solve this. When I get to the air conditioner this will take at long time, as there are hundreds of combinations…
In my case, I would like to use Remote template to split a physical/real remote entity of a hub (like Broadlink, Tuya IR through LocalTuya) into multiple remote entities that I can use in the Universal TV Card.
This should make configuring the card a lot simpler, as I could just make the template entity mimic the command names of an Android TV remote entity, and therefore the card would self-configure.
I’m also interested in using it for connecting non Airplay TVs to the native remote integration with HomeKit. Currently I can create switches to emulate the TV but I cannot expose it as a remote entity to the native IOS remote feature.
Currently I’m using Tuya local as well with a generic Chinese IR blaster.
I will likely implement this in the future however we need to wait for a few PRs to go through to fix other aspects of template sensors before this can be added.