New Broadlink SP2/SP3/SP3S controller

Thank you. Now it’s clear to me. I also wanted to point out that setting “null” caused an error “Failed to save addon configuration, not a valid value for dictionary value …”, while setting

None

or

‘’

or anything else, saving was allowed.
I could access addon from browser on port 8525.
Adding the integration I had to write “localhost” to make it work (at first I wrote “local-broadlink-hub-hassio-addon”, but nothing worked…).

OK. The supervisor makes that addon internal address visible in some locally visible hostname and at least in my system it became that local-broadlink-hub-hassio-addon, but there seems to be no documentation about what it is and I just found it with trial and error and peeking into other code. If you expose the addon port outside, then indeed it is possible to access the addon also using localhost or even the ip address of the Hassio system.

It is also totally possible to have even multiple Broadlink Hub (not addon, but separately running Broadlink Hub processes) running somewhere outside Hassio and then to use multiple integrations to show those switches in Hassio. This might be needed, in case there are multiple separate LAN areas with Broadlink stuff.

Hi Timo,

tried to install your addon and integration and having some trouble.

the addon says it is started with no errors:
Starting the service
broadlink-hub version 2.1.1

when installing the integration: all fields are empty?
my guess is.
field1: hostname
field2: usernam
field3: password
checkbox1: ???

what should i do? tried to enter all i know but where do i find my devices?

best regards
chakib

Hi

Weird. I looked into it in my Hassio installations and indeed in both the texts have disappeared. Fields are in order: host, port, username, password and the checkbox is “use ssl”, which should be left unchecked in normal installations, where hub is running as add-on.

This much said, I really don’t know what causes the strings to be lost. They sure are present in the component directory.

Apparently the problem was that strings json files were in directory “.translations” instead of “translations”. This has now been fixed and the strings in the integration config dialog are visible once again.

1 Like

I’m new to HASSIO and don’t know coding.
Just purchase Broadlink Wifi Control Box MCB1 and looking for integration to HASSIO.
What a pity to know that it cannot be integrated!
MP1 and SP3 are on the way to my place. Hope i can add them in with your guides.
Thanks for you contribution!

Just want to make sure if i’m doing the right steps:

  1. installed Broadlink hub
  2. installed Broadlink Add-on
  3. than i can add the switch to Lovelace UI
  • Install and configure Broadlink Hub add-on.
  • Add external port to allow you to connect it directly with your web browser.
  • Test it with your web browser. If it’s correctly configured, you should see your switches there.
  • Install (“add”) Broadlink Hub integration and configure it to connect to the add-on.
  • Everything being in check, your switches should now magically appear in Hassio and you can set them to areas and include in scenes and automations etc.

@rinne First of all, thank you for putting in so much effort into this. I got everything to work and the auto discovery of the switches was great. I’ve hit a wall though.
My switches keep becoming unavailable -

Error: Timeout
    at Timeout.timeoutCb [as _onTimeout] (/node-service/node_modules/broadlink-core/index.js:268:13)
    at listOnTimeout (internal/timers.js:549:17)
    at processTimers (internal/timers.js:492:7)

Here are my timeout settings

device_timeout: 500
update_interval: 5000
power_set_timeout: 10000
unreachable_grace_time: 10000

I do not face this problem when I directly add the switches through configuration.yaml
I’d appreciate any insight you have on this.

Hi

Yeah, those timeouts come and go mostly because of Broadlink being really unreliable to answer to protocol calls. But if your switch remains available and you can set it on and off, it works just as intended. Basically when the connection is lost because of the missing response, it immediately and automatically restores it, if possible.

@rinne That’s the thing, they become unavailable and I can’t operate them. Do you think changing the time out settings can help?

Well, you could try changing

device_timeout: 1000
update_interval: 10000
power_set_timeout: 10000
unreachable_grace_time: 15000

When your switches go unreachable, do they remain so, or do they come back at some point?

@rinne They do come back online but sometimes when I want to control the switches, they are offline.


18:34:24
Guest Room AC turned off
18:34:17
Guest Room AC changed to unavailable
18:01:20
Guest Room AC turned off
18:01:18
Guest Room AC changed to unavailable
17:59:44
Guest Room AC turned off
17:59:30
Guest Room AC changed to unavailable
17:57:50
Guest Room AC turned off
17:57:47
Guest Room AC changed to unavailable
17:57:14
Guest Room AC turned off
17:57:11
Guest Room AC changed to unavailable
17:54:32
Guest Room AC turned off
17:53:55
Guest Room AC changed to unavailable

Hi

Right. Just maybe try unreachable_grace_time: 120000
This means that even if regular updates get timeouts, switch will remain in available state (externally). Then if there is an operation attempted to it, it will get carpet bombed as much as possible to get the operation through. There is no real harm to make unreachable_grace_time longer in a stable environment where ip addresses stay constant and switches are not moved back and forth.

You might also like to open a browser session to Hub web page directly, enable debug and share a few hundred lines of log, in case your problems continue.

MCB1 and some other basic “SP4” -type switches are now supported. You’ll have to update your “broadlink_hub” custom component and rebuild broadlink hub addon. MCB1 devices should appear automatically.

I initialized my MCB1 devices using the python code, but maybe they’ll be fine even if initialized with eControl (even though you can’t use them with eControl after initialization).

There also seems to be another new class “SP4B” for new switches. I don’t have any of those around, so I can’t really add support for them. Same problem with Broadlink light bulbs.

Hi all, can you please let me know if there is anybody out there that managed to make this work recently? I am not able to see any device discovered and not able to connect to the port 8525 in any way as explained in some posts.

Here are the instructions that I found around for the step that I am stuck and not managed to make this working, mainly related to networking I guess, port 8525:

In the instructions here: https://github.com/rinne/broadlink-hub-hass-component
“In configuration menu of your Home Assistant, add Broadlink Hub integration. If your Broadlink Hub runs as a Hassio add on, the hostname should be local-broadlink-hub-hassio-addon and the port 8525.”

In the instructions here: https://github.com/rinne/broadlink-hub-hassio-addon
“If you expose the TCP port of the add-on outside Hassio, you can access it directly using a web browser and see your Broadlink devices.”

In one comment above is also written:
- Add external port to allow you to connect it directly with your web browser.
- Test it with your web browser. If it’s correctly configured, you should see your switches there.

Here are my current config:

2021-04-02 20_30_49-Configuration - Home Assistant
2021-04-02 21_58_36-Configuration - Home Assistant

As can be seen from the picture, there is nobody listening on port 8252 on the host neither.

As a note, under “Network” group, I could not enable 8252/tcp in any way. As can be seen it is marked under “Host” as “Disabled”*
I tried in that field to write “localhost”, “192.168.2.12”, “enable”, “enabled” but all with no success.

Enabled logging in the Broadlink Hub Add-on and here is the error:

Error: Unrecognized device type 0x279d
    at Socket.message (/node-service/node_modules/broadlink-core/index.js:312:14)
    at Socket.emit (events.js:315:20)
    at UDP.onMessage [as onmessage] (dgram.js:919:8)

No clue what does it mean…

Any help here would be appreciated as I have a house full of Broadlink TC2’s and not able to integrate them in HA.

Thank you!

PS: Kiitos paljon Timo for working so hard to this, even that does not work for me,yet, but that will not cancel your huge effort that it seems that you put to make it this far.