Tv sony trinitron, broadlink and base 64 codes for remote control

Hi folks!
I’ve spent more than 8 hours on this challenge, I hope can help someone in the future.

Here below you can find all the key mapping for Sony Trinitron remotes (e.g. RM-833, RM-831, RM-837…) and is also included a sequence to enter the service mode (for the Sony KV-X2901A in specific).

All the best.

#POWER
sony_remote_power:
    sequence:
       - action: remote.send_command
         target:
            entity_id: remote.telecomando_universale
         data:
            command: b64:JgEcAFIQKREWESkRFhEpERYRFhEpERYRFhEWERUAA0YNBQAAAAAAAAAAAAA=

#KEYS NUMBERS
sony_remote_key_1:
    sequence:
       - action: remote.send_command
         target:
            entity_id: remote.telecomando_universale
         data:
            command: b64:JgEcAFIQFhEWERYRFhEWERYRFhEpERYRFhEWERUAA4ENBQAAAAAAAAAAAAA=
            
sony_remote_key_2:
    sequence:
       - action: remote.send_command
         target:
            entity_id: remote.telecomando_universale
         data:
            command: b64:JgEcAFIQKREWERYRFhEWERYRFhEpERYRFhEWERUAA20NBQAAAAAAAAAAAAA=

sony_remote_key_3:
    sequence:
       - action: remote.send_command
         target:
            entity_id: remote.telecomando_universale
         data:
            command: b64:JgEcAFIQFhEpERYRFhEWERYRFhEpERYRFhEWERUAA20NBQAAAAAAAAAAAAA=
            
sony_remote_key_4:
    sequence:
       - action: remote.send_command
         target:
            entity_id: remote.telecomando_universale
         data:
            command: b64:JgEcAFIQKREpERYRFhEWERYRFhEpERYRFhEWERUAA1oNBQAAAAAAAAAAAAA=

sony_remote_key_5:
    sequence:
       - action: remote.send_command
         target:
            entity_id: remote.telecomando_universale
         data:
            command: b64:JgEcAE8TExMTEycTExMTExMTExMnExMTExMTExMAA3kNBQAAAAAAAAAAAAA=

sony_remote_key_6:
    sequence:
       - action: remote.send_command
         target:
            entity_id: remote.telecomando_universale
         data:
            command: b64:JgEcAE4TJxMTEycTExMTExMTExMnExMTExMTExMAA1wNBQAAAAAAAAAAAAA=
            
sony_remote_key_7:
    sequence:
       - action: remote.send_command
         target:
            entity_id: remote.telecomando_universale
         data:
            command: b64:JgEcAFIQFhEpESkRFhEWERYRFhEpERYRFhEWERUAA1oNBQAAAAAAAAAAAAA=
            
sony_remote_key_8:
    sequence:
       - action: remote.send_command
         target:
            entity_id: remote.telecomando_universale
         data:
            command: b64:JgEcAFIQKREpESkRFhEWERYRFhEpERYRFhEWERUAA0YNBQAAAAAAAAAAAAA=
            
sony_remote_key_9:
    sequence:
       - action: remote.send_command
         target:
            entity_id: remote.telecomando_universale
         data:
            command: b64:JgEcAFIQFhEWERYRKREWERYRFhEpERYRFhEWERUAA20NBQAAAAAAAAAAAAA=

sony_remote_key_0:
    sequence:
       - action: remote.send_command
         target:
            entity_id: remote.telecomando_universale
         data:
            command: b64:JgEcAFIQKREWERYRKREWERYRFhEpERYRFhEWERUAA1oNBQAAAAAAAAAAAAA=
            
sony_remote_key_102nd:
    sequence:
       - action: remote.send_command
         target:
            entity_id: remote.telecomando_universale
         data:
            command: b64:JgEcAFIQKREWESkRKREpERYRFhEpERYRFhEWERUAAzINBQAAAAAAAAAAAAA=

sony_remote_key_c:
    sequence:
       - action: remote.send_command
         target:
            entity_id: remote.telecomando_universale
         data:
            command: b64:JgEcAFIQFhEpESkRKREWERYRFhEpERYRFhEWERUAA0YNBQAAAAAAAAAAAAA=

#VOLUME SETTING    
sony_remote_volume_up:
    sequence:
       - action: remote.send_command
         target:
            entity_id: remote.telecomando_universale
         data:
            command: b64:JgEcAE8TExMnExMTExMnExMTExMnExMTExMTExMAA2cNBQAAAAAAAAAAAAA=
            
sony_remote_volume_down:
    sequence:
       - action: remote.send_command
         target:
            entity_id: remote.telecomando_universale
         data:
            command: b64:JgEcAE8TJxMnExMTExMnExMTExMnExMTExMTExMAA1QNBQAAAAAAAAAAAAA=

sony_remote_volume_muted:
    sequence:
       - action: remote.send_command
         target:
            entity_id: remote.telecomando_universale
         data:
            command: b64:JgEcAFIQFhEWESkRFhEpERYRFhEpERYRFhEWERUAA1oNBQAAAAAAAAAAAAA=

#CHANNEL SELECTION        
sony_remote_channel_up:
    sequence:
       - action: remote.send_command
         target:
            entity_id: remote.telecomando_universale
         data:
            command: b64:JgEcAE8TExMTExMTExMnExMTExMnExMTExMTExMAA3kNBQAAAAAAAAAAAAA=

sony_remote_channel_down:
    sequence:
       - action: remote.send_command
         target:
            entity_id: remote.telecomando_universale
         data:
            command: b64:JgEcAE4TJxMTExMTExMnExMTExMnExMTExMTExMAA2INBQAAAAAAAAAAAAA
            

#COLORS BUTTONS            
sony_remote_red_key:
    sequence:
       - action: remote.send_command
         target:
            entity_id: remote.telecomando_universale
         data:
            command: b64:JgEcAFIQFhEWESkRKREWERYRKREpESkRFhEWERUAAzINBQAAAAAAAAAAAAA=
            
sony_remote_green_key:
    sequence:
       - action: remote.send_command
         target:
            entity_id: remote.telecomando_universale
         data:
            command: b64:JgEcAFIQKREWESkRKREWERYRKREpESkRFhEWERUAAx8NBQAAAAAAAAAAAAA=
            
sony_remote_yellow_key:
    sequence:
       - action: remote.send_command
         target:
            entity_id: remote.telecomando_universale
         data:
            command: b64:JgEcAFIQFhEpESkRKREWERYRKREpESkRFhEWERUAAx8NBQAAAAAAAAAAAAA=
            
sony_remote_blue_key:
    sequence:
       - action: remote.send_command
         target:
            entity_id: remote.telecomando_universale
         data:
            command: b64:JgEcAFIQKREpESkRKREWERYRKREpESkRFhEWERUAAwsNBQAAAAAAAAAAAAA=
            
sony_remote_white:
    sequence:
       - action: remote.send_command
         target:
            entity_id: remote.telecomando_universale
         data:
            command: b64:JgEcAFIQFhEWERYRKREWERYRKREpESkRFhEWERUAA0YNBQAAAAAAAAAAAAA=

#MENU
sony_remote_menu:
    sequence:
       - action: remote.send_command
         target:
            entity_id: remote.telecomando_universale
         data:
            command: b64:JgEcAFIQFhEWERYRFhEWESkRKREpERYRFhEWERUAA1oNBQAAAAAAAAAAAAA= 

sony_remote_up:
    sequence:
       - action: remote.send_command
         target:
            entity_id: remote.telecomando_universale
         data:
            command: b64:JgEcAFIQFhEWESkRFhEpESkRKREpERYRFhEWERUAAzINBQAAAAAAAAAAAAA= 
            
sony_remote_down:
    sequence:
       - action: remote.send_command
         target:
            entity_id: remote.telecomando_universale
         data:
            command: b64:JgEcAFIQKREWESkRFhEpESkRKREpERYRFhEWERUAAx8NBQAAAAAAAAAAAAA= 

sony_remote_center:
    sequence:
       - action: remote.send_command
         target:
            entity_id: remote.telecomando_universale
         data:
            command: b64:JgEcAFIQFhEpESkRFhEpERYRFhEpERYRFhEWERUAA0YNBQAAAAAAAAAAAAA= 
            
#OTHER
sony_remote_tv:
    sequence:
       - action: remote.send_command
         target:
            entity_id: remote.telecomando_universale
         data:
            command: b64:JgEcAFIQFhEWERYRKREpESkRFhEpERYRFhEWERUAA0YNBQAAAAAAAAAAAAA= 
            
sony_remote_tv_info:
    sequence:
       - action: remote.send_command
         target:
            entity_id: remote.telecomando_universale
         data:
            command: b64:JgEcAFEQFhApEBYQKRApECkQFhApEBYQFhAWEBYAA3QNBQAAAAAAAAAAAAA=

sony_remote_tv_video:
    sequence:
       - action: remote.send_command
         target:
            entity_id: remote.telecomando_universale
         data:
            command: b64:JgEcAFIQKREWESkRFhEWESkRFhEpERYRFhEWERUAA0YNBQAAAAAAAAAAAAA=

#SERVICE MODE
sony_remote_service_mode:
    sequence:
       - action: remote.send_command
         target:
            entity_id: remote.telecomando_universale
         data:
           command: 
           - b64:JgEcAFEQFhApEBYQKRApECkQFhApEBYQFhAWEBYAA3QNBQAAAAAAAAAAAAA= 
           - b64:JgEcAE8TExMTEycTExMTExMTExMnExMTExMTExMAA3kNBQAAAAAAAAAAAAA=
           - b64:JgEcAE8TExMnExMTExMnExMTExMnExMTExMTExMAA2cNBQAAAAAAAAAAAAA=
           - b64:JgEcAFIQFhEWERYRKREpESkRFhEpERYRFhEWERUAA0YNBQAAAAAAAAAAAAA=            

Here a short guide:
1) Find your remote here https://lirc.sourceforge.net/remotes (e.g. https://lirc.sourceforge.net/remotes/sony/RM-833) 
2) Download IrScrutinizer 
3) Under the TAB Import, choose LIRC and use the "Load File/Url" button
4) Select the KEY, click the dx mouse button and choose "Scrutinized Selected"
5) Click on "Scrutinize signal" tab 
6) Copy the Pronto HEX values
7) Remove any white spaces from the Pronto HEX string 
8) Copy it here https://www.jdoodle.com/embed/v0/eBD and click Execute. 
9) Copy the result here to tranform HEX in base64 https://tomeko.net/online_tools/hex_to_base64.php?lang=en
10) Copy the result here https://dimagoltsman.github.io/Random-Broadlink-RM-Code-Generator/# (TAB Change Repeats) to introduce some repetition (1 is enough) 
11) insert the value into your script. 
12) Profit!