Broadlink (remote): copy codes to another entity

Hi,

explanation

I have multiple broadlink remotes (docs).

When I use remote.learn_command to learn an ir code, it will save it to a database related to the remote device, for example, it will save codes learned on remote A in /config/.storage/broadlink_remote_23dde4f45b9a_codes and those for remote B in /config/.storage/broadlink_remote_15dee4f48b2b_codes.

This is fine in theory, but now when I try to run a code learned on remote A via remote B, I will get Fehler beim Aufrufen des Diensts remote.send_command. Unknown error. When I run this command via remote A, it works fine.

These files are in .json format, so I can try manually copying the learned codes from remote B’s file to remote A’s file. However, I run Home Assistant on a local server via docker; the dockerfile seems to have been created in a way that it writes all (or most) data in /config/.storage as root within docker. So even though I have mounted the remote docker path on my local computer, I cannot edit these files (instead, I have to ssh to the local server, then edit them there) due to insufficient rights (mounted via sshfs).

feature request

Allow learned codes to be collected in a central database, so that multiple remotes can access the codes - instead of having to learn codes per remote or having to manually edit files.

why

Other than the reason mentioned above (which is rather special / individual), I could imagine one that could benefit everybody:

if people used multiple broadlink remotes, perhaps they’d place them all around their house (or even set them up for other people, such as parents, via homeassistant.remote); in this case, it’d be so much more convenient to have one dedicated broadlink on ones desk to learn all codes, then replay those codes on other devices (basement, attic) without having to learn those codes directly on those remote devices.

While it doesn’t directly address your FR, you may want to look at the SmartIR custom integration which allows you to create media player, fan, or climate entities based on the combination of a remote and a set of commands.

1 Like

Thank you. It looks like a great project, but did not work for me. I followed the instructions, but no codes were sent via my broadlink remote. One can tell by observing the device itself, it will flash a yellow light whenever it sends IR data.

When I use my current automations or trigger remote.send_command via developer tools, it will send IR data; when I do it via SmartIR, nothing happens. There is no error, but also no actual sending code.

I will investigate further, as this seems like a great solution for my problem. None of the codes that come with the project work for me, but since it is possible to use custom json files with my codes, it’d be perfect. Still wish that Home Assistant could do this be default…

1 Like

+1 for this request.
I have 4 Broadlinks remote at the moment and it would be very helpful if remote codes would be shared in a single codes file used by all of them. So no matter from witch Broadlink you learn the code, you’ll be able to control the device from every Broadlink.

1 Like

Same here. Just got a second Broadlink RM4 mini and I expected to be able to simply “reuse” the codes by pointing to the new device as new target. +1 for this request.