Have you tried the beta version with the reconnecting logic?
Will do! Thanks for all you’ve done.
It stayed connected longer on the beta but eventually disconnected.
If you can send me any logs that would help.
Okay, I’ll try hunting them down tomorrow
@JeffSteinbok When this integration is used, does the fan need connection to the internet? Or is everything done locally?
It’s cloud-based.
Haven’t been able to find it in the logs but I’ve only been around the app. When I get the chance I’ll hunt for them on my pc
Hi Jeff,
I am too having similar issues with the fan disconnecting frequently. I have installed your latest beta but don’t know for some reason things seem to be getting worse.Attaching logs hope it helps
[quote="2023-07-18 23:09:05.392 WARNING (SyncWorker_3) [homeassistant.loader] We found a custom integration hacs which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2023-07-18 23:09:05.393 WARNING (SyncWorker_3) [homeassistant.loader] We found a custom integration eufy_security which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2023-07-18 23:09:05.394 WARNING (SyncWorker_3) [homeassistant.loader] We found a custom integration webrtc which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2023-07-18 23:09:05.394 WARNING (SyncWorker_3) [homeassistant.loader] We found a custom integration frigate which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2023-07-18 23:09:05.395 WARNING (SyncWorker_3) [homeassistant.loader] We found a custom integration dwains_dashboard which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2023-07-18 23:09:05.395 WARNING (SyncWorker_3) [homeassistant.loader] We found a custom integration govee which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2023-07-18 23:09:05.396 WARNING (SyncWorker_3) [homeassistant.loader] We found a custom integration meross_lan which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2023-07-18 23:09:05.397 WARNING (SyncWorker_3) [homeassistant.loader] We found a custom integration dreo which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2023-07-18 23:09:18.400 WARNING (MainThread) [custom_components.govee] API is back online.
2023-07-18 23:09:29.468 WARNING (MainThread) [homeassistant.components.media_player] Setup of media_player platform dlna_dmr is taking over 10 seconds.
2023-07-18 23:10:20.524 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [140259548768400] ‘PyDreoTowerFan’ object has no attribute ‘_preset_modes’
Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py”, line 205, in handle_call_service
await hass.services.async_call(
File “/usr/src/homeassistant/homeassistant/core.py”, line 1965, in async_call
response_data = await coro
^^^^^^^^^^
File “/usr/src/homeassistant/homeassistant/core.py”, line 2005, in _execute_service
return await cast(
^^^^^^^^^^^
File “/usr/src/homeassistant/homeassistant/helpers/entity_component.py”, line 235, in handle_service
return await service.entity_service_call(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/src/homeassistant/homeassistant/helpers/service.py”, line 848, in entity_service_call
response_data = task.result() # pop exception if have
^^^^^^^^^^^^^
File “/usr/src/homeassistant/homeassistant/helpers/entity.py”, line 1192, in async_request_call
return await coro
^^^^^^^^^^
File “/usr/src/homeassistant/homeassistant/helpers/service.py”, line 892, in _handle_entity_call
result = await task
^^^^^^^^^^
File “/usr/src/homeassistant/homeassistant/components/fan/init.py”, line 240, in async_set_preset_mode
await self.hass.async_add_executor_job(self.set_preset_mode, preset_mode)
File “/usr/local/lib/python3.11/concurrent/futures/thread.py”, line 58, in run
result = self.fn(*self.args, **self.kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/config/custom_components/dreo/fan.py”, line 143, in set_preset_mode
self.device.set_preset_mode(preset_mode)
File “/config/custom_components/dreo/pydreo/pydreofan.py”, line 92, in set_preset_mode
self._send_command(WINDTYPE_KEY, self._preset_modes.index(preset_mode) + 1)
^^^^^^^^^^^^^^^^^^
AttributeError: ‘PyDreoTowerFan’ object has no attribute ‘_preset_modes’
2023-07-18 23:10:22.615 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [140259548768400] ‘PyDreoTowerFan’ object has no attribute ‘_preset_modes’
Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py”, line 205, in handle_call_service
await hass.services.async_call(
File “/usr/src/homeassistant/homeassistant/core.py”, line 1965, in async_call
response_data = await coro
^^^^^^^^^^
File “/usr/src/homeassistant/homeassistant/core.py”, line 2005, in _execute_service
return await cast(
^^^^^^^^^^^
File “/usr/src/homeassistant/homeassistant/helpers/entity_component.py”, line 235, in handle_service
return await service.entity_service_call(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/src/homeassistant/homeassistant/helpers/service.py”, line 848, in entity_service_call
response_data = task.result() # pop exception if have
^^^^^^^^^^^^^
File “/usr/src/homeassistant/homeassistant/helpers/entity.py”, line 1192, in async_request_call
return await coro
^^^^^^^^^^
File “/usr/src/homeassistant/homeassistant/helpers/service.py”, line 892, in _handle_entity_call
result = await task
^^^^^^^^^^
File “/usr/src/homeassistant/homeassistant/components/fan/init.py”, line 240, in async_set_preset_mode
await self.hass.async_add_executor_job(self.set_preset_mode, preset_mode)
File “/usr/local/lib/python3.11/concurrent/futures/thread.py”, line 58, in run
result = self.fn(*self.args, **self.kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/config/custom_components/dreo/fan.py”, line 143, in set_preset_mode
self.device.set_preset_mode(preset_mode)
File “/config/custom_components/dreo/pydreo/pydreofan.py”, line 92, in set_preset_mode
self._send_command(WINDTYPE_KEY, self._preset_modes.index(preset_mode) + 1)
^^^^^^^^^^^^^^^^^^
AttributeError: ‘PyDreoTowerFan’ object has no attribute ‘_preset_modes’
2023-07-18 23:10:23.995 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [140259548768400] ‘PyDreoTowerFan’ object has no attribute ‘_preset_modes’
Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py”, line 205, in handle_call_service
await hass.services.async_call(
File “/usr/src/homeassistant/homeassistant/core.py”, line 1965, in async_call
response_data = await coro
^^^^^^^^^^
File “/usr/src/homeassistant/homeassistant/core.py”, line 2005, in _execute_service
return await cast(
^^^^^^^^^^^
File “/usr/src/homeassistant/homeassistant/helpers/entity_component.py”, line 235, in handle_service
return await service.entity_service_call(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/src/homeassistant/homeassistant/helpers/service.py”, line 848, in entity_service_call
response_data = task.result() # pop exception if have
^^^^^^^^^^^^^
File “/usr/src/homeassistant/homeassistant/helpers/entity.py”, line 1192, in async_request_call
return await coro
^^^^^^^^^^
File “/usr/src/homeassistant/homeassistant/helpers/service.py”, line 892, in _handle_entity_call
result = await task
^^^^^^^^^^
File “/usr/src/homeassistant/homeassistant/components/fan/init.py”, line 240, in async_set_preset_mode
await self.hass.async_add_executor_job(self.set_preset_mode, preset_mode)
File “/usr/local/lib/python3.11/concurrent/futures/thread.py”, line 58, in run
result = self.fn(*self.args, **self.kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/config/custom_components/dreo/fan.py”, line 143, in set_preset_mode
self.device.set_preset_mode(preset_mode)
File “/config/custom_components/dreo/pydreo/pydreofan.py”, line 92, in set_preset_mode
self._send_command(WINDTYPE_KEY, self._preset_modes.index(preset_mode) + 1)
^^^^^^^^^^^^^^^^^^
AttributeError: ‘PyDreoTowerFan’ object has no attribute ‘_preset_modes’
[/quote]
File an issue on GitHub w/ logs please.
Device Support
Just pushed out 0.4.0b1 with very draft support for treating this as a “Device” with multiple sensors. Right now, just temperature, and no units. Soon, planning on supporting sensors/switches for other attributes.
Just sharing the appreciation - I looked for something to control my Dreo fan via HA a number of months ago and there was nothing. Checking again today and this plugin not only works, it works well. Thanks for the great work!
I wanted to let you know @JeffSteinbok that the disconnects seem to have stopped. Whatever you did seems to have fixed it. Thank you!
I appreciate that. Thank you.
This is my first OSS project and first Python project so learning a lot.
Thanks to all of you who tested it and gave feedback. I am working on a test suite for it based on the stuff done in VESync. If anyone has background here, I wouldn’t turn away assistance.
Jeff - I’ve done some significant Python development in the past (including writing tests). I don’t have any experience writing for HA, but I could be willing to help if I can. HMU via email if you like - you can reach me at cole (dot) tuininga (at) gmail (dot) com.
DR-HAF003S is working fine. Automations can be a little tricky as you sometimes have to switch between calling it a device and an entity depending on what you are trying to do (ie, trigger vs conditions vs action). But, you can eventually get it to work out. To be fair, I went deep down the rabbit hole in configuring an automation that branches into different scenarios. Been having fun with it. Thanks for the great integration!
If the purifier ever works its way onto the list somehow, I will make sure to jump back down into the rabbit hole to see what can be done with that as well automation-wise
Now that we have an abstraction for types of fans, should be able to get this done.
Curious what complexity exists with devices vs entities and what i could do to help there.
I purchased my fans based on this integration, so thanks.
I have the PolyFan 513S and CF714S (DR-HAF003S). I was able to install the integration but the CF714S (DR-HAF004S) card does not show horizontal and vertical oscillating and the display off setting is not working on either fan.
Also today (after a week working), I can not shut off the fans from the HA App. Any help would be much appraised. Thanks.
Here’s the log for reference:
2023-08-03 12:06:31.708 INFO (DreoWebSocketStream) [pydreo] temperature reported: 82
2023-08-03 12:07:22.932 INFO (DreoWebSocketStream) [pydreo] temperature reported: 84
2023-08-03 12:08:11.913 INFO (DreoWebSocketStream) [pydreo] temperature reported: 86
2023-08-03 12:08:12.129 INFO (DreoWebSocketStream) [pydreo] temperature reported: 86
2023-08-03 13:07:52.254 INFO (DreoWebSocketStream) [pydreo] temperature reported: 87
2023-08-03 13:07:52.330 INFO (DreoWebSocketStream) [pydreo] temperature reported: 87
2023-08-03 13:08:12.815 INFO (DreoWebSocketStream) [pydreo] temperature reported: 86
2023-08-03 13:14:28.378 INFO (DreoWebSocketStream) [pydreo] temperature reported: 87
2023-08-03 13:23:02.928 INFO (DreoWebSocketStream) [pydreo] temperature reported: 86
2023-08-03 13:23:03.114 INFO (DreoWebSocketStream) [pydreo] temperature reported: 86
2023-08-03 13:39:33.689 INFO (DreoWebSocketStream) [pydreo] Dreo WebSocket Closed - Unless intended, will reconnect
2023-08-03 13:39:33.689 INFO (DreoWebSocketStream) [pydreo] Starting WebSocket for incoming changes.
2023-08-03 13:39:38.691 ERROR (DreoWebSocketStream) [root] Uncaught thread exception
File “/config/custom_components/dreo/pydreo/init.py”, line 277, in start_ws_wrapper
File “/config/custom_components/dreo/pydreo/init.py”, line 303, in _start_websocket
File “/config/custom_components/dreo/pydreo/init.py”, line 317, in _ws_handler
File “/config/custom_components/dreo/pydreo/init.py”, line 303, in _start_websocket
File “/config/custom_components/dreo/pydreo/init.py”, line 317, in _ws_handler
File “/config/custom_components/dreo/pydreo/init.py”, line 303, in _start_websocket
File “/config/custom_components/dreo/pydreo/init.py”, line 317, in _ws_handler
File “/config/custom_components/dreo/pydreo/init.py”, line 303, in _start_websocket
File “/config/custom_components/dreo/pydreo/init.py”, line 317, in _ws_handler
File “/config/custom_components/dreo/pydreo/init.py”, line 303, in _start_websocket
File “/config/custom_components/dreo/pydreo/init.py”, line 317, in _ws_handler
There is a known issue around the system disconnecting sometimes. Restarting HA will fix this. I need to figure that one out. Your logs should be helpful. Would be great if you had the debug logging enabled, and then capture it. Clearly the uncaught thread exception is the problem here.
For the other stuff, can you please file issues in GitHub? And send me the diagnostics from the integration? Curious why those extra sensors aren’t showing up.
Also, you’re running the latest version?
Thanks @JeffSteinbok. I’m using v0.4.1.
I’ll turn on diags and file an issue on GitHub for the other stuff.