Broadlink S3 hub support

Are you sure you using the right code base, do you have python-broadlink installed via pip?

Is there is there any way you can can test with the docker image? Perhaps you could download docker desktop and run it from there

Maybe I am doing something stupid.

Here is the docker instance:

Here is when I try to get the hub info:

Not sure if this helps but i tried your other approach inside the docker instance:

I got the same issue as with without the docker instance.

Thank you with your help so far!

From Postman try http://127.0.0.1:5000/?hub=192.168.0.76

If that doesn’t work please do try to download the image from Docker hub, did you need to update the device ID is that why you are building the image from scratch?

Don’t forget to map the local port number to the container port number


Great news! now it seems to show some data :slight_smile:

This is with the alternative Docker Hub.

This is when I try the logic to see a specific DID:

And this is how I am starting & stopping the switches:

This is how I see the motion sensors:

Let me know if I am missing something.

Three questions arise now:

  1. I have two hubs, does this mean I need two instances in Docker or not?
  2. How I can set a sensor for the motion tools?
  3. Due to the nature of my work I cannot leave my PC working all the time. Is there a way to have this working directly in HA? I have Home Assistant Blue.

PS. I feel like I am spamming a lot. If you want I can take this via PM.

Well done,

You can reinitialise the hub at any time to connect to either hub, however yes in order for home assistant to be able to be able to query both hubs you would need two docker containers running at all times. Until the HA maintainers integrate my code which could potentially take a while why don’t you look at running docker on a low powered raspberry pi.

In order to read the motion sensor data you just need to parse the json response and check if there is any detection or tampering statuses set to 1

You can help me a bit if you like. Could you tell me what each of the the the sub devices you have are. If you have anything other than light switches or the motion sensor that you have shared above could you also please send a get status response

1 Like

These are all my devices:

Essentially I have only 1,2-gang TC3-EU switches, a couple of motion sensors, and door sensors. Everything is from the S3 Broadlink series (but I don’t think that something else can connect to that hub anyway)

I guess you already know what the switches give you as an information. Here is the motion sensor:


The pir_detected is by default 0, but changes to 1 once it detects a movement.

This is the door sensor information:


doorsensor_status changes to 1 once a door is opened.

Let me know if this is enough or you need something else.

1 Like

I have updated the main image to include your device ID and there is also an example Home assistant sensor on the readme page https://hub.docker.com/repository/docker/stevendodd/s3-rest-api

sensor:
  - platform: rest
    name: Light
    resource: http://192.168.1.162:8124/00000000000000000000a043b0d0783a
    value_template: '{{ value_json }}'
    json_attributes:
      - pwr1
      - pwr2

The code has been merged into the main library - potentially will be supported in home assistant in the next release

5 Likes

Great work.
How will this show up?
As an integration update or in the full HA Core update?
Is there anyway we can install it manually?

I wouldn’t like to presume however there is a broadlink integration within the core and the maintainer of the broadlink library also contributes to the core of home assistant.

there’s a beta update. any news for broadlink?

Still not seeing any sign of this at least for April. Are there instructions how to install this manually to HA running on a Pi4 or is there anything iminent for the 2022.5 release?

I’m not aware of anything but then I’m not involved in in the home assistant release. I’ve just created the docker container as a stop gap.

One of the other guys above got the container running on a raspberry pi. You may have to to change the the base image from slim buster to a python image that compatible with the raspberry pi but otherwise it should work

I managed to get it to work locally with home assistant without the need to create a flask server, just using AppDaemon.

Here is the step to do it, first you need to install AppDaemon ad-on on Home Assistant, after that you need to download and copy everything in this repository tag into /config/appdaemon/apps/, in the same path you will find apps.yaml file open it and paste this config:

broadlink_s3_hub:
  module: broadlink_s3_hub
  class: BroadlinkS3Hub
  hub_ip: "Your hub IP address, example: 192.168.1.23"
  entity_id: "The entity id name that you want to use, you can put anything, it should start with switch or light or any entity type that home assistant is supporting, ex: light.bedroom"
  did: "Your device did, check the above messages to know how to get it"
  scan_interval: 1
  gang: 1

Full example:

broadlink_s3_hub:
  module: broadlink_s3_hub
  class: BroadlinkS3Hub
  hub_ip: "192.168.1.23"
  entity_id: "light.bedroom_center"
  did: "00000000000000000000a043b0d059aa"
  scan_interval: 1
  gang: 1

Now restart AppDaemon ad-on and you will see the new entity with the entity_id you specified is created

1 Like

Added support for HACS, you can add this repo to HACS

https://github.com/mnayef95/broadlink-s3-hub-app-daemon

And then add the above config to apps.yaml, no need to copy the repository content, HACS will do it for you

Hi! it looks awesome but I can’t find apps.yaml. I have to create it?

inside config/appdaemon/apps i can only find “boradlink-s3-hub-app-daemon”

also I have a SR3-4Key would it work?

I get the following error when try to add the repo…

Please make sure AppDaemon Apps is enabled in HACS and AppDaemon ad-on is installed also after that you can install the code using HACS as AppDaemon app, not as integration