Broadlink SP3 Mini stops working after potentially a few days

Hi all,

I’ve had an intermittent issue with HA occasionally not working with Broadlink SP3 minis.

I have 3 of these wifi switches set up, and generally speaking after a day or two, 1 of them will not respond when I try turn it off/on in HA.

I’ve had these in HA for probably 8 months, and it’s only the last 2-3 months I’ve begun to see this problem.

I’m not entirely sure what I’m supposed to do regarding enabling debug for broadlink, but I did try:

# Enable logging
logger:
  default: info
  logs:
     homeassistant.components.switch.broadlink: debug

However I suspect this is wrong…Thoughts?

Regarding my actual config:

switch:
  - platform: broadlink
    host: 192.168.1.58
    mac: '34:EA....'
    friendly_name: "RM3 mini"
    type: rm_mini
    update_interval: 60
    switches:
      ac_daikin:
        command_on:  "JgBQAhANDw0PDRANEAsQAANCdDgQKRANDw0PDRApEA0QDA8NEA0QKRANDyoPKg8NECkQKRAqDyoQKRANEAwPKw8MEA0QDQ8MEA0QDQ8NDw0QDQ8NECkQDBApEA0QDQ8NDyoPKw8MEA0QDQ8MEA0QDQ8MEA0QDQ8NDw0QDQ8NEAwQDQ8NECkQKg8qEAwPKw8MECoPKhAABHp0OBApEA0QDQ8MECoPDRANEAwPDRApEA0QKRAqDw0PKg8rDyoPKg8qDw0QDRApEA0PDBANEA0PDQ8NEA0PDQ8NEA0PDRApEAwQDQ8NEA0PKg8NEA0PDRApECoPDBANECkQDRApEA0PKg8qDw0QDQ8NDw0QKRANDyoQKRANECkQDBApEAAEe3Q3ECoPDRANEAwPKw8MEA0QDQ8MECoPDRApECoPDRAqDyoQKRApECoPDBANECkQDQ8NDw0QDQ8NEAwQDQ8NEA0PDQ8NEA0QDA8NEA0QDA8NEA0PDQ8NEA0PKhANDwwQKRANEA0QKRApECkQDQ8qDw0QDQ8NEAwQDQ8NEA0PDQ8NEA0PDQ8NEA0QDA8qECkQDQ8NEA0PDQ8NEA0QDA8NEA0QDA8NEA0QDA8NEA0PDRAMEA0PDRAqDyoQDA8NEA0PDRAMEA0PDRANDw0PDRAqDyoQDBAMEA0PDRAMEA0PDRANDw0PDRANEAwPDRANEA0ODRANECkQDQ8MEA0QDQ8MECoPKhAMEA0QDQ8MEA0QDQ8MEA0QDQ8NDw0QDQ8NEAwQDQ8NECkQKg8qECkQKRAMECkQKRAADQUAAAAAAAAAAA=="
        command_off: "JgBQAhANDw0PDRANEAsQAANCdDgQKRANDwwQDRApEA0QDA8NEA0QKRANDyoPKg8NECkQKRAqDyoQKRANDw0PKw4NEA0QDQ8MEA0QDQ8NDw0QDBANECkQDBApEA0QDQ8NDyoPKw4NEA0QDQ8MEA0QDQ8MEA0QDQ8NDw0QDBANEAwQDBANECkQKRAqDw0PKw4NECoPKhAABHp0OBApEA0QDQ8MECoPDRANEAsQDRApEA0QKRAqDw0PKg8rDyoPKg8qDw0QDQ8qEA0PDBANEAwQDQ8NEAwQDQ8NEAwQDRApEAwQDQ8NEA0PKg8NEAwQKg8qECkQDRALECoQDBAqDw0QKg8qDw0PDRANDw0PKg8rDyoPKg8NECkQDRApEAAEe3Q3ECoPDRAMDw4PKhAMDw4ODg8NDysPDRApECoQCxAqECkQKRApECoQDBANECkQDA8ODg4PDg4ODw0QDQ8MDw4PDg8NDg4PDg8NEAwPDg8NDw4ODg8NDw4OKw8NEAwPKw8NEAwQKRApECoPDRAqDw0QDQ4ODg4PDg8MDw4PDg8NDg4PDg8NDg4PDg8qECkQDQ8MDw4PDg8NDg4PDg8NDw0PDg8NDw4ODg8NDw4ODg4ODw4PDQ4rDyoQDQ8NDw4ODg8NDw4PDQ4ODw4PDQ4sDisPDQ8NDw4PDQ4ODw4PDQ4ODw4PDQ4ODw4PDQ8NDw4PDQ8ODisPDQ8ODg4PDQ8ODisPKhANDwwPDg8ODg4ODg8ODg4PDQ8NDw4PDg4NDw4PDg8MDysPKhApECkQKg8NECkQKg8ADQUAAAAAAAAAAA=="
  - platform: broadlink
    host: 192.168.1.32
    mac: '34:EA:....'
    friendly_name: "Matt's Desk Light"
    type: sp3
    update_interval: 60
  - platform: broadlink
    host: 192.168.1.26
    mac: '34:EA:....'
    type: sp3
    friendly_name: "Matt's Bed Lamp"
    update_interval: 60
  - platform: broadlink
    host: 192.168.1.25
    mac: '34:EA:.....'
    type: sp3
    friendly_name: "Plug#3"
    update_interval: 60

One key point: I can quite happily turn the problematic device off/on with the broadlink e-control app, so I do not see there being a connectivity issue here.

In terms of what I see from the logs:

2018-05-01 08:45:36 INFO (MainThread) [homeassistant.components.http.view] Serving /api/services/switch/turn_on to 127.0.0.1 (auth: True)
2018-05-01 08:45:36 INFO (MainThread) [homeassistant.core] Bus:Handling <Event call_service[L]: service=turn_on, service_data=entity_id=switch.plug3, service_call_id=1976190256-61, domain=switch>
2018-05-01 08:45:36 INFO (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: entity_id=switch.plug3, old_state=<state switch.plug3=off; friendly_name=Matt-Fan @ 2018-05-01T20:43:32.180971+12:00>, new_state=<state switch.plug3=on; friendly_name=Matt-Fan @ 2018-05-01T20:45:36.289887+12:00>>
2018-05-01 08:45:36 INFO (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: entity_id=switch.plug3, old_state=<state switch.plug3=on; friendly_name=Matt-Fan @ 2018-05-01T20:45:36.289887+12:00>, new_state=<state switch.plug3=off; friendly_name=Matt-Fan @ 2018-05-01T20:45:36.366262+12:00>>
2018-05-01 08:45:36 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_executed[L]: service_call_id=1976190256-61>
2018-05-01 08:45:38 INFO (Thread-14) [homeassistant.components.switch.command_line] Running state command: /config/tvstate.sh
2018-05-01 08:45:55 INFO (MainThread) [homeassistant.components.http.view] Serving /api/services/switch/turn_on to 127.0.0.1 (auth: True)
2018-05-01 08:45:55 INFO (MainThread) [homeassistant.core] Bus:Handling <Event call_service[L]: service=turn_on, service_data=entity_id=switch.plug3, service_call_id=1976190256-62, domain=switch>
2018-05-01 08:45:55 INFO (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: entity_id=switch.plug3, old_state=<state switch.plug3=off; friendly_name=Matt-Fan @ 2018-05-01T20:45:36.366262+12:00>, new_state=<state switch.plug3=on; friendly_name=Matt-Fan @ 2018-05-01T20:45:55.100647+12:00>>
2018-05-01 08:45:55 INFO (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: entity_id=switch.plug3, old_state=<state switch.plug3=on; friendly_name=Matt-Fan @ 2018-05-01T20:45:55.100647+12:00>, new_state=<state switch.plug3=off; friendly_name=Matt-Fan @ 2018-05-01T20:45:55.221332+12:00>>
2018-05-01 08:45:55 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_executed[L]: service_call_id=1976190256-62>
2018-05-01 08:46:19 WARNING (MainThread) [homeassistant.helpers.entity] Update of switch.plug3 is taking over 10 seconds
2018-05-01 08:46:19 INFO (MainThread) [homeassistant.core] Bus:Handling <Event system_log_event[L]: exception=, message=Update of switch.plug3 is taking over 10 seconds, timestamp=1525164379.1669993, source=core.py, level=WARNING>

Any help appreciated.

Thanks,

Matt

So plug3 is giving you issues? Events are being seen properly in HA according to your logs.

Can you post your relevant entity_registry.yaml?

I’ve had to add an automation that disconnected the mini from wifi kandy it reconnects by itself in a few seconds) every other week and haven’t seen any issues since.

@petro - I’ve checked my config folder and don’t appear to have an entity_registry.yaml file. Reading the docs I see it’s only supported on a few devices. None of which I have in HASS.

I don’t know if it’s of any relevance, but I’m running HASS in a docker container.

@quasar66 - Are you saying you were pretty much seeing the same problem as me?

So you have an automation that logs into your wireless router and disconnects the client or something?

Thanks,

Matt

In the logs above yes, however it can pretty much be any of the 3 SP3 Minis I have. I’ll go to turn them all on and at least one doesn’t.

For example right now, I turned 2 of them on, but only 1 actually did.

Key point: Restarting Home Assistant fixes things. But I wouldn’t really call this a fix.

Thanks,

Matt

What version of HA are you running? It’s gotta be old, have you tried updating? Only reason I say it’s old is because you are missing entity_registry.yaml. That’s 3 or 4 months old at this point and if your config doesn’t have it, you are running an old version.

Pretty sure I’m running the latest:

root@osmc:/# hass --version
0.68.1

well, either way. If its not just plug3, it’s probably not the entity_registry. Have you tried monitoring the connectivity of the devices to your router? Also, what kind of device are you on? raspi3?

Yeah it’s on a pi 3, but I’ve just bought a new htpc to move it all on to. I’d kinda wanted to figure out the problem with this first before moving.

I have no issue turning the device off/on with the broadlink app on my phone while HASS is exhibiting the issue.

A bit frustrating! :-/

Is the device wifi or hardwired? Just wondering if you device is disconnecting from wifi or possibly the usb port if you are using a usb wifi stick

@mattie47 - yes, the r3 mini stops working (sending ir codes) but it’s ping-able (90% of the time) and connected to wifi and has a dhcp allocation (100% of the time) after a long period of being plugged in. I use ubiquity access points and i’ve made a script that kicks the mini off wifi every now and then (at night, when i don’t use them) and they have been very stable since then.

Raspberry Pi3 is connected to the LAN via network cable.

Interesting…

I also have the RM3 Mini however only set it up with air-conditioner last week.

I’ve started moving my HA to my new HTPC with a docker container on that, but haven’t finished getting it set up yet.

I still want to figure out what the correct debug settings are for broadlink though within configuration.yaml. It would be good to narrow down what’s not working, and why…

@mattie47 I too am having this issue with an RM3 Mini. Did you ever figure out a way to fix the disconnects?

@cby016 unfortunately not.

I’ve had no issues since moving to my x86 htpc with docker.

My pi which I don’t use anymore still has the problem.

Are you using a raspberry pi and possibly docker?

Thanks,

Matt

I was on a pi but it was having serious disk i/o issues so I switched everything over to mac mini. Since then everything is more stable and cpu usage normally stays under 5%.

I’m currently running HA version 0.65.5, I guess I could try upgrading as I’ve seen some changes to broadlink in the release notes. However I’ve also read several comments from people saying broadlink stopped working after they upgraded. @mattie47 What version are you on?

I’m also trying a different power adapter for the RM3 Mini, we’ll see if that has any affect.

Sorry somehow missed your comment.

I’m on latest, and not seen any issues.

I think I may have found an easy solution for broadlink disconnect issues. I created a cron job that pings each broadlink device every five minutes and since then I haven’t had any disconnects. It’s been working for the past 3 or 4 days so I’ll keep my fingers crossed.

I use unifi and I disconnect them every 5 days or so. Resetting their wifi keeps them “fresh”… Also if the power supply is a cheap one it causes malfunction more often…

On a good psu and ubiquity access points, they break every 30 days or so…