Broadlink RM Pro - broadlink.send error

Getting this error all of a sudden (or at least that’s what it seems like).

Sun Dec 29 2019 17:02:54 GMT+0100 (Central European Standard Time)
'192.168.1.87'
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 133, in handle_call_service
    connection.context(msg),
  File "/usr/src/homeassistant/homeassistant/core.py", line 1235, in async_call
    await asyncio.shield(self._execute_service(handler, service_call))
  File "/usr/src/homeassistant/homeassistant/core.py", line 1260, in _execute_service
    await handler.func(service_call)
  File "/usr/src/homeassistant/homeassistant/components/broadlink/__init__.py", line 114, in _send_packet
    device = hass.data[DOMAIN][call.data[CONF_HOST]]
KeyError: '192.168.1.87'

when executing this service call:
broadlink.send

host: 192.168.1.87
packet: sgBTA45MNgoWCxYKFwoKFhcKChYLFgoWFwoWCwoWCxYWChcKChYLFhYLChYKFwoWCxYKFhcKFgoXCgoXChYKFgsWChcWChYLFgoLFhYKCxYXChYKCxYKFheiTDYLFgoWCxYKCxYWCgsWChYLFhYKFwoLFgoWFwoWCgsWCxUXCgoWCxYLFgoWCxYWChcKFgoLFgoXChYLFgoWFgoXChcKChcWCgoWFwoWCwoXChUXo0w2ChcKFgoXCgoWFwoKFgsWCxYWChcKChYLFhYLFgoKFgsWFgsKFgoXChcKFgoWFwoWCxYKChcKFgsWChYLFhYKFwoWCgsWFgsKFhYLFgoLFgoWF6JMNwoWChcKFgsKFhYKCxYKFgsWFgsWCgsWChYXChYLChYKFxYKCxYKFgsWChYLFhYKFwoWCgsWCxYKFgsWChYXChYKFwoKFhcKCxYWChYLChcKFhajTDYKFwoWChcKChYXCgoXChYLFhYKFwoLFQsWFgoXCgsWChYXCgoWCxYKFgsWChYXChYKFwoLFgoWCxYKFgsWFgoXChYLChYWCwoWFwoWCgsWChYXokw3ChYKFwoWCgsWFgsKFgsWChYXChYKCxYKFxYKFgsKFgsWFgoKFwoWCxYKFgsWFgoXChYLChYLFgoWCxYKFhcKFgsWCgsWFgoLFhYKFwoKFgsWuUw2ChcKFgoXCgoWFwoLFgoWCxYWChcKCxULFhYLFgoLFgoWFwoKFgsWCxULFgoXFgoXChYKChcKFgsWCxULFhYKFwoWCwoWFwoKFhcKFgsKFgoWF6JMNwoWChYLFgoLFhYLChYLFgoWFwoXCgoWCxUXChcKChYLFhYKCxYKFgsWChYLFhYLFgoXCgsVCxYKFgsWChcWChYLFgoLFhYKCxYWChcKChYLFrlMNgoXChYLFgoLFRcKChcKFgsWFgoXCgoWCxYXChYLChYKFhcKChcKFgsWChYLFhYKFwoWCwoWChYLFgoWCxYWCxYKFwoKFhcKChYXChYLChYLFhazKFgoXChYLChYWCwoWCxYKFhcKFgoLFgoXFgoWCwoWCxYWCwoWCxULFgsWChYXChYKFwoKFwoWChYLFgoXFgoXChYKCxYWCwoWFgoXCgsWChYWAAXcAAAAAAA==

configuration.yaml

switch:
  - platform: broadlink
    host: 192.168.1.87
    mac: 78:0F:77:63:D9:DD

which loads fine

Broadlink manager recognizes the RM Pro at 192.168.1.87, the IHC app works fine. The long code used to work until recently…

At a loss!

I have just tried on my system and there is no problem sending out your code to an RM Pro and RM mini. No errors. Rpi 3B+, Hass.io 0.103.4

This error can also rise if the host doesn’t exist. Check if your RM Pro is really available on the network at 192.168.1.87 by pinging it or check the logs for unable to reach messages. If nothing has changed on your WiFi you may unplug the RM Pro from the mains wait a minute then reconnect. Maybe it’s just some intermittent freeze.

I feel a little stupid…

Turns out that re-commissioning the RM mini (as IR device next to the living room TV for improved WAF*), while moving the RM Pro to another (obscured) location was the root cause of my snaffu…

What did not help is that I have all switches in a separate switches.yaml file (via !include), so I lost track of what was where and had duplicates in configuration.yaml and switches.yaml.

Once I removed the duplictaes from configuration.yaml, the solution was simple and both the mini and the pro are living happily together (in switches.yaml):

# Broadlink RM Pro+
 - platform: broadlink
   host: 192.168.1.87
   mac: '78:0F:77:63:D9:DD'
#    type:  rm2_pro_plus
   timeout: 30
# Broadlink RM Mini
 - platform: broadlink
   host: 192.168.1.74
   mac: 'C8:F7:42:16:B6:C6'
#    type:  rm_mini
   timeout: 15
   switches:
     samsung_tv_power_toggle:
       friendly_name: "Samsung TV Power Toggle"
       command_on: 'JgBGAJKVDzsQOhA6EBUQFRAVERQRFBE5EDoSOBEUERQRFBAVEBURFBE5ERQRFBAVERQRFBEUETkRFBE5ETkRORE5EToQOg8ADQUAAA=='
     samsung_tv_power:
       friendly_name: "Samsung TV Power"
       command_off: 'JgBGAJOVEDoQOhA6DxYPFhAVEBUQFRA6ETkROREUERQRFBEUEBUQFREUERQRORE5EBUQFRE5ETkRORE5ERUQFRA6DzsPFhAADQUAAA=='
       command_on: 'JgBGAJKVETkRORA6ERQRFBEUERQRFBE5ETkQOhAVEBUQFREUEBUQOhEUERQRORE5EBURFBA6EBUQOhE5EBUQFRA6EDoRFBEADQUAAA=='

Thanks for the comments above though!

Now I have the RM Pro controlling the zemismart roller motor for the living room blinds, even though it is in the room next door with a brick wall in between, ie. good range!

Each RF command for the blinds is called via a script that has a button on my Living Room lovelace-view.

rol_voor_op:
  alias: Rolgordijn Voor OP
  sequence:
  - data:
      host: 192.168.1.87
      packet: "sgBTA45MNgoWCxYKFwoKFhcKChYLFgoWFwoWCwoWCxYWChcKChYLFhYLChYKFwoWCxYKFhcKFgoXCgoXChYKFgsWChcWChYLFgoLFhYKCxYXChYKCxYKFheiTDYLFgoWCxYKCxYWCgsWChYLFhYKFwoLFgoWFwoWCgsWCxUXCgoWCxYLFgoWCxYWChcKFgoLFgoXChYLFgoWFgoXChcKChcWCgoWFwoWCwoXChUXo0w2ChcKFgoXCgoWFwoKFgsWCxYWChcKChYLFhYLFgoKFgsWFgsKFgoXChcKFgoWFwoWCxYKChcKFgsWChYLFhYKFwoWCgsWFgsKFhYLFgoLFgoWF6JMNwoWChcKFgsKFhYKCxYKFgsWFgsWCgsWChYXChYLChYKFxYKCxYKFgsWChYLFhYKFwoWCgsWCxYKFgsWChYXChYKFwoKFhcKCxYWChYLChcKFhajTDYKFwoWChcKChYXCgoXChYLFhYKFwoLFQsWFgoXCgsWChYXCgoWCxYKFgsWChYXChYKFwoLFgoWCxYKFgsWFgoXChYLChYWCwoWFwoWCgsWChYXokw3ChYKFwoWCgsWFgsKFgsWChYXChYKCxYKFxYKFgsKFgsWFgoKFwoWCxYKFgsWFgoXChYLChYLFgoWCxYKFhcKFgsWCgsWFgoLFhYKFwoKFgsWuUw2ChcKFgoXCgoWFwoLFgoWCxYWChcKCxULFhYLFgoLFgoWFwoKFgsWCxULFgoXFgoXChYKChcKFgsWCxULFhYKFwoWCwoWFwoKFhcKFgsKFgoWF6JMNwoWChYLFgoLFhYLChYLFgoWFwoXCgoWCxUXChcKChYLFhYKCxYKFgsWChYLFhYLFgoXCgsVCxYKFgsWChcWChYLFgoLFhYKCxYWChcKChYLFrlMNgoXChYLFgoLFRcKChcKFgsWFgoXCgoWCxYXChYLChYKFhcKChcKFgsWChYLFhYKFwoWCwoWChYLFgoWCxYWCxYKFwoKFhcKChYXChYLChYLFhazKFgoXChYLChYWCwoWCxYKFhcKFgoLFgoXFgoWCwoWCxYWCwoWCxULFgsWChYXChYKFwoKFwoWChYLFgoXFgoXChYKCxYWCwoWFgoXCgsWChYWAAXcAAAAAAA=="
    service: broadlink.send
rol_voor_neer:
  alias: Rolgordijn Voor NEER
  sequence:
  - data:
      host: 192.168.1.87
      packet: "sgBTA6JMNwoWChYLFgoLFhcKChYLFQsWFwoWCgsWChcWChYKCxYKFhcKChcKFgsWFwoKFgsVCxYXCgoWCxYLFQsWChYXChYKFwoKFxYKChcKFhcKFgoXChajTDYKFwoWChcKChYXCgoXChYLFhYKFgsKFwoWFgsWCgsWChYWCwoWCxYKFhcKChYLFgsWFgoKFwoWCxYKFgsWFgsWChYLChYXCgoWCxYWChcKFgoXokw3ChYKFwoWCwoWFgsKFgsWChYXChYKCxYKFhcKFgsKFgsWFgoLFgoXChYWCwoWChYLFhYLChYLFgoWCxYKFxYKFgoXCgoXFgsKFgoXFgoWCxYKFqNMNgoXChYLFgoLFRcKCxYKFgsWFgsWCgsVCxYWCxYKCxYKFhcKChYLFgoWFwoLFgoWChcWCgsWChYLFgoXChYXChYKFwoKFhYLChcKFhYLFgoWCrpLNwoWChcKFgsKFhcKChYLFgoWFwoWCwoWCxUXChcKChYLFhYKCxYKFwoWFgsKFgoWCxYXCgoXChYKFwoWCxUXChcKFgoLFhYKCxYKFxYKFgsWChajTDcKFgoWCxYKCxYWCwoWChYLFhYKFwoKFgsWFwoWCgsWChcWCgoXChYKFhcKCxYKFgsWFgoLFgoXChYLFgoWFgsWChcKChYXCgsWChYWCxYKFwm6TDYKFwoWChcKChcWCgoXChYKFxYKFgsKFgoXFgoXCgsVCxYWCwoWCxYKFhcKChYLFgoWFwoKFgsWChYLFgsWFgoXChYKCxYWCgsWCxYWChYLFgoWo0w3CRcKFwoWCwoWFgoLFgoXChYWCxYKCxYKFhcKFgoLFgoWFwoKFwoWCxYWCwoWCxULFhYLChYLFgoWCxULFhcKFgoXCgoWFwoKFwoWFgoXChcKFqNMNgoXChYLFgoKFhcKChcKFgsWFgoXCgoWCxYWChcKChYLFhYLChYLFgoWFwoKFgsWChYXCgsWChYLFgoWChcWChcKFgsKFhYKCxYLFhYKFwoWCheiTDcKFgoWCxYKCxYXCgoWCxYKFhcKFgoLFgoWFwoWCwoWCxYWCgsWChYLFhYLChYKFwoWFgsKFgsWChYKFwoWFwoWChcKChYXCgoXChYXChYKFwoWAAXcAAAAAAA=="
    service: broadlink.send
rol_voor_stop:
  alias: Rolgordijn Voor STOP
  sequence:
  - data:
      host: 192.168.1.87
      packet: "sgBMA45LNwkXChcJGAkLFhcJCxYLFQsWFwkXCgsVDBUXChYKCxYLFhYKCxYKFgsVGAkLFhcJCxYXCQwVCxYKFgsWChYXChYKFwoLFRcKCxYLFRcKChYXCbpLNwoXCRcKFwoLFRcKCxULFgsWFgoXCgsVCxUYCRcKCxULFhcKChYLFgsVFwoLFRcKCxUXCgsWChYLFgsVCxYWChcKFwkLFhcJCxYLFRcKCxYWCrpLNwkXChcKFgoLFhcKChYLFQsWFwoWCgsWCxUXChYKCxYLFRcKCxYKFgsWFwkLFhcKChYXCQsWCxUMFQsWCxUXChYKFwoLFhYKCxYLFRcJDBUXCrlLNwoXChcJFwoLFhYKCxYKFgsVFwoXCgsVCxYXCRcKCxULFhcKChYLFgoWFwoLFRcKCxUXCgsWCxULFgsVCxYXCRcKFwkLFhcJCxYLFhcJCxYWCrpLNwoXCRcKFwkLFhcKCxULFgsVFwoXCQwVCxUXChcKChYLFhYKCxYLFQsWFwkLFhcJCxYXCgsVCxYLFQsWCxUXChcKFgoLFRcKCxYLFRcKCxUXCrlMNwkXChcJFwoLFhYKCxYLFQsVGAkXCgsVCxYXCRcKCxYLFRcKCxULFgsVFwoLFhYKCxUXCgsWCxULFgsVCxYXCRcKFwoKFhcKCxULFhcJCxYXCrlLNwkYCRcKFwkLFhcKCxULFgsVFwoXCQsWCxYWChcKCxULFhcJCxYLFQsWFwkLFhcKCxUXCgsVCxYLFQsWCxUXChcKFwkLFRgJCxYLFRcKCxUXCrlMNwkXChcJFwoLFRgJCxYLFQsWFgsWCgsVCxYXChYKCxYLFRcKCxULFgsVFwoLFhYKCxYWCgsWCxULFgsVCxYXCRcKFwoLFRcKCxULFhcJCxYXCbpLNwoXCRcKFwkLFhcKCxULFgsVFwoWCwoWCxUXChcKCxULFhcJCxYLFQsWFwoLFRcKCxUXCgsVCxYLFQwVCxUXChcKFwkLFhcKChYLFRcKCxYWCrlMNwoWChcKFgoLFRcKCxYKFgsWFwkXCgsWChYXChcJCxUMFRcKCxULFgsWFgoLFhcJCxYXCQsWCxYKFgsVDBUXChcJFwoLFRcKCxYKFhcKCxUXCRcABdwAAAAAAAAAAAAAAAA=="
    service: broadlink.send

59

  • Note: WAF = Wife Approval Factor

It’s great you can make it work. On my side, I have the battery powered zemismart roller shade (https://www.aliexpress.com/item/4000764153310.html) with broadlink rm pro. Can learn code just fine with econtrol app but then the created buttons does nothing …
I also tried with the scan frequency but does not work either. Also tried with the various ways to learn rf code actionned by a script in hass but no luck. Shame :frowning_face: the motor otherwise works great with the remote… And my broadlink works flawlessly with rf plugs since many years … Did you do anything to make it work ?
Thanks in advance for any help.

Broadlink is certainly capable of transmitting RF codes for Zemismart, problem is the way how Broadlink does the transmit. With my RF code reader, I can see the Broadlink (especially when triggered by Home assistant) is only transmitting the code once. Zemismart has some kind of energy-saving option and this means it needs code repeated atleast 3 times or ideally 5+ times with about 200uS delay between codes for it to register codes sent from Broadlink.
There is no direct option to send repeat commands, maybe build it into a script or node red.