Comments (19)
@googanhiem Thanks for the info. The connect and disconnect logic in libdyson
is a little bit complicated so there might be some bug. I'll try to refactor that and add some tests. I'll ping you for testing.
from ha-dyson.
This integration is designed to handle reconnections. There has to be some problems in the code. I'm a little busy these days. I'll look into it when I got some free time.
from ha-dyson.
Can you enable debug log to see if you can find anything related? Add the following lines into configuration.yaml
logger:
default: info
logs:
custom_components.dyson_local: debug
libdyson: debug
from ha-dyson.
Logs don’t shed too much light.
When the issue happens it gives these messages
2021-03-13 22:18:00 DEBUG (Thread-5) [libdyson.dyson_device] Disconnected with result code 1
2021-03-13 22:18:02 DEBUG (Thread-5) [libdyson.dyson_device] Connected with result code 0
Libdyson stops after this point but Dyson local continues unaware it failed.
from ha-dyson.
It seems libdyson
successfully reconnects the device, it should be able to work again. There might be some bug in the code. Currently I'm on a business trip and don't have access to any Dyson device. I'll try to dig into this when I'm back home.
from ha-dyson.
I tried reinitialising the integration a couple ways, but the issue persists. Basically the integration fails after around an hour following every reboot.
It also provides this error right after it fails now
Error fetching environmental data: Failed to request environmental data
Here are my findings after looking through the logs and troubleshooting,
- When the libdyson disconnects then appears to reconnect, the main issue seems to be that all state and environmental data stop transferring (the libdyson "New State" and "New Environmental State" json messages cease in the log, but the components "Finished fetching environmental data" message continues to appear after disconnections)
- I can still trigger service commands, but the HA state doesn't show it has changed (ex. fan.turn_on will turn the fan on, but it will continue to appear in HA with the off state)
- Both fans don't fail simultaneously, one fails then the next some time later, which leads me to believe my poor wifi connectivity with my fans is messing with the integration (due to being in a concrete building with lots of interference my fans disconnect then reconnects periodically daily).
- Seems like libdyson is losing connection due to error code 1 (which used to mean "Connection refused - incorrect protocol version")
from ha-dyson.
Cheers! Yeah, my limited python experience couldn't quite make sense of the connect logic, ha
I was able artificially trigger the error by rebooting my router if you want to test it yourself.
from ha-dyson.
For what it's worth, I'm having this same issue. My HP04 stays connected for about an hour on average before [libdyson.dyson_device] Disconnected with result code 1
. Only way I've found to restore control is a HA restart. Additionally, as googanhiem said, sometimes I can change the fan state without the front end changing, but most of the time, it's completely unresponsive.
from ha-dyson.
Nice to know I'm not the only one.
As its a connection issue there are two things I'd like to initially try with libdyson, (but since Hass OS went 64bit I can't find the site-packages),
- Changing the TIMEOUT to something higher than 10
- Changing the connect process to essentially restart the entire integration instead of just reconnecting. (it would take a little bit more time but it may be something to do with the MQTT broker or other elements that will allow it work)
If anyone knows where libdyson is in Hass OS, please tell me
from ha-dyson.
I'm also facing the same symptoms (sending commands works very intermittently but states don't update and a full restart is required to recover).
from ha-dyson.
@gee-jay-bee And @iceman23e which fans do you have?
I'm on the Dyson Pure Cool (not link, desk and base... both are affected)
from ha-dyson.
1 x Pure Hot + Cool Link and some Pure Cool (desk and tower). All are affected it seems.
from ha-dyson.
I have an HP04 Pure Hot+Cool.
from ha-dyson.
Thanks both, I thought it may have been only affecting certain devices, but it looks like it's more general.
I'm going to continue to look at changes to the way libdyson reconnects.
from ha-dyson.
from ha-dyson.
Increasing the timeout didn't help. I'm now trying some changes to the reconnect logic, but no luck yet. The integration continues to fail after around 45 minutes following reboot.
from ha-dyson.
I've released version 0.9.0. @googanhiem Can you try if it fixes your problem? Currently I don't have access to any Dyson device to test.
from ha-dyson.
It seems it works for me: HP04
from ha-dyson.
Closing. Feel free to re-open if not working.
from ha-dyson.
Related Issues (20)
- Dyson Purifier Humidify Cool Formaldehyde (358K) not supported HOT 10
- Dyson Cloud never worked, using Dyson Local only now HOT 7
- Type 438K Fails to Connect HOT 3
- Stopped working? HOT 20
- Core 2022.2.0: Sensor has device class temperature, state class measurement and unit °C with non-numeric value: off
- Support Request - Add Device - Dyson HP07 Purifier Hot and Cool - Device Type 527k HOT 12
- No Formaldehyde Value HOT 2
- New device type Dyson purifier cool formaldehyde HOT 4
- New actively maintained integration! Collaborators welcome! Details inside. HOT 8
- Wifi-less "Dyson Pure Humidity+Cool" is not supported
- state class measurement and unit °C thus indicating it has a numeric value; however, it has the non-numeric value: off HOT 4
- Failed to find the device using discovery
- Not working on Home Assistant v2023.6 HOT 1
- ha-dyson failing with "cannot import name 'DysonPurifierHumidifyCoolFormaldehyde' from 'libdyson'" HOT 3
- Oscillation/angle setting
- Deactivate preset mode, or preset mode none
- Planned deprecation of direction, oscillate, preset_mode and set_speed HOT 1
- Local integration stopped working in HA 2024.1 HOT 4
- Depreciation warning in logs HOT 1
- ValueError: invalid literal for int() with base 10: 'off'
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ha-dyson.