Hi. I’m having a bit of trouble setting up hassio with broadlink, I’ve added some lines in the configuration.yaml but it’s saying Unable to find component switches. I’ve run the file through the yaml checker and it says it’s fine. Any ideas what’s wrong? I can post the config file if it will help
Post your config. I have had the yaml checker miss configuration issues before.
Example configuration.yaml entry
switch:
- platform: broadlink
host: 192.168.0.29
mac: 34:ea:34:b5:2b:4e
switches:Will work on most Phillips TVs:
Lamp:
friendly_name: “Lamp”
command_on: ‘sgDmAB4MCSAeCwogHgsKHwogCh8eDAkAAUEJIAogCSAJIAofCiAJIAogCSAJIAofCiAKHx4MCSAeCwogHgsKIB4LCSAKIAkgHgwJAAFBCSAKIAkgCSAKHwogCSAKIAkgCSAKHwogCSAfCgogHgsKIB4LCh8fCwofCh8KIB4LCgABQQkgCSAKHwogCh8KIAkgCh8KIAkgCSAfCwkgHgsKIB4LCiAeCwkgHwseCx4MHgseCwoAAUEJIAofCiAJIAofCiAJIAkgCiAJIAogHgsJIB4MCSAeCwogHgsKHx8LHgsfCx4LHwsJAAXcAAA’
command_off: ‘sgC8AAofCh8KIB4LCiAeCwofHwsKHx8LCSAfCgogCh8KAAFBCh8KIAkgCh8KHwogCh8KHwogCh8KHwsfCh8fCwofHwoKIB4LCh8fCwofHwsKHwogCQABQQofCh8LHwofCiAKHwofCh8LHwofCiAeCwogHgsKHx8LCSAfCgogHwofCx8KHwseCwoAAUALHwofCh8LHwofCiAJIAofCiAKHwofHwsKHx8KCiAfCgofIAoKHx8LHwseCx8LHgsKAAXcAAAAAAAAAAAAAAAA’
Your config should look like this…
switch:
- platform: broadlink
host: 192.168.0.29
mac: 34:ea:34:b5:2b:4e
switches:
lamp:
friendly name: Lamp
command_on: ‘sgDmAB4MCSAeCwogHgsKHwogCh8eDAkAAUEJIAogCSAJIAofCiAJIAogCSAJIAofCiAKHx4MCSAeCwogHgsKIB4LCSAKIAkgHgwJAAFBCSAKIAkgCSAKHwogCSAKIAkgCSAKHwogCSAfCgogHgsKIB4LCh8fCwofCh8KIB4LCgABQQkgCSAKHwogCh8KIAkgCh8KIAkgCSAfCwkgHgsKIB4LCiAeCwkgHwseCx4MHgseCwoAAUEJIAofCiAJIAofCiAJIAkgCiAJIAogHgsJIB4MCSAeCwogHgsKHx8LHgsfCx4LHwsJAAXcAAA’
command_off: ‘sgC8AAofCh8KIB4LCiAeCwofHwsKHx8LCSAfCgogCh8KAAFBCh8KIAkgCh8KHwogCh8KHwogCh8KHwsfCh8fCwofHwoKIB4LCh8fCwofHwsKHwogCQABQQofCh8LHwofCiAKHwofCh8LHwofCiAeCwogHgsKHx8LCSAfCgogHwofCx8KHwseCwoAAUALHwofCh8LHwofCiAJIAofCiAKHwofHwsKHx8KCiAfCgofIAoKHx8LHwseCx8LHgsKAAXcAAAAAAAAAAAAAAAA’
When editing the yaml files pay close attention to spacing and indentation. Both are critical to getting the component to work.
Thanks, I’ll give it another go tomorrow.
Cheers
I’m pretty sure the config file is in the right format now, I’m using sublime text to edit it rather than notepad. I’m getting this error in the logs though -
‘ascii’ codec can’t encode character ‘\u2018’ in position 0: ordinal not in range(128)
Full log is below
2017-10-13 08:30:59 WARNING (MainThread) [homeassistant.setup] Setup of switch is taking over 10 seconds.
2017-10-13 08:31:06 ERROR (MainThread) [homeassistant.components.switch] Error while setting up platform broadlink
Traceback (most recent call last):
File “/usr/lib/python3.6/base64.py”, line 37, in _bytes_from_decode_data
return s.encode(‘ascii’)
UnicodeEncodeError: ‘ascii’ codec can’t encode character ‘\u2018’ in position 0: ordinal not in range(128)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “/usr/lib/python3.6/site-packages/homeassistant/helpers/entity_component.py”, line 164, in _async_setup_platform
SLOW_SETUP_MAX_WAIT, loop=self.hass.loop)
File “/usr/lib/python3.6/asyncio/tasks.py”, line 352, in wait_for
return fut.result()
File “/usr/lib/python3.6/asyncio/futures.py”, line 244, in result
raise self._exception
File “/usr/lib/python3.6/concurrent/futures/thread.py”, line 55, in run
result = self.fn(*self.args, **self.kwargs)
File “/usr/lib/python3.6/site-packages/homeassistant/components/switch/broadlink.py”, line 150, in setup_platform
device_config.get(CONF_COMMAND_OFF)
File “/usr/lib/python3.6/site-packages/homeassistant/components/switch/broadlink.py”, line 185, in init
self._command_on = b64decode(command_on) if command_on else None
File “/usr/lib/python3.6/base64.py”, line 80, in b64decode
s = _bytes_from_decode_data(s)
File “/usr/lib/python3.6/base64.py”, line 39, in _bytes_from_decode_data
raise ValueError(‘string argument should contain only ASCII characters’)
ValueError: string argument should contain only ASCII characters
2017-10-13 08:31:07 WARNING (MainThread) [homeassistant.setup] Setup of tts is taking over 10 seconds.
2017-10-13 08:31:19 WARNING (SyncWorker_7) [netdisco.ssdp] Found malformed XML at http://192.168.0.26:9080: status=ok
Hassio should function the same as any other version, this is the way I have my RM3 mini setup:
- platform: broadlink
host: 192.168.0.23
mac: '34:EA:34:88:D5:B9'
timeout: 15
switches:
tv:
friendly_name: "Samsung TV Power"
command_on: 'JgBGAJKVDzsQOhA6EBUQFRAVERQRFBE5EDoSOBEUERQRFBAVEBURFBE5ERQRFBAVERQRFBEUETkRFBE5ETkRORE5EToQOg8ADQUAAA=='
command_off: 'JgBGAJKVDzsQOhA6EBUQFRAVERQRFBE5EDoSOBEUERQRFBAVEBURFBE5ERQRFBAVERQRFBEUETkRFBE5ETkRORE5EToQOg8ADQUAAA=='
stereo:
friendly_name: "Samsung Blu-ray Power"
command_on: 'JgAwApKVETkRORETExIRFBETETkRFBE5ETkRExEUEzcRExI4EhMROREUERMRFBMRERQRFBISExIRORE5ETkRORE5ETkROREABeKSlRM3EzcSExEUERMRFBE5ERMRORE5EhMRFBE5ERMROREUETkRExEUERQRExEUERMRFBETEjgTNxI5ETkRORE5ETkTAAXgkpUTNxE5ERQRExITExIRORETETkROREUERMSOBITETkTEhE5ExETEhMREhMRFBETExIRExE5ETkRORM3EjgSOBI5EQAF4JSVETkROREUERMRFBETEjkRExE5ETkRFBETETkRFBE5ERQRORETERQRExITERMSExEUERMTNxM3ETkRORE5EzcTNxEABeOSlRM3EzcRFBMRERQTERI4EhMRORE5ExITERE5ERQRORETEzcTEhMSERMRFBETERQRFBETETkTNxE5ETkTNxE5ETkRAAXjkpUTNxE5ERQRExEUERMTNxEUETkROREUERMTNxEUETkTERM3ExITERMSERQSEhEUERMRFBM3ETkRORE5ETkTNxE5EwAF4ZOUETkRORETEhMRFBETETkRFBE5ETkRExEUETkTEhE5EhITNxMSExERFBEUERMRFBETERQRORE5EzcTNxE5EzcTNxEABeKSlRI4EjgSExEUERMRFBE5ERMRORE5ExIRFBE5ERMRORMSETkRExITERMSExEUERMTEhETETkRORE5EzcRORM3EzcSAA0FERQRExI5ERM=='
command_off: 'JgAwApKVETkRORETExIRFBETETkRFBE5ETkRExEUEzcRExI4EhMROREUERMRFBMRERQRFBISExIRORE5ETkRORE5ETkROREABeKSlRM3EzcSExEUERMRFBE5ERMRORE5EhMRFBE5ERMROREUETkRExEUERQRExEUERMRFBETEjgTNxI5ETkRORE5ETkTAAXgkpUTNxE5ERQRExITExIRORETETkROREUERMSOBITETkTEhE5ExETEhMREhMRFBETExIRExE5ETkRORM3EjgSOBI5EQAF4JSVETkROREUERMRFBETEjkRExE5ETkRFBETETkRFBE5ERQRORETERQRExITERMSExEUERMTNxM3ETkRORE5EzcTNxEABeOSlRM3EzcRFBMRERQTERI4EhMRORE5ExITERE5ERQRORETEzcTEhMSERMRFBETERQRFBETETkTNxE5ETkTNxE5ETkRAAXjkpUTNxE5ERQRExEUERMTNxEUETkROREUERMTNxEUETkTERM3ExITERMSERQSEhEUERMRFBM3ETkRORE5ETkTNxE5EwAF4ZOUETkRORETEhMRFBETETkRFBE5ETkRExEUETkTEhE5EhITNxMSExERFBEUERMRFBETERQRORE5EzcTNxE5EzcTNxEABeKSlRI4EjgSExEUERMRFBE5ERMRORE5ExIRFBE5ERMRORMSETkRExITERMSExEUERMTEhETETkRORE5EzcRORM3EzcSAA0FERQRExI5ERM=='
Thanks for the help. It was actually the wrong type of ’ mark I was using. I also needed to add some == at the end of the remote code
I’m needing a little help getting my RM Pros into HASSIO. When I add the lines below HASSIO ceases to load until I remove them. It passes the HASSIO config checker and YAML Lint, the IP and mac are correct. Any ideas on what I am missing?
switch:
- platform: broadlink
host: 192.168.1.101
mac: ‘B4:43:0D:FB:CC:EC’
timeout: 15
switches:TV:
tv_tcl:
friendly_name: “TCL Tv Power”
command_on: ‘’
command_off: ‘’
TV should be lower case, eg: tv
Thank you! For now I am just copying your snippet into my config (changing ip and mac) just to see if I can get the switch to show up. The log shows
2017-11-15 13:42:24 ERROR (SyncWorker_0) [homeassistant.util.yaml] while parsing a block mapping
in "/config/configuration.yaml", line 64, column 5
expected <block end>, but found '<block mapping start>'
in "/config/configuration.yaml", line 67, column 7
2017-11-15 13:42:24 ERROR (MainThread) [homeassistant.bootstrap] Error loading /config/configuration.yaml: while parsing a block mapping
in "/config/configuration.yaml", line 64, column 5
expected <block end>, but found '<block mapping start>'
in "/config/configuration.yaml", line 67, column 7
Here is my test code…
- platform: broadlink
host: 192.168.1.101
mac: 'B4:43:0D:FB:CC:EC’
timeout: 15
switches:
tv:
friendly_name: "Samsung TV Power"
command_on: 'JgBGAJKVDzsQOhA6EBUQFRAVERQRFBE5EDoSOBEUERQRFBAVEBURFBE5ERQRFBAVERQRFBEUETkRFBE5ETkRORE5EToQOg8ADQUAAA=='
command_off: 'JgBGAJKVDzsQOhA6EBUQFRAVERQRFBE5EDoSOBEUERQRFBAVEBURFBE5ERQRFBAVERQRFBEUETkRFBE5ETkRORE5EToQOg8ADQUAAA=='
Wrong quote at the end of the MAC address. You can spot it by the wrong syntax coloring.
This is better:
- platform: broadlink
host: 192.168.1.101
mac: 'B4:43:0D:FB:CC:EC'
timeout: 15
switches:
tv:
friendly_name: "Samsung TV Power"
command_on: 'JgBGAJKVDzsQOhA6EBUQFRAVERQRFBE5EDoSOBEUERQRFBAVEBURFBE5ERQRFBAVERQRFBEUETkRFBE5ETkRORE5EToQOg8ADQUAAA=='
command_off: 'JgBGAJKVDzsQOhA6EBUQFRAVERQRFBE5EDoSOBEUERQRFBAVEBURFBE5ERQRFBAVERQRFBEUETkRFBE5ETkRORE5EToQOg8ADQUAAA=='
I cannot begin to thank all of you enough for the help!
I ended up loading cariboo’s code into yamllint, changing my information. Once I pasted it into the config and restarted it came back up. I am not sure why it is exactly one more space over from other entities like the weather, but for whatever reason it is working and I can move forward with creating more switches.
Hi
I have 2x RM3 and 1x RM Pro+. RM Pro+ work great with all IR and RF devices added to HA. I got one RM3 working in HA but none of my second RM3’s entities are recognized in HA. I can confirm that the Mac address and IP are correct
I restarted and try to refresh several times but entities of my second RM3 are not getting added. All devices controlled via the second RM3 work with IHC and E-control app
Running HA ver 0.71 or latest
Much appreciate your help
My switches.YAML and Scripts.YAML attaches. I include the script in Groups and the call in front end
No errors found in config file check
scripts.yaml (2.1 KB)
switches.yaml (17.1 KB)
After adding this code in my configuration, i’m getting this error:
Error while setting up platform broadlink
Traceback (most recent call last):
File “/usr/local/lib/python3.6/site-packages/homeassistant/helpers/entity_platform.py”, line 128, in _async_setup_platform
SLOW_SETUP_MAX_WAIT, loop=hass.loop)
File “/usr/local/lib/python3.6/asyncio/tasks.py”, line 358, in wait_for
return fut.result()
File “/usr/local/lib/python3.6/concurrent/futures/thread.py”, line 56, in run
result = self.fn(*self.args, **self.kwargs)
File “/usr/local/lib/python3.6/site-packages/homeassistant/components/switch/broadlink.py”, line 80, in setup_platform
config.get(CONF_MAC).encode().replace(b’:‘, b’'))
binascii.Error: Odd-length string