Multiple broadlinks

Hi all
I have more two broadlinks, I am not able to add the second broadlink with the following code.
error was duplicated key ‘host’
Anyone please advise me what is the correct way>
Many Thanks.

  • platform: broadlink
    host: 10.0.0.18
    mac: ‘34:ea:34:e4:79:33’
    timeout: 15
    switches:
    tv_living:
    friendly_name: “Living TV”

      command_on: 'JgDgAAAD24ITPhQ/EkAUPxMfEx8SPxQfE0ESHxFBEx8SIBIfEh8SIBNAEUIRHxNAEx8TQBEfEkERAAEkg4IRQBMAA3wSQBJBEh8THxFAEx8TQBMfEkATHxEiESARIBIhEkARQRIfE0ERIBFBEx8SQQ8AASSDghNAEj8UQBFBEx8TAAN7Ej8UHxJAEx8QQRMfEyARHxQfEiASQBFBEx8RQhAgEkISHxNAEAABI4ODEkARQRJAE0ESHxMfEEETHxNAEwADfBJBER8TIBIfFB4RIBNAEj8UHxFCER8SQRMfEUIQAA0FAAAAAAAAAAA='
    

    ########################
    host: 10.0.0.20
    mac: ‘b4:43:0d:fc:1c:97’
    timeout: 15
    switches:
    tv_family:
    friendly_name: “Family TV”
    command_on: ‘’
    command_off: ‘’

It seems a Yaml formatting error, but we can’t be sure until you post again your configuration as requested in the top blue banner in every page of the forum!!! :roll_eyes:

Please surround the code with three backticks ``` to preserve spacing and indentation.

P.S.: I don’t mean to be rude, but it seems everyone makes the same mistake again. Indentation is fundamental in Yaml, without the backticks is impossible to find errors.

2 Likes

Agree with above but from just looking at what you have posted it looks like you need to put a new “platform” and a - in front of each “platform”. That’s what turns it into list. Otherwise it just sees two hosts in the same entity and can’t figure out what you mean.

Yes, it seems very likely he used the ###### as a separator instead of the yaml list item. But why loose an opportunity to teach a little about the forum usage? :wink:

Broadlink as a switch platform. This is the way I do for multiple broadlinks

  1. configuration.yaml
    switch: !include_dir_list config/switches/

  2. create config folder and switches as sub-folder inside config folder

  3. make individual broadlink.yaml file example broalink1.yaml and broadlink2.yaml inside switch folder

  4. broadlink1.yaml
    platform: broadlink
    host: !secret ip_pro1
    mac: !secret mac_pro1
    timeout: 30
    friendly_name: “Pro1”
    type: rm
    switches:
    #Talaykaew 5
    kitchen_light_2:
    friendly_name: “kitchen light 2”
    command_on: ‘sgCMAAojCyMLIwsjCiMjDAsjIwwLIyMMIwwjDCMMCyMLIwsjCwABXwwiCyMjDAsjIwwKJCMMCyILJAsiCyMLIwsjIwwLIyMMCiQiDCMNIwwiDQsiDCIMIwoAAWALIwsjIwwLIyMMCyMiDQsjCiMLIwsjCyMLIyMMCyMjDAsjIg0jDCMMIwwLIwsjCyMLAAXcAAAAAAAAAAAAAAAA6QpCAN8JFgkWCRYJFgkJFhYJFgkJFgkWFgkWCQkWFgkWCRYJCRYWCRYJCRYWCRYJFgkJFgkWCRYJFgkWCRYJFhYJCRYJFukKQgDfCRYJFgkWCRYJCRYWCRYJCRYJFhYJFgkJFhYJFgkWCQkWFgkWCQkWFgkWCRYJCRYJFgkWCRYJFgkWCRYWCQkWCRY=’
    command_off: ‘sn40AAwjJA0MIyUMDSMkDCUMJAwNIyUMDCMMIwwAAWMMIwwjJAwMIyQMDCMkDAwjDCMMIwwjDCMAAAAA’
    kitchen_aircon:
    friendly_name: “kitchen aircon”
    command_on: ‘JgBAAGoAAUESMxESEBIQEhA0EBIREREREREREREREREREhERERESEBIyEhARMxIQEhASMhIQEhASMhIyETMSEBEADQUAAAAAAAAAAA==’
    command_off: ‘JgBAAGYAAUYPNQ8TDxMPEw81DxMPEw8TDzYONg8TDxMPEw8TDxMPEw8TDxMPFA4TDxMQNA8UDjYREQ8TDxMPNQ8ADQUAAAAAAAAAAA==’

  5. broadlink2.yaml
    platform: broadlink
    host: !secret ip_pro2
    mac: !secret mac_pro2
    timeout: 30
    friendly_name: “Pro2”
    type: rm
    switches:
    #kitchen
    dining_light:
    friendly_name: “dining light”
    command_on: ‘shY0AA0jJAskDA0jDSIkDA0jDSMMIyQLDQABYw0jDSIkDA0jDSIkDCQMDCMNIg0jDSINIyQMJAsAAAAA’
    command_off: ‘sgY0AA0jJQwNIg0jJAwkDA0jDSINIg4iDSIkDCUMDSMkCyQMDSINIyQMDSMNIiUMDSMNAAFkDSMAAAAA’
    kitchen_light:
    friendly_name: “kitchen light”
    command_on: ‘sgY0AA0jJQwNIg0jJAwkDA0jDSINIg4iDSIkDCUMDSMkCyQMDSINIyQMDSMNIiUMDSMNAAFkDSMAAAAA’
    command_off: ‘sgY0AA0jJQwNIg0jJAwkDA0jDSINIg4iDSIkDCUMDSMkCyQMDSINIyQMDSMNIiUMDSMNAAFkDSMAAAAA’

yup. I did agree with you first! :smiley:

Today i learned the existance of command !include_dir_list. Thanks :+1:

1 Like

Here is also what you can do if you don’t want to split the config into multiple files as Sunonline suggested:

- platform: broadlink
  host: 192.168.1.121
  mac: '34:EA:34:D0:AB:19'
  timeout: 15
  switches:
    tv_phillips:
      friendly_name: "Phillips Tv Power"
      command_on: 'JgAcAB0dHB44HhweGx4cHR06HB0cHhwdHB8bHhwADQUAAAAAAAAAAAAAAAA='
      command_off: 'JgAaABweOR4bHhwdHB4dHRw6HhsdHR0dOTocAA0FAAAAAAAAAAAAAAAAAAA='
- platform: broadlink
  host: 192.168.1.125
  mac: '32:EF:56:D9:AH:23'
  timeout: 15
  switches:
    master_bedroom_light:
      friendly_name: "Master Bedroom Light"
      command_on: 'sgB4Ag4NDQ0NDQ4MDgwODQ0NDQ0ODA4NDQ0NqhsNDRobDA4aDRobDA4aGwwbDA4aGwwOGRsNDRobDA4aDRobDA4aDRobDRoNDhkOGQ4aDhkOGhoNDhkOGhoNGwwbDRoNDhkbDRoNGw0NGhoNGwwOGg0aDhoaDQ0aDhkOGg0aDhkOGg0aDhkbDRsMGw0NGhsMGw0aDRsMGw0aDRsMGw0NAANJDgwODA4NDQ0NDQ4MDg0NDQ0NDgwODA6qGwwOGhsMDhkOGhsMDhkbDRsMDhkbDQ0aGw0NGhsMDhoNGhsMDhoNGhsMGw0NGg4ZDhoNGg4ZGw0NGg4ZGw0aDRsMGw0NGhsMGw0aDQ4ZGw0bDA4ZDhoNGhsMDhoN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Gg4ZDhoNGg4ZDhoNGg4ZDhoNGhsMDhoaDRsMGw0aDRsMGw0aDRsMGw0bDA4ZGw0NAANJDgwODQ0NDQ0ODA4MDgwODQ4MDgwODQ2qGwwOGhoNDhkOGhsMDhoaDRsMDhkbDQ4ZGwwOGhsMDhoNGhsMDhkOGhsMGw0NGg4ZDhoNGg4ZGw0NGg4ZGw0bDBsNGg0OGRsMGw0bDA4ZGw0bDA4ZDhoOGQ4ZDhoOGQ4aDRoOGQ4ZGw0OGRsNGg0bDBsNGg0bDBsNGwwbDBsNDRobDA4ABdwAAAAAAAAAAAAAAAA='

thank you Sunonline and finity, both options works. many thanks all.

1 Like

If you use rm pro. When you finish add the switch platform. You can have that in sensor platform to get the temperature from rm pro as well. This will give you sensor.office_temperature

sensor:
  platform: broadlink
  update_interval: 60
  host: !secret ip_pro1
  mac: !secret mac_pro1
  name: Office
  icon: mdi:temperature-celsius
  monitored_conditions:
    - temperature

Hi Sunonlin, thanks very much, I have the two broadlinks on one yaml file called tv.yaml, do I add the ip address for the broadlink again for the sensor?

O got it, I have to, thanks.

yes same broalink ip that you use but in different platform.

First platform is switch platform to get the switch.
Second platform is sensor platform to get the temperature.

After get temperature working. You might find this post also very interesting.


you are the sun online thank you so much! learning more everyday! and loving it.

1 Like

very nice. since you have so many tab. you can change tab name to icon. also the thunder icon by use group platform and homeassistant customize platform.

I see, I will look into it, more youtube searching, my wife is not going to be happy. haha

icon for ha can be found here https://materialdesignicons.com/

###Groups Tab view###
#Office

  office_view:
    view: yes
    icon: mdi:atom
    name: Office
    entities:
     - group.office
     - group.mp_1
     - group.sensor_node_1_card

Customzie:
  switch.kitchen_aircon:  <== entity_id
    friendly_name: Kitchen Aircon  <== name to display frontend
    icon: mdi:air-conditioner  <== icon

great, many thanks.

How about creating my own icon? can I do that?