Giter VIP home page Giter VIP logo

Comments (19)

shenxn avatar shenxn commented on July 19, 2024 2

@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.

shenxn avatar shenxn commented on July 19, 2024 2

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.

shenxn avatar shenxn commented on July 19, 2024 1

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.

googanhiem avatar googanhiem commented on July 19, 2024

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.

shenxn avatar shenxn commented on July 19, 2024

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.

googanhiem avatar googanhiem commented on July 19, 2024

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.

googanhiem avatar googanhiem commented on July 19, 2024

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.

iceman23e avatar iceman23e commented on July 19, 2024

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.

googanhiem avatar googanhiem commented on July 19, 2024

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.

gee-jay-bee avatar gee-jay-bee commented on July 19, 2024

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.

googanhiem avatar googanhiem commented on July 19, 2024

@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.

gee-jay-bee avatar gee-jay-bee commented on July 19, 2024

1 x Pure Hot + Cool Link and some Pure Cool (desk and tower). All are affected it seems.

from ha-dyson.

iceman23e avatar iceman23e commented on July 19, 2024

I have an HP04 Pure Hot+Cool.

from ha-dyson.

googanhiem avatar googanhiem commented on July 19, 2024

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.

damiano75 avatar damiano75 commented on July 19, 2024

from ha-dyson.

googanhiem avatar googanhiem commented on July 19, 2024

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.

shenxn avatar shenxn commented on July 19, 2024

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.

damiano75 avatar damiano75 commented on July 19, 2024

It seems it works for me: HP04

from ha-dyson.

shenxn avatar shenxn commented on July 19, 2024

Closing. Feel free to re-open if not working.

from ha-dyson.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.