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: ‘’
namadori
(Namadori)
January 19, 2018, 11:44am
2
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!!!
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
finity
January 19, 2018, 11:56am
3
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.
namadori
(Namadori)
January 19, 2018, 12:17pm
4
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?
Sunonline
(Sun K)
January 19, 2018, 12:23pm
5
Broadlink as a switch platform. This is the way I do for multiple broadlinks
configuration.yaml
switch: !include_dir_list config/switches/
create config folder and switches as sub-folder inside config folder
make individual broadlink.yaml file example broalink1.yaml and broadlink2.yaml inside switch folder
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==’
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’
finity
January 19, 2018, 12:24pm
6
yup. I did agree with you first!
namadori
(Namadori)
January 19, 2018, 12:25pm
7
Today i learned the existance of command !include_dir_list
. Thanks
1 Like
finity
January 19, 2018, 12:29pm
8
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: 'sgB4Ag4NDQ0NDQ4MDgwODQ0NDQ0ODA4NDQ0NqhsNDRobDA4aDRobDA4aGwwbDA4aGwwOGRsNDRobDA4aDRobDA4aDRobDRoNDhkOGQ4aDhkOGhoNDhkOGhoNGwwbDRoNDhkbDRoNGw0NGhoNGwwOGg0aDhoaDQ0aDhkOGg0aDhkOGg0aDhkbDRsMGw0NGhsMGw0aDRsMGw0aDRsMGw0NAANJDgwODA4NDQ0NDQ4MDg0NDQ0NDgwODA6qGwwOGhsMDhkOGhsMDhkbDRsMDhkbDQ0aGw0NGhsMDhoNGhsMDhoNGhsMGw0NGg4ZDhoNGg4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NDhkOGg0aDhkOGhoNDhkOGhsMGwwbDRsMDhkbDRsMGw0NGhsMGw0NGg4ZDhoNGg4ZDhoNGg4ZDhoNGhsMDhoaDRsMGw0aDRsMGw0aDRsMGw0bDA4ZGw0NAANJDgwODQ0NDQ0ODA4MDgwODQ4MDgwODQ2qGwwOGhoNDhkOGhsMDhoaDRsMDhkbDQ4ZGwwOGhsMDhoNGhsMDhkOGhsMGw0NGg4ZDhoNGg4ZGw0NGg4ZGw0bDBsNGg0OGRsMGw0bDA4ZGw0bDA4ZDhoOGQ4ZDhoOGQ4aDRoOGQ4ZGw0OGRsNGg0bDBsNGg0bDBsNGwwbDBsNDRobDA4ABdwAAAAAAAAAAAAAAAA='
thank you Sunonline and finity, both options works. many thanks all.
1 Like
Sunonline
(Sun K)
January 20, 2018, 6:25am
10
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.
Sunonline
(Sun K)
January 20, 2018, 6:41am
13
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.
Sunonline
(Sun K)
January 20, 2018, 6:57am
14
After get temperature working. You might find this post also very interesting.
Please advice the step I do.
make the temperature.yaml from rm pro in sensor: to get sensor.xxx_temperature
make the climate.yaml from rm pro in climate: to link to xxx.ini file. Is this yaml file located same folder in <confg/custom_components/climate/>
Is the xxx.ini file has to be in <config/custom_components/broadlink_climate_codes/>
Finally got it. Thank you very much again.
[office_ac]
you are the sun online thank you so much! learning more everyday! and loving it.
1 Like
Sunonline
(Sun K)
January 20, 2018, 7:17am
16
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
Sunonline
(Sun K)
January 20, 2018, 7:35am
18
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
How about creating my own icon? can I do that?