Broadlink learn codes without the physical remote?

With the new update the Broadlink remotes become a integration and I assume the proper thing to do is to remove the old “switch” based Broadlink and do the remote.learn?

The problem is that one remote has been lost. I have the codes that is needed but when I read here it says:

You can open this file with a text editor and copy the codes to set up a custom switch, but beware: the files in the .storage folder should never be edited manually .

Why? I learned two devices and I see the file look like:

{
    "version": 1,
    "key": "broadlink_remote_34ea34b2f6ea_codes",
    "data": {
        "forstarkaren": {
            "Volym upp": "JgBoAAABKJMUERM3ExIUNhQ2EzcUNhQRFDYUERM3FBETEhQRFBETNxMSFDcSExI4EjgUERMSExITNxQREzcUERMSEzcTNxQ2FAAFGAABJ0oTAAxYAAEoSRMADFgAAShJFAAMVwABKEkUAA0F",
            "Volym ner": "JgBgAAABKJMSExI4EhMTNxM3EzcTNxMSEzcTEhM3EhMTExETEhMSOBM3EzcTEhM3FDYTEhMSExITEhMSEzcTEhQRFDYUNhM3EwAFGQABKEkUAAxXAAEnShMADFgAASdKEwANBQAAAAAAAAAA"
        },
        "TV": {
            "Volym ner": "JgBQAFgeDh4ODw4OLCwODw4PDg8ODg8ODw4PDg4PDg8ODx0dDg8ODx4ACtZZHg4dDw4PDiwsDg8ODg8ODw4ODw4PDg8ODw4PDg8dHQ4PDg8cAA0FAAAAAAAAAAA=",
            "Volym upp": "JgBYAFkeDh0PDg4PDh4dDg8ODw4ODw4PDg8ODw4PDg8ODw4PHR0ODw4ODw4PAArJWB4PHQ4PDg8OHh0ODg8ODw4PDg8ODw4ODw4PDg8ODg8dHQ4PDg8ODw4ADQU="
        }
    }
}

I could easily just do:

{
    "version": 1,
    "key": "broadlink_remote_34ea34b2f6ea_codes",
    "data": {
        "forstarkaren": {
            "Volym upp": "JgBoAAABKJMUERM3ExIUNhQ2EzcUNhQRFDYUERM3FBETEhQRFBETNxMSFDcSExI4EjgUERMSExITNxQREzcUERMSEzcTNxQ2FAAFGAABJ0oTAAxYAAEoSRMADFgAAShJFAAMVwABKEkUAA0F",
            "Volym ner": "JgBgAAABKJMSExI4EhMTNxM3EzcTNxMSEzcTEhM3EhMTExETEhMSOBM3EzcTEhM3FDYTEhMSExITEhMSEzcTEhQRFDYUNhM3EwAFGQABKEkUAAxXAAEnShMADFgAASdKEwANBQAAAAAAAAAA"
        },
        "TV": {
            "Volym ner": "JgBQAFgeDh4ODw4OLCwODw4PDg8ODg8ODw4PDg4PDg8ODx0dDg8ODx4ACtZZHg4dDw4PDiwsDg8ODg8ODw4ODw4PDg8ODw4PDg8dHQ4PDg8cAA0FAAAAAAAAAAA=",
            "Volym upp": "JgBYAFkeDh0PDg4PDh4dDg8ODw4ODw4PDg8ODw4PDg8ODw4PHR0ODw4ODw4PAArJWB4PHQ4PDg8OHh0ODg8ODw4PDg8ODw4ODw4PDg8ODg8dHQ4PDg8ODw4ADQU="
        },
        "MISSING_REMOTE": {
            "SOME_BUTTON": "CODE1=",
            "SOME_OTHER_ BUTTON": "CODE2="
        }
    }
}

And it will still be valid json. Why is that not “allowed”?
Is it HA breaking or integration breaking, or just the remote breaking?

The “official” advice is to never manually edit files in .storage/ because they’re meant to be managed solely by the system…but if you know what you’re doing, you can edit them. I know I have plenty of times. Just make sure to make a copy of the file before editing in case you mess something up.

That makes sense.
Thank you!

But I also just remembered that I have one broadlink device still in the cloud which also has the same codes.
I could probably use the broadlink app to blast the codes to the other broadlink.

But it will probably be easier to just edit the file.

Oh wow… I did not expect this…

I opened my states page in one browser window, and the services in another.
I could now fire the learn command in one browser window and trigger the switch (send) command from the other window and the same broadlink device could both learn and send the command.

That was unexpected and very cool…

1 Like