home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
69.77k stars 28.91k forks source link

400 returned for MyQ/Chamberlain Cover Integration #28229

Closed jrconlin closed 4 years ago

jrconlin commented 4 years ago

I'm seeing a number of error messages in my logs around the MyQ garage door integration (e.g.

2019-10-23 09:24:27 ERROR (MainThread) [pymyq.api] Getting device states failed: 09:24:17.016079 Client Error while requesting data from api/v4/UserDeviceDetails/Get: 400, message='Bad Request', url='https://myqexternal.myqdevice.com/api/v4/UserDeviceDetails/Get

I note that the site's splash page states the web login will no longer be supported. image

I am still able to log in, and it appears that there's still some API calls being made when I open the web console, but I strongly suspect that the web API may have changed and is no longer reliable.

(e.g. from a quick peek: /GetAllGateways returns a list of node identifiers /GetAllDevices?brandName=Chamberlain returns a list of nodes with setting and state values)

(FWIW, I already have an old remote I wired up to a raspberry pi to control the door, tempted to just get a motion or pressure sensor to see if it's open or not. Might be more reliable in the long run.)

bachya commented 4 years ago

The myq integration does, indeed, use the mobile app’s same API.

Please take a look at the debugging instructions here – do these steps succeed? If a 400 response occurs, where?

jrconlin commented 4 years ago

Interesting. All of those work.

The URLs you have in that comment are also using v5 of the API and for whatever reason, I'm still on v4. (Odd, I'm running 0.100.3)

https://myqexternal.myqdevice.com/api/v4/UserDeviceDetails/Get

I'm going to guess that an update probably didn't happen and will try to figure out what might be going on. (Sorry, haven't had a lot of time to dig into this. I've got a few other projects that are higher priority right now.

bachya commented 4 years ago

Closing as not an issue with the code. We can re-open if otherwise.

JamRWS6 commented 4 years ago

@bachya I feel like we still may have an issue with this. I have been receiving the same error as @jrconlin for about a week or more but haven't had time to troubleshoot until now. I get this error consistently:

There was an error while logging in: 22:00:51.080514 Client Error while requesting data from api/v4/User/Validate: 400, message='Bad Request', url='https://myqexternal.myqdevice.com/api/v4/User/Validate

I have run through the 3 commands from your troubleshooting link and all return successful responses. All of those, however, are referencing v5 of the API which is different than the error received which appears to reference v4. Happy to see what I can do to help. I'm running HA 0.100.2.

JamRWS6 commented 4 years ago

@bachya I feel like we still may have an issue with this. I have been receiving the same error as @jrconlin for about a week or more but haven't had time to troubleshoot until now. I get this error consistently:

There was an error while logging in: 22:00:51.080514 Client Error while requesting data from api/v4/User/Validate: 400, message='Bad Request', url='https://myqexternal.myqdevice.com/api/v4/User/Validate

I have run through the 3 commands from your troubleshooting link and all return successful responses. All of those, however, are referencing v5 of the API which is different than the error received which appears to reference v4. Happy to see what I can do to help. I'm running HA 0.100.2.

additionally in the HA config for MyQ cover I no longer saw "type" as an option and removed it. After restarting HA I get

Invalid config for [cover.myq]: required key not provided @ data['type']. Got None. (See /config/cover.yaml, line 0). Please check the docs at https://home-assistant.io/integrations/cover.myq/

Not sure what this means other than something seems off right now.

bachya commented 4 years ago

@JamRWS6 The integration was broken in 0.100.2 (due to a v4 MyQ API change) and was addressed in 0.100.3. Try upgrading and see if your functionality comes back.

JamRWS6 commented 4 years ago

@JamRWS6 The integration was broken in 0.100.2 (due to a v4 MyQ API change) and was addressed in 0.100.3. Try upgrading and see if your functionality comes back.

@bachya Thanks so much! Integration is working again in 0.100.3. Appreciate you pointing me to this. I had checked issues but didn't see one until this but didn't check if there was a latest release. Thanks again

jrconlin commented 4 years ago

@bachya @JamRWS6 Confirming that updating to 0.100.3+ resolved the issue, although I did manually update my pymyq install as well (probably just a quirk of my install).

pip install --update pymyq

for anyone who might still be experiencing problems.

Thanks!