arraylabs / pymyq

Python wrapper for MyQ API
MIT License
112 stars 42 forks source link

Update auth headers and payload to get around 401s #188

Open thevickypedia opened 9 months ago

simmonyau commented 9 months ago

This worked for me. Thank you! I was getting these 401 errors previously:

Authentication failed: Error requesting data from https://partner-identity.myq-cloud.com/connect/token: 401 - Unauthorized
There was an error: %s Error requesting data from https://partner-identity.myq-cloud.com/connect/token: 401 - Unauthorized
marcone commented 9 months ago

This also fixed the problem for me.

Tahlor commented 8 months ago

lgtm, to test:

 pip uninstall pymyq
 pip install git+https://github.com/arraylabs/pymyq.git@refs/pull/188/head
jschwalbe commented 8 months ago

If this works, can this be merged?

thevickypedia commented 8 months ago

@jschwalbe unfortunately I don't have write access to merge it @ehendrix23 please review this PR and merge it

Tahlor commented 8 months ago

It worked for a few days, now I'm getting 429 errors (cloudflare related). You still probably want to merge this, but more work is needed.

https://github.com/Python-MyQ/Python-MyQ/issues/24#issuecomment-1774208488

simmonyau commented 8 months ago

It worked for a few days, now I'm getting 429 errors (cloudflare related). You still probably want to merge this, but more work is needed.

Python-MyQ/Python-MyQ#24 (comment)

Same here....I plan to move to ratgdo to not rely on myq cloud infra

thevickypedia commented 8 months ago

I just tested today and I started getting authentication errors More information: https://community.home-assistant.io/t/the-current-state-of-myq-from-the-codeowner/630623

marcone commented 8 months ago

Can someone ELI5 why whatever the official myQ app does to authenticate can't be replicated in pymyq? The Google Play store tells me the Android myQ app hasn't been updated in over a month, so it doesn't seem like Chamberlain were actively changing things on the dates mentioned in the timeline in that forum post.

FlyingDiver commented 8 months ago

The app could have been changed months ago, and only the servers updated recently.

marcone commented 8 months ago

My point was that there were multiple pymyq fixes followed by renewed breakages since the last app update, while the app just kept working. Even in the unlikely case that Chamberlain predicted all of pymyq's attempts at fixes and had new server tweaks ready to block them, the fact is still that the app kept working throughout all this, so whatever is the correct authentication method has been in the app since at least September 22 (I'm using the Android app, which was last updated on 9/22 according to the Play Store).

(I know nothing about authentication protocols, I'm just curious if there's a technical reason why pymyq can't do whatever the app does. Shouldn't it be possible for pymyq to basically pretend to be the app, with Chamberlain's servers none the wiser?)

FlyingDiver commented 8 months ago

That's what the (many) fixes for the 401 errors have been doing. And don't forget - it's certainly possible for the protocols used by the app to be updated from the MyQ servers without an app update through the Play store.

OTOH, none of this will fix the 429 errors.

thevickypedia commented 7 months ago

I think it's time to give up on MyQ integrations https://chamberlaingroup.com/press/a-message-about-our-decision-to-prevent-unauthorized-usage-of-myq

FlyingDiver commented 7 months ago

Old news. Everyone else has already abandoned it. I'm going to be installing a ratgdo this week and integrating it.

thevickypedia commented 7 months ago

I was just catching up, I was naively trying to fix it by sniffing packets using the MyQ mobile app but no luck Even my plan is to install a ratgdo by EOY

simmonyau commented 7 months ago

I back-ordered 3 ratgdo devices on October 25th and still have not received them unfortunately 😔

simmonyau commented 7 months ago

I ended up using ifttt to at least be able to close the garage doors through myq with an ifttt maker webhook until I am able to receive my ratgdo devices.