Broadlink rm-pro - change channels on the TV

There is a bit of a discussion in the following link that might be of assistance to you:

1 Like

Thank you. That kinda helped. I wound up doing scripts with groups to get my channels to change.

Script for remote buttons 0 - 9 for Dish Vip722

script:
  tv_channel_1:
    alias: Channel 1
    sequence:
      - delay:
          milliseconds: 400
      - service: broadlink.send_packet_192_168_13_142
        data:
          packet: 
            - "OABIAA7IDVwNXA1cDzQNXA1cDVwNXA1cDVwNXA1cDVwNXA1cDVwOyA1cDVwNXA80DVwNXA1cDVwNXA1cDVwNXA1cDVwNXA1cDwAMyw=="          
            
  tv_channel_2:
    alias: Channel 2
    sequence:
      - delay:
          milliseconds: 400
      - service: broadlink.send_packet_192_168_13_142
        data:
          packet: 
            - "OABIAA7IDVwNXA1cDzQNXA80DVwNXA1cDVwNXA1cDVwNXA1cDVwOyA1cDVwNXA80DVwPNA1cDVwNXA1cDVwNXA1cDVwNXA1cDwAMyw=="          
 
  tv_channel_3:
    alias: Channel 3
    sequence:
      - delay:
          milliseconds: 400
      - service: broadlink.send_packet_192_168_13_142
        data:
          packet: 
            - "OABIAA7IDVwNXA1cDzQPNA1cDVwNXA1cDVwNXA1cDVwNXA1cDVwOyA1cDVwNXA80DzQNXA1cDVwNXA1cDVwNXA1cDVwNXA1cDwAMyw=="          
 
  tv_channel_4:
    alias: Channel 4
    sequence:
      - delay:
          milliseconds: 400
      - service: broadlink.send_packet_192_168_13_142
        data:
          packet: 
            - "OABIAA7IDVwNXA80DVwNXA1cDVwNXA1cDVwNXA1cDVwNXA1cDVwOyA1cDVwPNA1cDVwNXA1cDVwNXA1cDVwNXA1cDVwNXA1cDwAMyw=="          
 
  tv_channel_5:
    alias: Channel 5
    sequence:
      - delay:
          milliseconds: 400
      - service: broadlink.send_packet_192_168_13_142
        data:
          packet: 
            - "OABIAA7IDVwNXA80DVwNXA80DVwNXA1cDVwNXA1cDVwNXA1cDVwOyA1cDVwPNA1cDVwPNA1cDVwNXA1cDVwNXA1cDVwNXA1cDwAMyw=="          
 
  tv_channel_6:
    alias: Channel 6
    sequence:
      - delay:
          milliseconds: 400
      - service: broadlink.send_packet_192_168_13_142
        data:
          packet: 
            - "OABIAA7IDVwNXA80DVwPNA1cDVwNXA1cDVwNXA1cDVwNXA1cDVwOyA1cDVwPNA1cDzQNXA1cDVwNXA1cDVwNXA1cDVwNXA1cDwAMyw=="          
 
  tv_channel_7:
    alias: Channel 7
    sequence:
      - delay:
          milliseconds: 400
      - service: broadlink.send_packet_192_168_13_142
        data:
          packet: 
            - "OABIAA7IDVwNXA80DzQNXA1cDVwNXA1cDVwNXA1cDVwNXA1cDVwOyA1cDVwPNA80DVwNXA1cDVwNXA1cDVwNXA1cDVwNXA1cDwAMyw=="          
 
  tv_channel_8:
    alias: Channel 8
    sequence:
      - delay:
          milliseconds: 400
      - service: broadlink.send_packet_192_168_13_142
        data:
          packet: 
            - "OABIAA7IDVwNXA80DzQNXA80DVwNXA1cDVwNXA1cDVwNXA1cDVwOyA1cDVwPNA80DVwPNA1cDVwNXA1cDVwNXA1cDVwNXA1cDwAMyw=="          
 
  tv_channel_9:
    alias: Channel 9
    sequence:
      - delay:
          milliseconds: 400
      - service: broadlink.send_packet_192_168_13_142
        data:
          packet: 
            - "OABIAA7IDVwNXA80DzQPNA1cDVwNXA1cDVwNXA1cDVwNXA1cDVwOyA1cDVwPNA80DzQNXA1cDVwNXA1cDVwNXA1cDVwNXA1cDwAMyw=="          
 
  tv_channel_0:
    alias: Channel 0
    sequence:
      - delay:
          milliseconds: 400
      - service: broadlink.send_packet_192_168_13_142
        data:
          packet: 
            - "OABIAA7IDVwPNA1cDVwNXA80DVwNXA1cDVwNXA1cDVwNXA1cDVwOyA1cDzQNXA1cDVwPNA1cDVwNXA1cDVwNXA1cDVwNXA1cDwAMyw=="         

Then to get Alexa to see the script I grouped them for each channel

group:
  TBS:
    name: TBS
    entities:
      - script.tv_channel_1
      - script.tv_channel_3
      - script.tv_channel_9
  F_X:
    name: F X
    entities:
      - script.tv_channel_1
      - script.tv_channel_3
      - script.tv_channel_6
  Adult_Swim:
    name: Adult Swim
    entities:
      - script.tv_channel_1
      - script.tv_channel_7
      - script.tv_channel_6  

Hi

How have you set up the following in your configuration.yaml:

switch youtube:
  - platform: broadlink
    host: 192.168.0.5
    mac: '34:ea:34:e0:ac:e5'
    switches:
      youtube_on:
        friendly_name: Youtube
        command_on: ‘JgDSAJSTEzcSNxM3EhMSEhMSExISExI3EjcTNxISExITEhITEhITNxITEhITNxI3EzcSNxMSEhMSNxI3ExITEhITEhITNxIABf6VkxM2EzcTNhMSExISExISExITNhM3Ez'

Because I have copied your script and group in my configuration.yaml and was wondering if I have set up broadlink correctly? i.e. the above code?

Also how have you managed to link this with alexa? as I have tried to search the channels I have set up in my alexa app but it did not discover any?

Why not using scripts for each channel?

  channel_1:
    sequence:
      - service: broadlink.send_packet_192_168_13_142
        data:
          packet: "code for first button to press"
      - delay: "00:00:05"
      - service: broadlink.send_packet_192_168_13_142
        data:
          packet: "code for second button to press"
      - delay: "00:00:05"
      - service: broadlink.send_packet_192_168_13_142
        data:
          packet: "code for third button to press"

I am using scripts but how can alexa activate a script for each channel? as I thought the emulated_hue component on alexa only sees switches and not scripts?!

You can use emulated_hue also for script. If you have more then 49 devices use this

Can you show me on how to setup scripts for emulated_hue, as I cannot set it up for alexa to discover the device? I have less than 49 devices

I am using a phone now. It’s easy, follow the link and add - script

here. Remember to add the custom_components of the link

emulated_hue:
  hue1:
    type: alexa
    listen_port: 8301
    target_ip: 192.168.1.92
    exposed_domains:
      - switch
      - script
      - light

sorry what do you mean by “add the custom_components of the link"

Download the git repository and copy the files intoe the Home Assistant configuration directory adding this directory
/custom_components/emulated_hue/

3 files into the new directory. Then reboot

EDIT, here if you used AIO installer:

\Raspberrypi\home assistant\custom_components\emulated_hue

My echo was only seeing one script for some reason.
Also, since there is only 10 buttons to send it makes cleaner code to use groups.

Try it without the “youtube” after “switch”

Here’s how I turn on an off my av components. Alexa sees all of them as switches

switch:      
  - platform: broadlink
    host: 192.168.13.142
    mac: 'b4430DFBDD71'
    switches:
      tv:
        friendly_name: "TV Power"
        command_on: 'JgAYAZWSFDYUNRQ1FREUERQRFBEUERQ1FTUUNRQRFREUERQRFBEUERQ1FBIUERQRFBEUERQRFDYUERQ1FDUVNRQ1FDYTNhQABfqVkhQ1FTUUNRQRFREUERQRFBETNhQ2FDUUERQRFBITEhQRExIUNRQRFBIUERQRFBEUERQ1FBIUNRQ1FDYUNRQ1FTUUAAX6lZIUNRU1FDUUERURFBETEhQRFDUUNhQ1FBEUERMTFBETEhQRFDUUERQSFBEUERQRFBEUNRQSFDUUNRQ2FDUUNRQ2FAAF+pOUFDUTNxM2ExITEhMTExITEhM2EzYUNhMSExITEhMSExMTEhM2ExITEhMSExMTEhMSEzYTEhM3EzYTNhQ2EzYTNxMADQU='
        command_off: 'JgAYAZWSFDYUNRQ1FREUERQRFBEUERQ1FTUUNRQRFREUERQRFBEUERQ1FBIUERQRFBEUERQRFDYUERQ1FDUVNRQ1FDYTNhQABfqVkhQ1FTUUNRQRFREUERQRFBETNhQ2FDUUERQRFBITEhQRExIUNRQRFBIUERQRFBEUERQ1FBIUNRQ1FDYUNRQ1FTUUAAX6lZIUNRU1FDUUERURFBETEhQRFDUUNhQ1FBEUERMTFBETEhQRFDUUERQSFBEUERQRFBEUNRQSFDUUNRQ2FDUUNRQ2FAAF+pOUFDUTNxM2ExITEhMTExITEhM2EzYUNhMSExITEhMSExMTEhM2ExITEhMSExMTEhMSEzYTEhM3EzYTNhQ2EzYTNxMADQU='     
      audio:
        friendly_name: "Receiver"
        command_on: 'JgBYAAABJ5AVEBU0FRAUEBU1FBAVNBU1FBAVEBU0FTQVEBU0FTQVEBU0FTQVEBU0FRAVEBQ1FTQVEBQQFTQVEBU0FTQVEBUQFAAFFAABJkgVAAw5AAEnSBUADQU='
        command_off: 'JgBYAAABJ5AVEBU0FRAUEBU1FBAVNBU1FBAVEBU0FTQVEBU0FTQVEBU0FTQVEBU0FRAVEBQ1FTQVEBQQFTQVEBU0FTQVEBUQFAAFFAABJkgVAAw5AAEnSBUADQU='  
      satellite:
        friendly_name: "Satellite"
        command_on: 'JgCOAA3LDV0MXQ1dDF0NOA1dDF0NXQxeDF0NXQxdDV0MXgxdDV0Myw1dDF4MXQ1dDDkMXQ1dDF0NXQxeDF0NXQxdDV0MXQ1dDMwNXQxeDF0NXQw5DF0NXQxdDV0MXgxdDF4MXQ1dDF0NXQ7KDF0NXQxeDF0NOAxeDF0NXQxdDV0MXQ1dDF4MXQ5cDF0Oyg4ADQUAAAAAAAAAAAAA='
        command_off: 'JgCOAA3LDV0MXQ1dDF0NOA1dDF0NXQxeDF0NXQxdDV0MXgxdDV0Myw1dDF4MXQ1dDDkMXQ1dDF0NXQxeDF0NXQxdDV0MXQ1dDMwNXQxeDF0NXQw5DF0NXQxdDV0MXgxdDF4MXQ1dDF0NXQ7KDF0NXQxeDF0NOAxeDF0NXQxdDV0MXQ1dDF4MXQ5cDF0Oyg4ADQUAAAAAAAAAAAAA=' 

what is the purpose of this code below that you have used?:

My script can be seen by Alexa now but it does not see it as a group so for example it sees each channel like 1, 3 and 9 instead of channel 139.

This is what I have in my configuration.yaml:

script:
  tv_smart_hub:
    alias: Smart Hub
    sequence:
      - service: broadlink.send_packet_192_168_0_5
        data:
          packet:
            - "OABIAA7IDVwNXA1cDzQNXA1cDVwNXA1cDVwNXA1cDVwNXA1cDVwOyA1cDVwNXA80DVwNXA1cDVwNXA1cDVwNXA1cDVwNXA1cDwAMyw=="

  tv_right:
    alias: Right
    sequence:
      - service: broadlink.send_packet_192_168_0_5
        data:
          packet:
            - "JgDgAFERFhEWERYRFhEWERYRFxAqERYRFhEWERcAA4JRERYRFhEWERYRFhEWERYRKhEWERYRFhEWAAOCUBIWERYRFhEWEhUSFhEWESkRFhIVEhUSF"

  tv_select:
    alias: Select
    sequence:
      - service: broadlink.send_packet_192_168_0_5
        data:
          packet:
            - "JgDgAFEQKhEWERcQFxAXEBcRFhEqEBcQFxAXERYAA29RECoRFhEXEBcQFxAXERYRKREXEBcQFxAXAANuUREqEBcRFhEWERYRFhEWESoRFhEWERYRF"

and I have grouped the scripts as follows:

group:     
  Sky:
  name: Sky News
  entities:
   - script.tv_smart_hub
   - script.tv_right
   - script.tv_select

Sorry, the default view is unnecessary. It just puts the groups together on the homepage.

Try indenting.

group:     
  Sky:
    name: Sky News
    entities:
      - script.tv_smart_hub
      - script.tv_right
      - script.tv_select

Nope it doesnt like it. Alexa cannot detect the group but detects the individual scripts. Can I see how you have set up your Alexa (emulated hue)?

Not much to my emulated hue. All it is, is

emulated_hue:

If your Alexa is seeing individual scripts you can group them in Alexa.
My Alexa only saw one script so setting up groups in HA worked for me.

thank you everything working fine now. I setup emulated hue as:

emulate_hue:

can I ask you the delays that you have put, does it delay in changing from channel 1 to 2 or is it the duration of which the channel 1 is pressed for on the screen?

Isn’t a remote the best way to change channels?

1 Like