Yaml creater from Broadlink Manager

I just learnt a few codes and realized I still had to write stuff or do lots of copy paste in the configuration. :thinking:
Once you save the codes from Broadlink Manager you get a file called Commands.json when you click on the yellow folder icon to the right.
Open the file commands and copy all the content.

Paste it over my json in this online PHP console
Broadlink Manager -> yaml
Press eval

The output at the bottom is correctly indented yaml with the commands you learnt.
Just select the yaml from the bottom and up and copy, to make sure you get all the spaces.
The code assumes the command_on and command_off is the same, which most IR commands is unless you made something advanced.
But if you just learn those commands after each other then it’s easy to just delete the stuff in between(1).

I just figured I wanted to share an easier way than copy pasting every single command.

(1) Example:

I get this output:

    switches:
      boxen_onoff:
        friendly_name: "Boxen on/off"
        command_on: 'JgBoAAABJ5MTNxM3EjgSNxMTEhMSExMSExITNxM3ExITEhMTEhMSOBITEjgSExITEzcSExMSExITNxMSEzcTNxMSEzcTNxM3EgAFPwABJ0oSAAxVAAEnShIADFUAASdKEwAMVQABJ0kTAA0F'
        command_off: 'JgBoAAABJ5MTNxM3EjgSNxMTEhMSExMSExITNxM3ExITEhMTEhMSOBITEjgSExITEzcSExMSExITNxMSEzcTNxMSEzcTNxM3EgAFPwABJ0oSAAxVAAEnShIADFUAASdKEwAMVQABJ0kTAA0F'
      boxen_volume_up:
        friendly_name: "Boxen volume up"
        command_on: 'JgB4AAABKJMTNhM3EzcTNxMSExITEhMTEhMSOBI3ExMSExMSExITNxM3ExITNxM3EhMTEhMSExITExI3ExMSExI4EjcTNxM3EwAFPgABJ0oUAAxTAAEpRxUADFIAASpHFQAMUgABKUgUAAxTAAEpRxUADFMAASlHFQANBQ=='
        command_off: 'JgB4AAABKJMTNhM3EzcTNxMSExITEhMTEhMSOBI3ExMSExMSExITNxM3ExITNxM3EhMTEhMSExITExI3ExMSExI4EjcTNxM3EwAFPgABJ0oUAAxTAAEpRxUADFIAASpHFQAMUgABKUgUAAxTAAEpRxUADFMAASlHFQANBQ=='
      boxen_volume_down:
        friendly_name: "Boxen volume down"
        command_on: 'JgB4AAABKZEVNRU1FTUVNRUQFRAVEBUQFREUNRU1FRAVERQRFRAVNRUQFTUVNRU0FREVEBUQFRAVNRUQFRAVEBU1FTUVNRU1FQAFPAABKUcVAAxSAAEpSBUADFIAASlHFQAMUwABKEgVAAxSAAEoSRQADFMAAShJFQANBQ=='
        command_off: 'JgB4AAABKZEVNRU1FTUVNRUQFRAVEBUQFREUNRU1FRAVERQRFRAVNRUQFTUVNRU0FREVEBUQFRAVNRUQFRAVEBU1FTUVNRU1FQAFPAABKUcVAAxSAAEpSBUADFIAASlHFQAMUwABKEgVAAxSAAEoSRQADFMAAShJFQANBQ=='
      boxen_mute:
        friendly_name: "Boxen mute"
        command_on: 'JgBwAAABKJITNxQ2EzcTNxITEhMTEhMSExITNxM3ExITEhMTEhMSOBI3FDYUNhQ2ExITEhMTEhMSExMSExITEhM3EzcTNxM3EwAFPgABJ0oSAAxVAAEoSBMADFUAASdJEwAMVQABJ0kTAAxUAAEoSRMADQUAAAAAAAAAAA=='
        command_off: 'JgBwAAABKJITNxQ2EzcTNxITEhMTEhMSExITNxM3ExITEhMTEhMSOBI3FDYUNhQ2ExITEhMTEhMSExMSExITEhM3EzcTNxM3EwAFPgABJ0oSAAxVAAEoSBMADFUAASdJEwAMVQABJ0kTAAxUAAEoSRMADQUAAAAAAAAAAA=='

But I want my volume to be command on = up, and command off = down.
This part here:

        command_off: 'JgB4AAABKJMTNhM3EzcTNxMSExITEhMTEhMSOBI3ExMSExMSExITNxM3ExITNxM3EhMTEhMSExITExI3ExMSExI4EjcTNxM3EwAFPgABJ0oUAAxTAAEpRxUADFIAASpHFQAMUgABKUgUAAxTAAEpRxUADFMAASlHFQANBQ=='
      boxen_volume_down:
        friendly_name: "Boxen volume down"
        command_on: 'JgB4AAABKZEVNRU1FTUVNRUQFRAVEBUQFREUNRU1FRAVERQRFRAVNRUQFTUVNRU0FREVEBUQFRAVNRUQFRAVEBU1FTUVNRU1FQAFPAABKUcVAAxSAAEpSBUADFIAASlHFQAMUwABKEgVAAxSAAEoSRQADFMAAShJFQANBQ=='

Which is the command off of volume up and the commad on of volume down is removed to make the yaml

    switches:
      boxen_onoff:
        friendly_name: "Boxen on/off"
        command_on: 'JgBoAAABJ5MTNxM3EjgSNxMTEhMSExMSExITNxM3ExITEhMTEhMSOBITEjgSExITEzcSExMSExITNxMSEzcTNxMSEzcTNxM3EgAFPwABJ0oSAAxVAAEnShIADFUAASdKEwAMVQABJ0kTAA0F'
        command_off: 'JgBoAAABJ5MTNxM3EjgSNxMTEhMSExMSExITNxM3ExITEhMTEhMSOBITEjgSExITEzcSExMSExITNxMSEzcTNxMSEzcTNxM3EgAFPwABJ0oSAAxVAAEnShIADFUAASdKEwAMVQABJ0kTAA0F'
      boxen_volume_up_down:
        friendly_name: "Boxen volume up/down"
        command_on: 'JgB4AAABKJMTNhM3EzcTNxMSExITEhMTEhMSOBI3ExMSExMSExITNxM3ExITNxM3EhMTEhMSExITExI3ExMSExI4EjcTNxM3EwAFPgABJ0oUAAxTAAEpRxUADFIAASpHFQAMUgABKUgUAAxTAAEpRxUADFMAASlHFQANBQ=='
        command_off: 'JgB4AAABKZEVNRU1FTUVNRUQFRAVEBUQFREUNRU1FRAVERQRFRAVNRUQFTUVNRU0FREVEBUQFRAVNRUQFRAVEBU1FTUVNRU1FQAFPAABKUcVAAxSAAEpSBUADFIAASlHFQAMUwABKEgVAAxSAAEoSRQADFMAAShJFQANBQ=='
      boxen_mute:
        friendly_name: "Boxen mute"
        command_on: 'JgBwAAABKJITNxQ2EzcTNxITEhMTEhMSExITNxM3ExITEhMTEhMSOBI3FDYUNhQ2ExITEhMTEhMSExMSExITEhM3EzcTNxM3EwAFPgABJ0oSAAxVAAEoSBMADFUAASdJEwAMVQABJ0kTAAxUAAEoSRMADQUAAAAAAAAAAA=='
        command_off: 'JgBwAAABKJITNxQ2EzcTNxITEhMTEhMSExITNxM3ExITEhMTEhMSOBI3FDYUNhQ2ExITEhMTEhMSExMSExITEhM3EzcTNxM3EwAFPgABJ0oSAAxVAAEoSBMADFUAASdJEwAMVQABJ0kTAAxUAAEoSRMADQUAAAAAAAAAAA=='
2 Likes