Broadlink rm2 pro configuration

Hi experts, is the first time I write, sorry but I’m totally neophyte. I’m trying to configure the RM2 PRO remote but I keep having this error,
can someone tell me where I’m wrong?:
2018-01-07 17:17:04 ERROR (MainThread) [homeassistant.config] Invalid config for [switch.broadlink]: expected a dictionary for dictionary value @ data[‘switches’][‘command_off’]. Got ‘sgomAA8HBAcEDAUGCQwFBgQHBAcEBwkMCQcEDAkHBAcEBwQMBAcEBwQHAAA=’
expected a dictionary for dictionary value @ data[‘switches’][‘command_on’]. Got ‘sgomAA8HBAcEDAUGCQwFBgQHBAcEBwkMCQcEDAkHBAcEBwQMBAcEBwQHAAA=’
expected a dictionary for dictionary value @ data[‘switches’][‘friendly_name’]. Got ‘TV’
expected a dictionary for dictionary value @ data[‘switches’][‘tv’]. Got None. (See ?, line ?). Please check the docs at https://home-assistant.io/components/switch.broadlink/

Failed config
switch.broadlink:
platform: broadlink
host: 192.168.X.X
mac: XX:XX:XX:XX:XX:XX
switches: [source /home/homeassistant/.homeassistant/configuration.yaml:89]
command_off: sgomAA8HBAcEDAUGCQwFBgQHBAcEBwkMCQcEDAkHBAcEBwQMBAcEBwQHAAA=
command_on: sgomAA8HBAcEDAUGCQwFBgQHBAcEBwkMCQcEDAkHBAcEBwQMBAcEBwQHAAA=
friendly_name: TV
tv: None
timeout: 15
type: rm2_pro_plus

Successful config (partial)
switch.broadlink:

Thanks
Francesco

You should post your configuration not only the error, and also format as code, it’ll be easier.

right now, I can only show you what works here, this switch is to turn on (clean) or off (go home) the robot vacuum :

# Switch Broadlink RMPro
  - platform: broadlink
    host: !secret rmpro_host
    mac: !secret rmpro_mac
    switches:
      aspirateur:
        friendly_name: "Aspirateur RdC"
        command_on:
          # Mode Auto
          'JgBgAAABKJIUERQRFBEUEBQSExIUEBQRFTUUNhQ1FDYTNxQ1FDYVNRQQFDcUEBQ2FBETEhQRFBAUNhMSFDYUEBQ2FTUUNRU2FAAFGgABKUgUAAxOAAEnSRQADE4AAShIFQANBQAAAAAAAAAA'
        command_off:
          # Home 
          'JgBgAAABKpIUERQRFBETEhMSFBAUERQSEzYTNhQ3EzYUNRQ3FDUUNhMSEzYUNhQ2ExIUEBQSExIUNRQRFBETEhM2FDYUNhM2FAAFGwABKEkTAAxOAAEoSRMADE4AAShJFAANBQAAAAAAAAAA'

Be careful of the command by itself : some editor insert a newline if it’s too long, or you missed the quotes ?

Sorry… my config: HA last release, raspberry PI3.
In Configuration.yaml

# Telecomando RF
switch:
  - platform: broadlink
    host: 192.168.x.x
    mac: 'xx:xx:xx:xx:xx:xx'
    type: rm2_pro_plus
    timeout: 15
    switches:
      tv:
      friendly_name: "TV"
      command_on: 'sgomAA8HBAcEDAUGCQwFBgQHBAcEBwkMCQcEDAkHBAcEBwQMBAcEBwQHAAA='
      command_off: 'sgomAA8HBAcEDAUGCQwFBgQHBAcEBwkMCQcEDAkHBAcEBwQMBAcEBwQHAAA='

Thanks for your help

Please, format your code using the </> icon on the text box!

1 Like

Try this:

# Telecomando RF
switch:
  - platform: broadlink
    host: 192.168.x.x
    mac: 'xx:xx:xx:xx:xx:xx'
    type: rm2_pro_plus
    timeout: 15
    switches:
      tv:
        friendly_name: "TV"
        command_on: 'sgomAA8HBAcEDAUGCQwFBgQHBAcEBwkMCQcEDAkHBAcEBwQMBAcEBwQHAAA='
        command_off: 'sgomAA8HBAcEDAUGCQwFBgQHBAcEBwkMCQcEDAkHBAcEBwQMBAcEBwQHAAA='
1 Like

Yes, the only thing I can see is the indent after ‘tv’ entry so that it is parsed as a block.
See my conf, you can also put the IR code on another line, provided you indent here too.

Perfect!!! Run!! thanks to all