-
-
Notifications
You must be signed in to change notification settings - Fork 31.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dyson integration stopped working with 2021.2 #46400
Comments
Same issue here, running Home Assistant OS. My error log is not exactly the same however
|
I don't get the later two warnings from your log, just the first two. For more detail, try adding this to your config:
|
dyson documentation |
With the detailed logs turned on I get these warnings.
Unfortunately no good hints pointing to the cause of the warnings as far as I can see... |
Same here. Running 2021.2.2 in a VENV on Ubuntu 18.04LTS. Has been running for several yrs, no issue. Restarted yesterday while creating a new Binary Sensor. Dyson integration will no longer setup, listed as invalid_config. I have power cycled network, power cycled Dyson fans (I have 5), without fix. |
I have a feeling they are blocking the User Agent, or more specifically, looking for a very specific User Agent. This has happened previously. I've tested a few changes and yet to find one that works. |
For what it's worth, it doesn't work after downgrade to 2021.1.5 either, so it looks like a Dyson-side change |
Ditto, Hot & Cool fan working fine pre-update.. Now not functioning |
@Stanwise thanks for confirming, I was trying to roll back earlier but couldn't find how :) |
Same problem here, HA can't log into my Dyson account. It doesn't seem to be a problem with HA but with Dyson's servers. |
Yep @Stanwise is correct this is a Dyson api change.. probably a cloudflare block of this components dependency libpurecool and its auth method. They've blocked it in the past (probably not even intentionally). This means its a fix needed for libpurecool not HA. |
On dyson home assistant integration page it is written that the integration's IoT class is 'local push'. so why HA needs to communicate with the server? |
I think Dyson is just having issues authenticating on their end. I couldn't even log into the website. When trying to log into the app, it says "Sorry, we can't connect to the Dyson network. We're working to fix this. Please try again later." |
Adding to @arifroni comment. I understand the integration uses the email and password to log into Dyson service remotely to fetch the local machines information in order to connect to the machines. |
While the machines themselves run local MQTT they need credentials that only the Dyson server can provide :/ |
Yes, this component is a little clunky and forgotten. @shenxn is looking to build a new component that may fix a lot of the current issues. The current component relies on this initial auth to gain control, these credentials are not cached so they're updated on every reboot of HA. @kurozero0 The Dyson website and this component appear to use different servers, so the issues are probably unrelated |
Possible that Dyson changed something internally that broke HA and themselves? |
While @shenxn achieve the new component development, here is a temporary workaround which does not need to communicate with Dysons servers (talks directly with the fan's MQTT broker): https://community.home-assistant.io/t/dyson-pure-cool-link-local-mqtt-control/217263 The down side is that you no longer have a fan entity to expose to HomeKit for example... |
@googanhiem is right. The website and app appear to be working now but still nothing on HA. |
I have the same issue. Tried Charles to try to find out if the app had added some new header etc. It seems that Dyson uses SSL Certificate Pinning in their iOS app (this is good, but a little impractical here), which makes Charles unable to decrypt SSL traffic, even with a custom root certificate installed. So my only conclusion so far is that they haven't changed the endpoint URL. But if someone could shed some light on what the issue is I would be happy to make a PR for this. |
Unfortunately they do the same in their Android app so I couldn't get it to work from that direction either. Anyway - I have a half-okay method of having this work reliably which you can see here: etheralm/libpurecool#37 (comment) It would appear the library will need to add a |
@bfayers Great. I will test that tomorrow and report back. Nice work. |
It did work for me. Thanks for your effort. |
Can confirm it also works for me. Just make sure you re-authenticate the app right before making the POST-request. |
Looks like you need to make an account verification before login: etheralm/libpurecool#37 (comment) If confirmed libpurecool will probably get updated in no time |
Following, same issue for my two fans. Error: Log entries: All worked well in the past, I hope a solution is found. I learned a lot with this integration and the automation possibilities this provided. |
I assume you two, @Elmatthews and @kritin81 , where not actually just putting Anyway, it looks like a fix may have been found at this point so hopefully it won't be long before a new library release. |
This login method modification seems to work for me: def __init__(self):
[... existing code...]
self._authNextTime = None
def login(self):
self._logged = False
if self._authNextTime != None and self._authNextTime > datetime.datetime.now():
print("Could not identify for the moment, next authent will be made at: %s" % (self._authNextTime))
else:
"""Login to dyson web services."""
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
print("Disabling insecure request warnings since "
"dyson are using a self signed certificate.")
pre_login = requests.get(
"https://{0}/v1/userregistration/userstatus?country={1}&email={2}".format(
self._dyson_api_url, self._country, self._email),
headers=self._headers,
verify=False
)
print("pre_login return code: %d, text: %s" % (pre_login.status_code, pre_login.text))
if pre_login.status_code == requests.codes.ok:
json_response = pre_login.json()
if 'accountStatus' in json_response and json_response['accountStatus'] == 'ACTIVE':
request_body = {
"Email": self._email,
"Password": self._password
}
login = requests.post(
"https://{0}/v1/userregistration/authenticate?country={1}".format(
self._dyson_api_url, self._country),
headers=self._headers,
json=request_body,
verify=False
)
# pylint: disable=no-member
print("login return code: %d, text: %s" % (login.status_code, login.text))
if login.status_code == requests.codes.ok:
json_response = login.json()
print(json_response)
self._auth = HTTPBasicAuth(json_response["Account"],
json_response["Password"])
self._logged = True
elif 'Retry-After' in login.headers:
self._authNextTime = datetime.datetime.now() + datetime.timedelta(seconds=int(login.headers['Retry-After']))
print("Return %d" % self._logged, flush=True)
return self._logged If i can, this week-end, i will make a proper PR. This code use print, this is not safe obviously |
Stopped working for me as well. |
Please refer to my workaround as they haven't integrated shenxn's solution as that one works like hot cakes. FYI with ShenXN's solution I've been running it stable for the last few months since Dyson integrated 2FA
|
I’ve been resistant to installing HACS I want to keep my HA install simple and love how much is integrated into core. Is there a way that this workaround can bu put into core? |
You might want to talk to ShenXN and see if he has cycles to help HA to integrate it into core, since the native dyson plugin is no longer compliant with the new dyson setup. I've made this request a few months ago, but haven't seen any new traction |
I’m not super technical but is there a way to just pull / CURL these files from ShenXN repo into the HA Core? |
@WilldabeastHA the easiest solution is to just install HACS. Your concerns with avoiding it are unfounded and it requires more work for people to provide instructions for workarounds when HACS is a perfectly adequate UI |
The creator of HACS (Joakim Sørensen) works for NabuCasa, so I wouldn't be too worried about HACS. The only way this will get merged into the core is if somebody submits a pull request to either fix the existing integration or replace it with new version based on the ShenXN changes. It appears the original maintainer of libpurecool has abandoned it so some forks and changes need to be made there to get it moving again. That needs to happen but it also needs people with enough time and effort to get involved and make that happen. If you want a quick fix, HACS and the ShenXN custom integration. |
I have been holding off any of these fixes hoping the fix would be added to Core, but today I removed all existing dyson integration and entities, added the dyson-local integration to HACS and set up the device using wifi information using the instructions here: https://github.com/shenxn/ha-dyson/ It was super easy, and everything is working fine, wish I did it sooner! Thanks for posting the instructions to add the repository to HACS, it made me finally do it. |
At this point, the core integration has been broken for months. If nobody wants to put the time in to fix it (which is fair enough, no complaint here), it might be worth removing it entirely, there's no point keeping broken code around except letting new users think this is a working integration when it's not. Or at the very least updating the documentation to make it obvious. |
I had originally intended on opening a PR to fix the version in core, however at this point it would be wasted work as shenxn's is much better and as they mention; ultimately intend for it to become official. |
Looking forward to it becoming official. I’ll try the HACS route. Is it best to install it in the container or the host? **Quick update. I installed HACS and the ShenXN Dyson integration and I’m presently surprised! Works great and easy to use. Thanks for the encouragement. |
There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. |
This is still an issue pending #53801. |
Agree, it's just misleading to have a posted official integration on HA's site. Is there an official deprecation procedure? |
If someone has the time to give me some pointers on how to diagnose the
authentication issue based on past experiences I can give a try to this, so
far I've attempted to diagnose this myself with no success
|
To make things more complicated it seems that the custom integration from https://github.com/shenxn/ha-dyson/ is also somehow broken. If you try to add devices using the account it "fails to connect" |
I also tried following the steps to sniff the device token with no success, I'd only need some pointers. It seems that what is breaking everything is just a matter of authentication changes by dyson |
hey, i still have my dyson-local plugin from shenxn still working, just the cloud version is straight broken. After looking back at some notes about the local version, there are some details on how to get the password, although i don't know if it is still relavent: https://community.home-assistant.io/t/dyson-pure-cool-link-local-mqtt-control/217263 also back a few months shenxa was quite responsive in his responses, you might want to give him a ping and see if he's willing to give some pointers |
So this was me, just setup Dyson and found its not working and landed here. Please remove if its not supported and hopefully it will return at some point soon. |
@dougmaitelli - I have the same issue. Have you found a way around that issue? Thx |
The Dyson integration has been removed from Home Assistant. Therefore this issue should/can be closed. |
The problem
I have been using the dyson integration with my hot/cold fan successfully for a while. I upgraded HA last night to 2021.2 and saw alerts that the integration couldn't initialize
What is version of Home Assistant Core has the issue?
2021.2
What was the last working version of Home Assistant Core?
2021.1
What type of installation are you running?
Home Assistant Core
Integration causing the issue
Dyson
Link to integration documentation on our website
https://www.home-assistant.io/integrations/dyson/
Example YAML snippet
Anything in the logs that might be useful for us?
I'm running the qcow2 image in KVM. Happy to muck about with suggested tweaks if it helps narrow down the issue.
The text was updated successfully, but these errors were encountered: