Thank you for your feedback, I noticed that too, I’ll work on fixing this issue the next few days
I’m also getting the app returning to an idle state at intervals ranging from a couple of hours to a couple of days, which requires an app restart.
Hi All,
First and foremost, thanks for all the effort getting this working so far, if only those responsible for official support were as committed ay?
I’m very new to HA but I’m pretty technically savvy, I just can’t seem to get over the last hurdle. I’m sure It’s something I’ve done wrong.
I’ve got as far as getting @mnayef95 's code working in AppDaemon and it is successfully polling and getting the status of my test light. I’ve also got the entity on my HA dashboard, but when I try and use the toggle there to turn the light on/off I just get “Failed to call service light/Turn_on. service not found”
Any help would be greatly appreciated. TIA
Could you post your config?
Hello! I have the same problem as Mjb1505. Here’s my config:
two_gang_switch:
module: broadlink_s3_hub
class: BroadlinkS3Hub
hub_ip: “192.168.86.28”
did: “00000000000000000000a043b0d059ac”
scan_interval: 0.5
friendly_names:
- Luz de la terraza principal
- Luz del cuarto
entity_ids:
- light.gang_1
- light.gang_2
In the Home Assistant logs I get this error message: “2022-06-14 23:31:51 WARNING (MainThread) [homeassistant.components.homeassistant] The service homeassistant.turn_on does not support entities light.gang_1, light.gang_2”
Hopefully you can help both us with this. Thanks!!
Thanks for getting back and sorry for the late reply. This is my apps.yaml file
one_gang_switch:
module: broadlink_s3_hub
class: BroadlinkS3Hub
hub_ip: "192.168.40.25"
did: "00000000000000000000a043b0a0005d"
scan_interval: 0.5
friendly_names:
- Lounge Light
entity_ids:
- light.Lounge2
Very basic so far, just playing around with the one light switch trying to get it working.
TIA
I got to them to work by adding this to the end of the /config/configuration.yaml
#S3 Hub
light:
- platform: broadlink
light:
turn_on:
service: light.turn_on
turn_off:
service: light.turn_off
Edit: I figured it out, I needed to resave and restart appdaemon
Did you have to do anything else after adding this? I’ve not got the error coming up now but it’s still not actually doing anything with my light. the slider sets to on for a second then goes back to off.
TIA
Glad to be of help.
It would be interesting to be able to have access to the PIR3-FC sensor (Broadlink motion sensors that work with the 3 hub SMART MOTION SENSOR-broadlink ) as well on Home Assistant. Anyone know how to use this python script to add it to Home Assistant?
Hello!, I have an issue as I cannot activate the switch and it the integration doesn’t work. Here I include the AppDaemon logs:
2022-07-29 02:39:32.046223 INFO AppDaemon: AppDaemon Version 4.2.1 starting
2022-07-29 02:39:32.047787 INFO AppDaemon: Python version is 3.10.5
2022-07-29 02:39:32.048519 INFO AppDaemon: Configuration read from: /config/appdaemon/appdaemon.yaml
2022-07-29 02:39:32.049225 INFO AppDaemon: Added log: AppDaemon
2022-07-29 02:39:32.049886 INFO AppDaemon: Added log: Error
2022-07-29 02:39:32.050535 INFO AppDaemon: Added log: Access
2022-07-29 02:39:32.051189 INFO AppDaemon: Added log: Diag
2022-07-29 02:39:32.290397 INFO AppDaemon: Loading Plugin HASS using class HassPlugin from module hassplugin
2022-07-29 02:39:32.612709 INFO HASS: HASS Plugin Initializing
2022-07-29 02:39:32.613733 INFO HASS: HASS Plugin initialization complete
2022-07-29 02:39:32.614795 INFO AppDaemon: Initializing HTTP
2022-07-29 02:39:32.615759 INFO AppDaemon: Using ‘ws’ for event stream
2022-07-29 02:39:32.622394 INFO AppDaemon: Starting API
2022-07-29 02:39:32.629399 INFO AppDaemon: Starting Admin Interface
2022-07-29 02:39:32.630553 INFO AppDaemon: Starting Dashboards
2022-07-29 02:39:32.690151 INFO HASS: Connected to Home Assistant 2022.7.7
2022-07-29 02:39:32.710088 INFO AppDaemon: App ‘hello_world’ added
2022-07-29 02:39:32.711850 INFO AppDaemon: Found 1 total apps
2022-07-29 02:39:32.712908 INFO AppDaemon: Starting Apps with 1 workers and 1 pins
2022-07-29 02:39:32.714526 INFO AppDaemon: Running on port 5050
2022-07-29 02:39:32.793677 INFO HASS: Evaluating startup conditions
2022-07-29 02:39:32.811447 INFO HASS: Startup condition met: hass state=RUNNING
2022-07-29 02:39:32.813636 INFO HASS: All startup conditions met
2022-07-29 02:39:32.840714 INFO AppDaemon: Got initial state from namespace default
2022-07-29 02:39:33.596847 INFO AppDaemon: New client Admin Client connected
2022-07-29 02:39:34.723763 INFO AppDaemon: Scheduler running in realtime
2022-07-29 02:39:34.741039 INFO AppDaemon: Adding /config/appdaemon/apps to module import path
2022-07-29 02:39:34.742425 INFO AppDaemon: Adding /config/appdaemon/apps/broadlink-s3-hub-app-daemon to module import path
2022-07-29 02:39:34.772005 INFO AppDaemon: Loading App Module: /config/appdaemon/apps/hello.py
2022-07-29 02:39:34.834275 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/broadlink-s3-hub-app-daemon/cover.py - ignoring
2022-07-29 02:39:34.838250 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/broadlink-s3-hub-app-daemon/exceptions.py - ignoring
2022-07-29 02:39:34.842945 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/broadlink-s3-hub-app-daemon/helpers.py - ignoring
2022-07-29 02:39:34.845183 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/broadlink-s3-hub-app-daemon/const.py - ignoring
2022-07-29 02:39:34.847396 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/broadlink-s3-hub-app-daemon/sensor.py - ignoring
2022-07-29 02:39:34.852490 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/broadlink-s3-hub-app-daemon/alarm.py - ignoring
2022-07-29 02:39:34.855157 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/broadlink-s3-hub-app-daemon/device.py - ignoring
2022-07-29 02:39:34.859218 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/broadlink-s3-hub-app-daemon/switch.py - ignoring
2022-07-29 02:39:34.861667 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/broadlink-s3-hub-app-daemon/remote.py - ignoring
2022-07-29 02:39:34.864224 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/broadlink-s3-hub-app-daemon/hub.py - ignoring
2022-07-29 02:39:34.866735 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/broadlink-s3-hub-app-daemon/protocol.py - ignoring
2022-07-29 02:39:34.869196 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/broadlink-s3-hub-app-daemon/climate.py - ignoring
2022-07-29 02:39:34.871429 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/broadlink-s3-hub-app-daemon/broadlink_s3_hub.py - ignoring
2022-07-29 02:39:34.874628 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/broadlink-s3-hub-app-daemon/init.py - ignoring
2022-07-29 02:39:34.877189 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/broadlink-s3-hub-app-daemon/light.py - ignoring
2022-07-29 02:39:34.879386 INFO AppDaemon: Initializing app hello_world using class HelloWorld from module hello
2022-07-29 02:39:35.047865 INFO hello_world: Hello from AppDaemon
2022-07-29 02:39:35.050487 INFO hello_world: You are now ready to run Apps!
2022-07-29 02:39:35.055885 INFO AppDaemon: App initialization complete
2022-07-29 02:39:38.591510 INFO AppDaemon: New client Admin Client connected
2022-07-29 02:39:47.186389 INFO AppDaemon: Client disconnection from Admin Client
2022-07-29 02:39:47.471378 INFO AppDaemon: New client Admin Client connected
2022-07-29 02:43:04.363216 INFO AppDaemon: Reading config
2022-07-29 02:43:04.379424 INFO AppDaemon: /config/appdaemon/apps/apps.yaml added or modified
2022-07-29 02:43:04.384879 INFO AppDaemon: App ‘two_gang_switch’ added
2022-07-29 02:43:04.386606 INFO AppDaemon: Found 2 total apps
2022-07-29 02:43:04.387904 INFO AppDaemon: Adding thread 1
2022-07-29 02:43:04.433639 INFO AppDaemon: Initializing app two_gang_switch using class BroadlinkS3Hub from module broadlink_s3_hub
2022-07-29 02:43:04.444084 WARNING two_gang_switch: ------------------------------------------------------------
2022-07-29 02:43:04.445417 WARNING two_gang_switch: Unexpected error initializing app: two_gang_switch:
2022-07-29 02:43:04.446499 WARNING two_gang_switch: ------------------------------------------------------------
2022-07-29 02:43:04.449698 WARNING two_gang_switch: Traceback (most recent call last):
File “/usr/lib/python3.10/site-packages/appdaemon/app_management.py”, line 1026, in check_app_updates
await self.init_object(app)
File “/usr/lib/python3.10/site-packages/appdaemon/app_management.py”, line 321, in init_object
modname = await utils.run_in_executor(self, import, app_args[“module”])
File “/usr/lib/python3.10/site-packages/appdaemon/utils.py”, line 337, in run_in_executor
response = future.result()
File “/usr/lib/python3.10/concurrent/futures/thread.py”, line 58, in run
result = self.fn(*self.args, **self.kwargs)
File “/config/appdaemon/apps/broadlink-s3-hub-app-daemon/broadlink_s3_hub.py”, line 2, in
import broadlink
ModuleNotFoundError: No module named ‘broadlink’
2022-07-29 02:43:04.453342 WARNING two_gang_switch: ------------------------------------------------------------
2022-07-29 02:43:04.454210 WARNING AppDaemon: Unable to find module two_gang_switch - initialize() skipped
2022-07-29 02:43:33.817879 INFO AppDaemon: Client disconnection from Admin Client
2022-07-29 02:43:34.061811 INFO AppDaemon: New client Admin Client connected
2022-07-29 02:44:41.143773 INFO AppDaemon: Client disconnection from Admin Client
2022-07-29 02:44:41.428686 INFO AppDaemon: New client Admin Client connected
2022-07-29 02:45:25.722204 INFO AppDaemon: Client disconnection from Admin Client
I feel like i’m 99% of the way there.
But I’m getting the follow errors:
Log from AppDaemon -
2022-09-02 00:47:23.435124 WARNING HASS: Code: 500, error: 500 Internal Server Error Server got itself in trouble
2022-09-02 00:47:23.434893 WARNING HASS: Error setting Home Assistant state default.Dining.Room.Lights, {‘state’: ‘on’, ‘attributes’: {‘friendly_name’: ‘Dining_Room_Lights’}}
Log from HASS -
2022-09-02 11:45:53.339430 INFO one_gang_switch: Device state for entity: ‘Dining.Room.Lights’, ‘off’
2022-09-02 11:45:53.346758 WARNING HASS: Error setting Home Assistant state default.Dining.Room.Lights, {‘state’: ‘off’, ‘attributes’: {‘friendly_name’: ‘Dining_Room_Lights’}}
2022-09-02 11:45:53.347037 WARNING HASS: Code: 500, error: 500 Internal Server Error
Server got itself in trouble
Config:
one_gang_switch:
module: broadlink_s3_hub
class: BroadlinkS3Hub
hub_ip: “192.168.0.11”
did: “00000000000000000000ec0bae382f9a”
scan_interval: 0.5
friendly_names:
- Dining_Room_Lights
entity_ids:
- Dining.Room.Lights
Any help would be greatly appreciated!
Hi, I spend 4 long evenings fallowing and trying to set up my Broadlink Wall switches But Unsuccessful. Could you please Help me! i did everything as fallows but nothing comes up in entities.
With appreciation
Tom
2022-09-07 01:46:45.147489 WARNING two_gang_switch: Unexpected error initializing app: two_gang_switch:
2022-09-07 01:46:45.148527 WARNING two_gang_switch: ------------------------------------------------------------
2022-09-07 01:46:45.150294 WARNING two_gang_switch: Traceback (most recent call last):
File “/usr/lib/python3.10/site-packages/appdaemon/app_management.py”, line 1026, in check_app_updates
await self.init_object(app)
File “/usr/lib/python3.10/site-packages/appdaemon/app_management”, line 321, in init_object
modname = await utils.run_in_executor(self, import, app_args[“module”])
File “/usr/lib/python3.10/site-packages/appdaemon/utils”, line 337, in run_in_executor
response = future.result()
File “/usr/lib/python3.10/concurrent/futures/thread”, line 58, in run
result = self.fn(self.args, **self.kwargs)
File “/config/appdaemon/apps/broadlink-s3-hub-app-daemon/broadlink/broadlink_s3_hub”, line 2, in
import broadlink
File “/config/appdaemon/apps/broadlink-s3-hub-app-daemon/broadlink/init”, line 12, in
from .light import lb1, lb2
ImportError: cannot import name ‘lb1’ from ‘broadlink.light’ (/config/appdaemon/apps/broadlink-s3-hub-app-daemon/broadlink/light)
2022-09-07 01:46:45.151440 WARNING two_gang_switch: ------------------------------------------------------------
2022-09-07 01:46:45.153107 WARNING AppDaemon: Unable to find module two_gang_switch - initialize() skipped
2022-09-07 01:46:48.238534 INFO AppDaemon: Reading config
2022-09-07 01:46:48.250860 INFO AppDaemon: /config/appdaemon/apps/apps.yaml added or modified
2022-09-07 01:46:48.252434 INFO AppDaemon: App ‘two_gang_switch’ changed
2022-09-07 01:46:48.256861 INFO AppDaemon: Found 1 total apps
2022-09-07 01:46:48.307209 INFO AppDaemon: Terminating two_gang_switch
2022-09-07 01:46:48.311883 INFO AppDaemon: Initializing app two_gang_switch using class BroadlinkS3Hub from module broadlink_s3_hub
2022-09-07 01:46:48.329167 WARNING two_gang_switch: ------------------------------------------------------------
2022-09-07 01:46:48.330426 WARNING two_gang_switch: Unexpected error initializing app: two_gang_switch:
2022-09-07 01:46:48.331685 WARNING two_gang_switch: ------------------------------------------------------------
2022-09-07 01:46:48.333563 WARNING two_gang_switch: Traceback (most recent call last):
File “/usr/lib/python3.10/site-packages/appdaemon/app_management.py”, line 1026, in check_app_updates
await self.init_object(app)
File “/usr/lib/python3.10/site-packages/appdaemon/app_management.py”, line 321, in init_object
modname = await utils.run_in_executor(self, import, app_args[“module”])
File “/usr/lib/python3.10/site-packages/appdaemon/utils.py”, line 337, in run_in_executor
response = future.result()
File “/usr/lib/python3.10/concurrent/futures/thread.py”, line 58, in run
result = self.fn(self.args, **self.kwargs)
File “/config/appdaemon/apps/broadlink-s3-hub-app-daemon/broadlink/broadlink_s3_hub.py”, line 2, in
import broadlink
File “/config/appdaemon/apps/broadlink-s3-hub-app-daemon/broadlink/init.py”, line 12, in
from .light import lb1, lb2
ImportError: cannot import name ‘lb1’ from ‘broadlink.light’ (/config/appdaemon/apps/broadlink-s3-hub-app-daemon/broadlink/light.py)
2022-09-07 01:46:48.334780 WARNING two_gang_switch: ------------------------------------------------------------
2022-09-07 01:46:48.336737 WARNING AppDaemon: Unable to find module two_gang_switch - initialize() skipped
2022-09-07 01:47:50.306660 WARNING HASS: Disconnected from Home Assistant, retrying in 5 seconds
2022-09-07 01:47:55.317728 WARNING HASS: Disconnected from Home Assistant, retrying in 5 seconds
2022-09-07 01:48:00.332650 WARNING HASS: Disconnected from Home Assistant, retrying in 5 seconds
2022-09-07 01:48:03.830507 WARNING HASS: Error getting services - retrying
Task exception was never retrieved
future: <Task finished name=‘Task-91’ coro=<HassPlugin.run_hass_service_check() done, defined at /usr/lib/python3.10/site-packages/appdaemon/plugins/hass/hassplugin.py:783> exception=ClientResponseError(RequestInfo(url=URL(‘http://supervisor/core/api/services’), method=‘GET’, headers=<CIMultiDictProxy(‘Host’: ‘supervisor’, ‘Authorization’: ‘Bearer 3cefe3823cbbf70107ceba61d5d00a2308732cceb010d993e275fb1b9ac21ecc1279cd85bb358ad0290ba6bbbea8dbc5da7247fe5cd4339e’, ‘Accept’: '/’, ‘Accept-Encoding’: ‘gzip, deflate’, ‘User-Agent’: ‘Python/3.10 aiohttp/3.8.1’)>, real_url=URL(‘http://supervisor/core/api/services’)), (), status=502, message=‘Bad Gateway’, headers=<CIMultiDictProxy(‘Content-Type’: ‘text/plain; charset=utf-8’, ‘Content-Length’: ‘16’, ‘Date’: ‘Tue, 06 Sep 2022 23:48:03 GMT’, ‘Server’: ‘Python/3.10 aiohttp/3.8.1’)>)>
Traceback (most recent call last):
File “/usr/lib/python3.10/site-packages/appdaemon/plugins/hass/hassplugin.py”, line 792, in run_hass_service_check
hass_services = await self.get_hass_services()
File “/usr/lib/python3.10/site-packages/appdaemon/plugins/hass/hassplugin.py”, line 754, in get_hass_services
r.raise_for_status()
File “/usr/lib/python3.10/site-packages/aiohttp/client_reqrep.py”, line 1004, in raise_for_status
raise ClientResponseError(
aiohttp.client_exceptions.ClientResponseError: 502, message=‘Bad Gateway’, url=URL(‘supervisor/core/api/services’)
2022-09-07 01:48:05.379765 WARNING HASS: Disconnected from Home Assistant, retrying in 5 seconds
2022-09-07 01:48:10.394105 WARNING HASS: Disconnected from Home Assistant, retrying in 5 seconds
2022-09-07 01:48:17.366950 WARNING HASS: Disconnected from Home Assistant, retrying in 5 seconds
2022-09-07 01:48:22.383363 WARNING HASS: Disconnected from Home Assistant, retrying in 5 seconds
2022-09-07 01:48:27.398521 WARNING HASS: Disconnected from Home Assistant, retrying in 5 seconds
2022-09-07 01:48:32.416579 WARNING HASS: Disconnected from Home Assistant, retrying in 5 seconds
2022-09-07 01:48:38.058104 INFO HASS: Connected to Home Assistant 2022.8.7
2022-09-07 01:48:38.254485 INFO HASS: Evaluating startup conditions
2022-09-07 01:48:38.273242 INFO HASS: Startup condition met: hass state=RUNNING
2022-09-07 01:48:38.273895 INFO HASS: All startup conditions met
2022-09-07 01:48:38.341807 INFO AppDaemon: Processing restart for HASS
2022-09-07 01:48:38.342567 INFO AppDaemon: Terminating two_gang_switch
2022-09-07 01:48:38.344124 INFO AppDaemon: Initializing app two_gang_switch using class BroadlinkS3Hub from module broadlink_s3_hub
2022-09-07 01:48:38.358588 WARNING two_gang_switch: ------------------------------------------------------------
2022-09-07 01:48:38.359165 WARNING two_gang_switch: Unexpected error initializing app: two_gang_switch:
2022-09-07 01:48:38.359698 WARNING two_gang_switch: ------------------------------------------------------------
2022-09-07 01:48:38.360619 WARNING two_gang_switch: Traceback (most recent call last):
File “/usr/lib/python3.10/site-packages/appdaemon/app_management”, line 1026, in check_app_updates
await self.init_object(app)
File “/usr/lib/python3.10/site-packages/appdaemon/app_management”, line 321, in init_object
modname = await utils.run_in_executor(self, import, app_args[“module”])
File “/usr/lib/python3.10/site-packages/appdaemon/utils.py”, line 337, in run_in_executor
response = future.result()
File “/usr/lib/python3.10/concurrent/futures/thread.py”, line 58, in run
result = self.fn(*self.args, **self.kwargs)
File “/config/appdaemon/apps/broadlink-s3-hub-app-daemon/broadlink/broadlink_s3_hub”, line 2, in
import broadlink
File “/config/appdaemon/apps/broadlink-s3-hub-app-daemon/broadlink/init.py”, line 12, in
from .light import lb1, lb2
ImportError: cannot import name ‘lb1’ from ‘broadlink.light’ (/config/appdaemon/apps/broadlink-s3-hub-app-daemon/broadlink/light)
2022-09-07 01:48:38.361062 WARNING two_gang_switch: ------------------------------------------------------------
2022-09-07 01:48:38.362027 WARNING AppDaemon: Unable to find module two_gang_switch - initialize() skipped
2022-09-07 01:48:38.399173 INFO HASS: Registering new service notify/alexa_media_last_called
2022-09-07 01:48:40.964560 INFO HASS: Registering new service ffmpeg/start
2022-09-07 01:48:40.968517 INFO HASS: Registering new service ffmpeg/stop
2022-09-07 01:48:40.971030 INFO HASS: Registering new service ffmpeg/restart
2022-09-07 01:56:13.564804 INFO AppDaemon: Reloading Module: /config/appdaemon/apps/broadlink-s3-hub-app-daemon/broadlink/light
2022-09-07 01:56:13.566245 WARNING AppDaemon: No app description found for: light - ignoring
2022-09-07 01:56:30.974565 INFO AppDaemon: Reloading Module: /config/appdaemon/apps/broadlink-s3-hub-app-daemon/broadlink/light
2022-09-07 01:56:30.975350 WARNING AppDaemon: No app description found for: light - ignoring
Just tried myself and all works - both 1-gang and 2-gang switches.
One definitely needs to add the “broadlink” folder manually (can be done through Studio Code Server) - may be worth adding it into GitHub install description.
Personally, I found DIDs in Broadlink app under Switch Device Info. Most of mine had only last 3 digit different.
P.s. it works with two S3 hubs too, though unfortunately some of my switches refuse to stay online - will likely replace them with Aqara Zigbee.
Thanks a lot for putting this together!
Did you remove lock from Hub in Broadlink app? that might be it.
I seem to have this semi working, however the entities it creates are read-only.
So I can see the state but not change the state, ie switch lights on and so on.
Any suggestions?
(lock is definitely off in the app)
Can you post your apps.yaml?
hello_world:
module: hello
class: HelloWorld
broadlink_Kitchen:
module: broadlink_s3_hub
class: BroadlinkS3Hub
hub_ip: “192.168.0.176”
did: “00000000000000000000ec0bae384d52”
scan_interval: 0.5
friendly_names:
- Kitchen_1_Light
entity_ids:
- light.Kitchen1_gang1
Just a helpful note to some (hopefully)
I got myself in a muddle adding new switches today, turned out the issue was I used capitals in the entity_ids of my Apps.Yaml file. HA would pick up the entities and I could add them to a dashboard but the toggle switch wouldn’t work.
This is down to (I presume) HA ignoring capitals in entity names. I tried editing the dashboard code manually to caps but this just crapped out entirely on me, the only workaround was to change the IDs to all lower case in my apps.yaml file and it worked straight away (after a reload of AppDaemon)
You may be having the issue I’ve just posted about separately, try amending your entity IDs to be in all lower case and restart AppDaemon
Issues tend to be something in the apps.yaml if everything else has been done correctly, please post this if you can so we can help