Where broadlink remote commands are stored?

Wasn’t actually hard to find…

/config/.storage/broadlink_remote_34##########d_codes

2 Likes

Hello,
how to delete a command stored in file? if i remove manually this reapper at reboot

That sounds strange. I’m sorry to ask but did you save the file?

Anyways the json file is just a file with the codes you have learnt, it’s not what is actually in your configuration if I understand it correctly.
So there is no harm in keeping old codes there.

I would like to know too. So I would just copy the codes to another broadlink.

Did you figure how to delete old codes? My naming convention is wrong and I would like to start over on some of the codes learned already.

This has all changed in 0.115 and for the better IMHO.

Previously I used the Broadlink Manager Windows program to lean key presses and then paste these into yaml switches/scripts. Now you can use the remote.learn_command service in developer tools to learn codes much quicker:

All codes for a remote get stored in a file within the \config.storage folder:

image

Even better you can then send a code by calling the remote.send_command service and specify the remote name and command name in the service data rather than a long b64 code. Its all in the docs:

Yes, I understand. I want to delete some of the codes in the broadlink_remote_24dfa7f1167e_codes file and start over since I labeled it incorrectly.

If you re-learn an existing command with a new code then the command will be overwritten.

If you want to change the name of commands, e.g. to make them better or more consistent, then I don’t know how you would do that without editing the file (or deleting the Integration and starting from scratch). The docs say not to do it so take care if you decide to proceed.

I would suggest that you first make a backup copy of the file so that you can restore it in case you mess up. Also start with a small easy change first to check that you can edit the file successfully, don’t try and do everything all at once.

Seems like there is no easy way to remove selective ir code in the .storage folder than to delete the device(s) from the Broadlink integration. Likely, I only started with one Broadlink device.

You just have to change remote.send_command by remote.delete_command

1 Like

At the time of the question, this function had not yet been implemented.

Now, my doubt is: if I copy the codes from one file and paste it in another, will it work? I have two broadlink and two identical remote controls… I didn’t want to have to copy all the codes again

I’m able to learn and send IR codes okay but I don’t seem to have a /config/.storage/ folder. I have checked in File editor and via Samba and cannot see any folder.
Where else can I look?

I don’t seem to have this folder or is it hidden?

It is hidden. Any time you see a file name starting with period (.), it’s usually a hidden folder. If you are using samba, there is a view tab on top of windows explorer. Click on it and check box that says Hidden Items

Ah! Thanks so much. Easy when you know but I’m finding all this a steep learning curve a the moment.
So many bits of technology to learn and my ‘Unix’ knowledge went rusty sometime around 1998 !

Ok, I’ve figured out how to make edits to the broadlink_remote_*_codes file sort of by accident. I haven’t yet figured out if all of the steps are required, but it does work to the point of adding a new code via call service adds it to the right device segment/node in the codes file.

It’s roughly this order:

  1. back up your existing broadlink_remote_*_codes file (JIC)
  2. disable delete the integration for that broadlink device (my codes file was untouched after this process)
  3. make your changes to the codes file
  4. restart core/supervisor (this is the part that may or may not be necessary?)
  5. re-enable re-add the integration
  6. continue to add other codes & notice your file isn’t overwritten after a change

I had to do this because I had forgot to change device & I was adding codes to the wrong device. I re-org’d my file & tried adding another code & watched my changes disappear in Notepad++. I did the process above & now my file is right & again, I added 2 more codes to another device & the codes ended up in the right spot.

Also, step 4 or 5 might have to be flipped. I’ve slept since I’ve last done this.

4 Likes

Thank you so much. very helpful.

I wanted to edit the codes, but feared that I may loose some configuration values if I delete the integration (I have 2 broadlink devices and wanted to copy codes from one to the other). I followed the steps described by LAYGO, but instead of deleting the integration in step 2, I just disabled it. That worked just fine too !

1 Like

Good to hear!

I have 2 Broadlink devices too, so deleting the integration did NOT effect either files, but good to know that disabling works.

Is there anyway to just get a list of the commands within HA? I’ve forgot a few commands and just need to refresh my memory.

1 Like