Broadlink S3 hub support

It should work if this device is sub device of s3 hub

Thanks @mnayef95
Done it with AppDaemon by manually copying the files.
The issue I know have is that the automation does not trigger this either as a light or a switch.
I can switch it on and off but not working through the following automation:

alias: New Automation test
description: ‘’
trigger:

  • type: opened
    platform: device
    device_id: c9bc6835f2feddfadb9cd19d4a253363
    entity_id: binary_sensor.garage_door
    domain: binary_sensor
    condition: []
    action:
  • service: switch.turn_on
    target:
    entity_id: switch.garage_light
    mode: single

What’s the device you are using?

Can you paste the app daemon log?

2022-05-12 23:29:19.050575 INFO broadlink_s3_hub: Device pwr value is: ‘0’
2022-05-12 23:29:20.052199 INFO broadlink_s3_hub: Device pwr value is: ‘0’
2022-05-12 23:29:21.050123 INFO broadlink_s3_hub: Device pwr value is: ‘0’
2022-05-12 23:29:22.053035 INFO broadlink_s3_hub: Device pwr value is: ‘0’
2022-05-12 23:29:23.048478 INFO broadlink_s3_hub: Device pwr value is: ‘0’
2022-05-12 23:29:24.063889 INFO broadlink_s3_hub: Device pwr value is: ‘0’
2022-05-12 23:29:25.056932 INFO broadlink_s3_hub: Device pwr value is: ‘0’
2022-05-12 23:29:26.056293 INFO broadlink_s3_hub: Device pwr value is: ‘0’
2022-05-12 23:29:27.060665 INFO broadlink_s3_hub: Device pwr value is: ‘0’
2022-05-12 23:29:28.073464 INFO broadlink_s3_hub: Device pwr value is: ‘0’
2022-05-12 23:29:29.063526 INFO broadlink_s3_hub: Device pwr value is: ‘0’
2022-05-12 23:29:30.057061 INFO broadlink_s3_hub: Device pwr value is: ‘0’
2022-05-12 23:29:31.052216 INFO broadlink_s3_hub: Device pwr value is: ‘0’

What about apps.yaml?


broadlink_s3_hub:
module: broadlink_s3_hub
class: BroadlinkS3Hub
friendly_name: “Garage light”
hub_ip: “192.168.5.143”
entity_id: “switch.garage_light”
did: “00000000000000000000a043b084b503”
scan_interval: 1
gang: 1

The code is updated, please update your code, per in mind the changes to the config, now the entity_id is accepting an array not a string, the same happens with the friendly_name, Please let me know if it’s worked for you

:slightly_smiling_face: works perfectly now! Thanks for this.

Slight issue (not really bothered) it takes a couple of seconds to switch off light in the automation. Switching on is instant.

Thanks once more for your work.

Actually the delay issue had to do with my connection - so everything looks good.

1 Like

Hi! no entity is created when I put the settings

initialize_error

{
“module”: “broadlink_s3_hub”,
“class”: “BroadlinkS3Hub”,
“hub_ip”: “192.168.1.209”,
“did”: “00000000000000000000a043b0d059ac”,
“scan_interval”: 0.5,
“friendly_names”: [
“Balcony Light”
],
“entity_id”: [
“light.balcony_app_demon_light”
]
}

Can you share the app daemon logs?

sure.

[cont-init.d] 00-banner.sh: exited 0.
[cont-init.d] 01-log-level.sh: executing…
[cont-init.d] 01-log-level.sh: exited 0.
[cont-init.d] appdaemon.sh: executing…
[cont-init.d] appdaemon.sh: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[07:00:18] INFO: Starting AppDaemon…
2022-05-13 13:00:19.131330 INFO AppDaemon: AppDaemon Version 4.2.1 starting
2022-05-13 13:00:19.131505 INFO AppDaemon: Python version is 3.9.7
2022-05-13 13:00:19.131679 INFO AppDaemon: Configuration read from: /config/appdaemon/appdaemon.yaml
2022-05-13 13:00:19.131848 INFO AppDaemon: Added log: AppDaemon
2022-05-13 13:00:19.132024 INFO AppDaemon: Added log: Error
2022-05-13 13:00:19.132175 INFO AppDaemon: Added log: Access
2022-05-13 13:00:19.132325 INFO AppDaemon: Added log: Diag
2022-05-13 13:00:19.148289 INFO AppDaemon: Loading Plugin HASS using class HassPlugin from module hassplugin
2022-05-13 13:00:19.176091 INFO HASS: HASS Plugin Initializing
2022-05-13 13:00:19.176319 INFO HASS: HASS Plugin initialization complete
2022-05-13 13:00:19.176715 INFO AppDaemon: Initializing HTTP
2022-05-13 13:00:19.177018 INFO AppDaemon: Using ‘ws’ for event stream
2022-05-13 13:00:19.180090 INFO AppDaemon: Starting API
2022-05-13 13:00:19.182805 INFO AppDaemon: Starting Admin Interface
2022-05-13 13:00:19.183145 INFO AppDaemon: Starting Dashboards
2022-05-13 13:00:19.199735 INFO HASS: Connected to Home Assistant 2022.5.4
2022-05-13 13:00:19.214276 INFO AppDaemon: App ‘broadlink_s3_hub’ added
2022-05-13 13:00:19.215091 INFO AppDaemon: Found 1 total apps
2022-05-13 13:00:19.215531 INFO AppDaemon: Starting Apps with 1 workers and 1 pins
2022-05-13 13:00:19.216211 INFO AppDaemon: Running on port 5050
2022-05-13 13:00:19.281558 INFO HASS: Evaluating startup conditions
2022-05-13 13:00:19.295352 INFO HASS: Startup condition met: hass state=RUNNING
2022-05-13 13:00:19.295602 INFO HASS: All startup conditions met
2022-05-13 13:00:19.319553 INFO AppDaemon: Got initial state from namespace default
2022-05-13 13:00:21.223144 INFO AppDaemon: Scheduler running in realtime
2022-05-13 13:00:21.227355 INFO AppDaemon: Adding /config/appdaemon/apps to module import path
2022-05-13 13:00:21.228086 INFO AppDaemon: Adding /config/appdaemon/apps/broadlink to module import path
2022-05-13 13:00:21.247964 INFO AppDaemon: Loading App Module: /config/appdaemon/apps/broadlink_s3_hub.py
2022-05-13 13:00:21.316803 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/broadlink/helpers.py - ignoring
2022-05-13 13:00:21.318229 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/broadlink/switch.py - ignoring
2022-05-13 13:00:21.319535 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/broadlink/light.py - ignoring
2022-05-13 13:00:21.320845 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/broadlink/sensor.py - ignoring
2022-05-13 13:00:21.322136 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/broadlink/remote.py - ignoring
2022-05-13 13:00:21.323408 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/broadlink/init.py - ignoring
2022-05-13 13:00:21.324661 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/broadlink/climate.py - ignoring
2022-05-13 13:00:21.325939 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/broadlink/alarm.py - ignoring
2022-05-13 13:00:21.327406 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/broadlink/const.py - ignoring
2022-05-13 13:00:21.328889 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/broadlink/cover.py - ignoring
2022-05-13 13:00:21.330429 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/broadlink/device.py - ignoring
2022-05-13 13:00:21.331859 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/broadlink/exceptions.py - ignoring
2022-05-13 13:00:21.333335 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/broadlink/protocol.py - ignoring
2022-05-13 13:00:21.334824 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/broadlink/hub.py - ignoring
2022-05-13 13:00:21.336056 INFO AppDaemon: Initializing app broadlink_s3_hub using class BroadlinkS3Hub from module broadlink_s3_hub
2022-05-13 13:00:21.340906 WARNING broadlink_s3_hub: ------------------------------------------------------------
2022-05-13 13:00:21.341433 WARNING broadlink_s3_hub: Unexpected error running initialize() for broadlink_s3_hub
2022-05-13 13:00:21.341899 WARNING broadlink_s3_hub: ------------------------------------------------------------
2022-05-13 13:00:21.345176 WARNING broadlink_s3_hub: Traceback (most recent call last):
File “/usr/lib/python3.9/site-packages/appdaemon/app_management.py”, line 165, in initialize_app
await utils.run_in_executor(self, init)
File “/usr/lib/python3.9/site-packages/appdaemon/utils.py”, line 337, in run_in_executor
response = future.result()
File “/usr/lib/python3.9/concurrent/futures/thread.py”, line 52, in run
result = self.fn(*self.args, **self.kwargs)
File “/config/appdaemon/apps/broadlink_s3_hub.py”, line 13, in initialize
self.gang = self.args[“gang”]
KeyError: ‘gang’
2022-05-13 13:00:21.345736 WARNING broadlink_s3_hub: ------------------------------------------------------------
2022-05-13 13:00:21.347466 INFO AppDaemon: App initialization complete

Your config file is updated, but the code is not updated

How do I update the code? (sorry for all the problems :slight_smile: )

I tried re downloading from hack and moving the files directly

You can update it through hcas, or go to /config/appdaemon/apps/broadlink-s3-hub-app-daemon/broadlink_s3_hub.py and update the code with the code on github

Thank you so much for building this, makes a simple switch much better with HA!

Got it working yesterday but can’t work out what config I need to input to tell it to expect 3-gangs, I wondered if maybe that isn’t supported? Thanks again