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
70.62k stars 29.51k forks source link

MyQ fails to setup with 401 or 429 error #101763

Closed atruest closed 10 months ago

atruest commented 10 months ago

The problem

HA 2023.10.1 worked ok for a few days but now similar failure when trying a reload. See error log below

What version of Home Assistant Core has the issue?

2023.10.1

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

MyQ

Link to integration documentation on our website

No response

Diagnostics information

Logger: homeassistant.components.myq Source: helpers/update_coordinator.py:322 Integration: MyQ (documentation, issues) First occurred: 10:19:24 AM (1 occurrences) Last logged: 10:19:24 AM

Error fetching myq devices data: Error trying to re-authenticate to myQ service: Error requesting data from https://partner-identity.myq-cloud.com/connect/token: 401 - Unauthorized

Example YAML snippet

No response

Anything in the logs that might be useful for us?

Same issue as before but now with 401 instead of 403

Additional information

No response

justinlindh commented 10 months ago

Sorry for the crappy details in comment above. The working fix is posted here: https://github.com/Python-MyQ/Python-MyQ/pull/22

I'm unsure whether the Android specific changes are needed. I'm going to evaluate that now, before asking for merge.

MVerBerkmoes commented 10 months ago

Nob here .. where do I find this api.py we speak about?

mojomojoman commented 10 months ago

You'd want to add the params (data updates) here and replace the url line here

edit: Use @justinlindh 's PR below, apparently that's a more up to date repo than pymyq.

I checked his PR and your link and yours has me replacing the "Accept:" (line 411 in current prod api.py) with "Cookie": resp.cookies.output(attrs=[]), but i dont see that in his PR. So you think i should do that bit with the cookie or not? or make both sets of changes?

edit: ok. now there's two commits from @dailow. i think i need more caffeine to keep up with you guys.

dailow commented 10 months ago

You'd want to add the params (data updates) here and replace the url line here edit: Use @justinlindh 's PR below, apparently that's a more up to date repo than pymyq.

I checked his PR and your link and yours has me replacing the "Accept:" (line 411 in current prod api.py) with "Cookie": resp.cookies.output(attrs=[]), but i dont see that in his PR. So you think i should do that bit with the cookie or not? or make both sets of changes?

edit: ok. now there's two commits from @dailow. i think i need more caffeine to keep up with you guys.

Oops you can ignore mine, I had just put this issue in the commit name and forgot it would automatically link it.

mojomojoman commented 10 months ago

well... is yours the sum of all the changes from prod? cause i'm late to this party.

dailow commented 10 months ago

Here are some steps that worked for me on HA 2023.10.1 for those of you who are impatient like me. If anything below doesn't make sense, I would not recommend trying it and just wait for proper patch :)

Copy the patch below to /config folder your HA install. Run this command from the HA instance to patch the files

docker exec -it homeassistant /bin/bash -c "cd /usr/local/lib/python3.11/site-packages && git apply /config/myq.patch"

myq.patch

justinlindh commented 10 months ago

Oops you can ignore mine, I had just put this issue in the commit name and forgot it would automatically link it.

Actually, yours is cleaner. I moved some values into constants and added another commit :)

dailow commented 10 months ago

Sorry for the crappy details in comment above. The working fix is posted here: Python-MyQ/Python-MyQ#22

I'm unsure whether the Android specific changes are needed. I'm going to evaluate that now, before asking for merge.

They must have changed the IOS parameters as it did not work for me when using the old values, had to switch to the Android one. They must have introduced all these changes into the apps a while ago and now just enabling it on the server side.

neydah700 commented 10 months ago

Back up and working for me with @dailow's https://github.com/dailow/Python-MyQ/tree/login-fix branch

Thanks a ton!

hawkseye76 commented 10 months ago

Here are some steps that worked for me on HA 2023.10.1 for those of you who are impatient like me. If anything below doesn't make sense, I would not recommend trying it and just wait for proper patch :)

Copy the patch below to /config folder your HA install. Run this command from the HA instance to patch the files

docker exec -it homeassistant /bin/bash -c "cd /usr/local/lib/python3.11/site-packages && git apply /config/myq.patch"

myq.patch

getting this error:

/config/myq.patch:29: trailing whitespace.

error: patch failed: pymyq/api.py:23 error: pymyq/api.py: patch does not apply

justinlindh commented 10 months ago

Sorry for the crappy details in comment above. The working fix is posted here: Python-MyQ/Python-MyQ#22 I'm unsure whether the Android specific changes are needed. I'm going to evaluate that now, before asking for merge.

They must have changed the IOS parameters as it did not work for me when using the old values, had to switch to the Android one. They must have introduced all these changes into the apps a while ago and now just enabling it on the server side.

This tracks. I also tried going back to the IOS values in constants and was immediately rate limited out. Probably worth leaving them in for now, then.

A proper, non-rushed fix would be to carefully ensure we're closely mirroring all of the headers/params with the Android app data that you dumped. I have no doubts that Chamberlain will continue to make changes which inevitably break this again, and maybe that would help a bit.

But for a quick fix/workaround to get my HA happy again, this will suffice.

mojomojoman commented 10 months ago

Here are some steps that worked for me on HA 2023.10.1 for those of you who are impatient like me. If anything below doesn't make sense, I would not recommend trying it and just wait for proper patch :)

Copy the patch below to /config folder your HA install. Run this command from the HA instance to patch the files

docker exec -it homeassistant /bin/bash -c "cd /usr/local/lib/python3.11/site-packages && git apply /config/myq.patch"

myq.patch

oh i like easy and fast. but alas:

/config/myq.patch:29: trailing whitespace.

error: patch failed: pymyq/api.py:23 error: pymyq/api.py: patch does not apply error: patch failed: pymyq/const.py:1 error: pymyq/const.py: patch does not apply

I had modified const.py but not api.py. hmph. so much for the easy button. i'll go pick through your PR and line by line it.

drysart commented 10 months ago

A proper, non-rushed fix would be to carefully ensure we're closely mirroring all of the headers/params with the Android app data that you dumped. I have no doubts that Chamberlain will continue to make changes which inevitably break this again, and maybe that would help a bit.

I did see some stuff in the app's decompilation when I was digging through it that looked like functionality for them to forcibly deprecate old versions of the app, which makes me fearful they're going to pursue a policy of aggressively requiring app updates that include protocol changes. Time will tell if and how often they're going to fire that gun.

dailow commented 10 months ago

Sorry for the crappy details in comment above. The working fix is posted here: Python-MyQ/Python-MyQ#22 I'm unsure whether the Android specific changes are needed. I'm going to evaluate that now, before asking for merge.

They must have changed the IOS parameters as it did not work for me when using the old values, had to switch to the Android one. They must have introduced all these changes into the apps a while ago and now just enabling it on the server side.

This tracks. I also tried going back to the IOS values in constants and was immediately rate limited out. Probably worth leaving them in for now, then.

A proper, non-rushed fix would be to carefully ensure we're closely mirroring all of the headers/params with the Android app data that you dumped. I have no doubts that Chamberlain will continue to make changes which inevitably break this again, and maybe that would help a bit.

But for a quick fix/workaround to get my HA happy again, this will suffice.

Yup. I should really stop relying on this, but my garage openers have it built-in and right now this cat and mouse is cheaper/easier than me installing a ratgdo on my openers.

dailow commented 10 months ago

getting this when i

Here are some steps that worked for me on HA 2023.10.1 for those of you who are impatient like me. If anything below doesn't make sense, I would not recommend trying it and just wait for proper patch :) Copy the patch below to /config folder your HA install. Run this command from the HA instance to patch the files

docker exec -it homeassistant /bin/bash -c "cd /usr/local/lib/python3.11/site-packages && git apply /config/myq.patch"

myq.patch

getting this error:

/config/myq.patch:29: trailing whitespace.

error: patch failed: pymyq/api.py:23 error: pymyq/api.py: patch does not apply

Your files must be different then what is shopping with latest HA version or maybe you made some modifications already? You can also look at the PR and just replace the entire contents of the files below.

Enter container: docker exec -it homeassistant /bin/bash cd /usr/local/lib/python3.11/site-packages/pymyq rm const.api api.py vi const.api/api.py and replace with contents from PR

sanctas commented 10 months ago

Here are the steps I used to successfully sign in and use my garage door in the MyQ integration. Someone will probably make an easier guide with better commands but I'm not super well-verse with the CLI. I tried to make this as literal and noob-friendly as possible since I know there's a lot of normies reading this thread wanting help.

Update: Simpler Method

  1. Install the Advanced SSH & Web Terminal Add-On in the Official Add-On Store
  2. On the Info Page of the Advanced SSH & Web Terminal, switch the "Protection Mode" switch to the OFF position. (You can turn this back on when you're done.)
  3. Start the add-on and click Open Web UI (it may take a moment for the UI to actually load)
  4. Once the terminal appears type the following commands:
    • docker exec -it homeassistant /bin/bash
    • pip install https://github.com/Python-MyQ/Python-MyQ/releases/download/v3.1.13/python_myq-3.1.13-py3-none-any.whl
  5. Restart home assistant.

My original comment

  1. Install the Advanced SSH & Web Terminal Add-On in the Official Add-On Store.
  2. On the Info Page of the Advanced SSH & Web Terminal, switch the "Protection Mode" switch to the OFF position. (You can turn this back on when you're done)
  3. Start the add-on and click Open Web UI (it may take a moment for the UI to actually load)
  4. Once the terminal appears type the following commands:
    • docker exec -it homeassistant bash
    • cd /usr/local/lib/python3.11/site-packages/pymyq/
    • vi api.py
  5. Press i on your keyboard to enter "insert mode".
  6. Using arrow keys, scroll down to line 401. (it should be blank) (this will take awhile to scroll that far down)
  7. Add the following two lines of code on lines 401 and 402 respectively:
    • 401: data.update({"brand": "myq"})
    • 402: data.update({"UnifiedFlowRequested": "True"})
  8. Press the Esc key on your keyboard.
  9. Type :w (literally hit shift + colon and then hit w) and then press Enter on your keyboard. This will write the changes you made to storage.
  10. Type :x and then press Enter on your keyboard to exit the VI editor.
  11. Back in the command line, type vi const.py.
  12. Press i on your keyboard to enter "insert mode".
  13. Using arrow keys, scroll down to line 3.
  14. Edit line 3 from OAUTH_CLIENT_ID = "IOS_CGI_MYQ" to OAUTH_CLIENT_ID = "ANDROID_CGI_MYQ"
  15. Using arrow keys, scroll down to line 7.
  16. Edit line 7 from OAUTH_REDIRECT_URI = "com.myqops://ios" to OAUTH_REDIRECT_URI = "com.myqops://android"
  17. Press the Esc key on your keyboard.
  18. Type :w and then press Enter on your keyboard.
  19. Type :x and then press Enter on your keyboard to exit the VI editor.
  20. Restart home assistant.

You will now be able to sign into MyQ using the MyQ integration.

Long Live 3rd Party Integrations

neydah700 commented 10 months ago

Here are the steps I used to successfully sign in and use my garage door in the MyQ integration. Someone will probably make an easier guide with better commands but I'm not super well-verse with the CLI. I tried to make this as literal and noob-friendly as possible since I know there's a lot of normies reading this thread wanting help.

  1. Install the Advanced SSH & Web Terminal Add-On in the Official Add-On Store.
  2. On the Info Page of the Advanced SSH & Web Terminal, switch the "Protection Mode" switch to the OFF position. (You can turn this back on when you're done)
  3. Start the add-on and click Open Web UI (it may take a moment for the UI to actually load)
  4. Once the terminal appears type the following commands:

    • docker exec -it homeassistant bash
    • d /usr/local/lib/python3.11/site-packages/pymyq/
    • vi api.py
  5. Press i on your keyboard to enter "insert mode".
  6. Using arrow keys, scroll down to line 401. (it should be blank) (this will take awhile to scroll that far down)
  7. Add the following two lines of code on lines 401 and 402 respectively:

    • 401: data.update({"brand": "myq"})
    • 402: data.update({"UnifiedFlowRequested": "True"})
  8. Press the Esc key on your keyboard.
  9. Type :w (literally hit shift + colon and then hit w) and then press Enter on your keyboard. This will write the changes you made to storage.
  10. Type :x and then press Enter on your keyboard to exit the VI editor.
  11. Back in the command line, type vi const.py.
  12. Press i on your keyboard to enter "insert mode".
  13. Using arrow keys, scroll down to line 3.
  14. Edit line 3 from OAUTH_CLIENT_ID = "IOS_CGI_MYQ" to OAUTH_CLIENT_ID = "ANDROID_CGI_MYQ"
  15. Using arrow keys, scroll down to line 7.
  16. Edit line 7 from OAUTH_REDIRECT_URI = "com.myqops://ios" to OAUTH_REDIRECT_URI = "com.myqops://android"
  17. Press the Esc key on your keyboard.
  18. Type :w and then press Enter on your keyboard.
  19. Type :x and then press Enter on your keyboard to exit the VI editor.
  20. Restart home assistant.

You will now be able to sign into MyQ using the MyQ integration.

Long Live 3rd Party Integrations

Can't you just clone the pymyq folder from https://github.com/dailow/Python-MyQ/tree/login-fix to the /config folder in HA?

sanctas commented 10 months ago

Can't you just clone the pymyq folder from https://github.com/dailow/Python-MyQ/tree/login-fix to the /config folder in HA?

If I knew how to do that, I would have certainly included that in the guide.

dailow commented 10 months ago

This might be a little easier.

docker exec -it homeassistant /bin/bash
pip install https://github.com/Python-MyQ/Python-MyQ/releases/download/v3.1.13/python_myq-3.1.13-py3-none-any.whl

Restart HA

mojomojoman commented 10 months ago

getting this when i

Here are some steps that worked for me on HA 2023.10.1 for those of you who are impatient like me. If anything below doesn't make sense, I would not recommend trying it and just wait for proper patch :) Copy the patch below to /config folder your HA install. Run this command from the HA instance to patch the files

docker exec -it homeassistant /bin/bash -c "cd /usr/local/lib/python3.11/site-packages && git apply /config/myq.patch"

myq.patch

getting this error: /config/myq.patch:29: trailing whitespace. error: patch failed: pymyq/api.py:23 error: pymyq/api.py: patch does not apply

Your files must be different then what is shopping with latest HA version or maybe you made some modifications already? You can also look at the PR and just replace the entire contents of the files below.

Enter container: docker exec -it homeassistant /bin/bash cd /usr/local/lib/python3.11/site-packages/pymyq rm const.api api.py vi const.api/api.py and replace with contents from PR

Yeah I dont think so. I updated to hass the other day with the new release. my unmodified api.py was dated Oct 6 the same as all the other files but no biggie. I went through the changes line by line and BAM. We're back in business Mortimer!! 🤣

image

Thanks all you guys for banging away at this all day so that my lazy ass could come in at just the right time at the end of the night to find the fix. Literally the time it took me to read through all the comments plus like 1 min later when when the final fix was posted. That was some sweet timing.

hawkseye76 commented 10 months ago

Indeed, Thank You to all who hacked away on this all day!! Much Appreciated!!

mojomojoman commented 10 months ago

This might be a little easier.

docker exec -it homeassistant /bin/bash
cd /config
wget https://github.com/justinlindh/Python-MyQ/archive/refs/heads/fix-403-forbidden.zip
unzip -o -j fix-403-forbidden.zip -d /usr/local/lib/python3.11/site-packages/pymyq

Restart HA

@sanctas Edit your orig post (very nice instructions by the way) but replace step 4 with these commands. followed by exit and docker restart homeassistant and that should be less steps and less room for error. Vim can give people fits who aren't used to it.

BeerDiet commented 10 months ago

Thank you all! Hopefully this is it for MyQ for a while. It's so weird too, when you think about this. I mean we all bought garage door openers, we all created a MyQ account, we all have the app, and apparently some have paid for a subscription (I don't recall doing this, but I would have), etc. It's not like they are losing money by allowing us to access a service, and they are really trying like hell to block it. Maybe it's just some upstart senior dev at a new job trying to impress.

MikeMcGlinch commented 10 months ago

This might be a little easier.

docker exec -it homeassistant /bin/bash
cd /config
wget https://github.com/justinlindh/Python-MyQ/archive/refs/heads/fix-403-forbidden.zip
unzip -o -j fix-403-forbidden.zip -d /usr/local/lib/python3.11/site-packages/pymyq

Restart HA

@sanctas Edit your orig post (very nice instructions by the way) but replace step 4 with these commands. followed by exit and docker restart homeassistant and that should be less steps and less room for error. Vim can give people fits who aren't used to it.

What about those of us not running HA in Docker?

drysart commented 10 months ago

What about those of us not running HA in Docker?

Find wherever your pymyq package is installed in whatever your setup is, then you should be able to make the same updates to relevant files there; and restart HA after updating the files.

dcipher69 commented 10 months ago

This might be a little easier.

docker exec -it homeassistant /bin/bash
cd /config
wget https://github.com/justinlindh/Python-MyQ/archive/refs/heads/fix-403-forbidden.zip
unzip -o -j fix-403-forbidden.zip -d /usr/local/lib/python3.11/site-packages/pymyq

Restart HA

@sanctas Edit your orig post (very nice instructions by the way) but replace step 4 with these commands. followed by exit and docker restart homeassistant and that should be less steps and less room for error. Vim can give people fits who aren't used to it.

What about those of us not running HA in Docker?

I'm running HA OS, not the docker. Follow instructions above to install Terminal.

  1. cd /root/config
  2. wget https://github.com/justinlindh/Python-MyQ/archive/refs/heads/fix-403-forbidden.zip
  3. unzip -o -j fix-403-forbidden.zip -d pymyq
  4. Restart HA

I just did the above and I'm back online with MyQ as before.

justinlindh commented 10 months ago

Thank you all! Hopefully this is it for MyQ for a while. It's so weird too, when you think about this. I mean we all bought garage door openers, we all created a MyQ account, we all have the app, and apparently some have paid for a subscription (I don't recall doing this, but I would have), etc. It's not like they are losing money by allowing us to access a service, and they are really trying like hell to block it. Maybe it's just some upstart senior dev at a new job trying to impress.

The app has advertisements for more MyQ products, and they want control within their walled garden so they can work towards pushing subscriptions more. They're already dipping their toes in the subscription route with the Tesla integration, and I won't be surprised if they push it further. Companies love themselves some recurring revenue streams.

I'm going to continue to enjoy this integration, but will personally be installing a ratgdo once backorders clear on it and I receive it.

VinnyD12 commented 10 months ago

This might be a little easier.

docker exec -it homeassistant /bin/bash
cd /config
wget https://github.com/justinlindh/Python-MyQ/archive/refs/heads/fix-403-forbidden.zip
unzip -o -j fix-403-forbidden.zip -d /usr/local/lib/python3.11/site-packages/pymyq

Restart HA

@sanctas Edit your orig post (very nice instructions by the way) but replace step 4 with these commands. followed by exit and docker restart homeassistant and that should be less steps and less room for error. Vim can give people fits who aren't used to it.

What about those of us not running HA in Docker?

I'm running HA OS, not the docker. Follow instructions above to install Terminal.

  1. cd /root/config
  2. wget https://github.com/justinlindh/Python-MyQ/archive/refs/heads/fix-403-forbidden.zip
  3. unzip -o -j fix-403-forbidden.zip -d pymyq
  4. Restart HA

I just did the above and I'm back online with MyQ as before.

I tried this as I'm running HA OS but it did not work for me. This is driving me nuts as i use home assistant in our building and all of our employees use the companion app for control of our warehouse garage door, time clock, alarm etc...

BeerDiet commented 10 months ago

Thank you all! Hopefully this is it for MyQ for a while. It's so weird too, when you think about this. I mean we all bought garage door openers, we all created a MyQ account, we all have the app, and apparently some have paid for a subscription (I don't recall doing this, but I would have), etc. It's not like they are losing money by allowing us to access a service, and they are really trying like hell to block it. Maybe it's just some upstart senior dev at a new job trying to impress.

The app has advertisements for more MyQ products, and they want control within their walled garden so they can work towards pushing subscriptions more. They're already dipping their toes in the subscription route with the Tesla integration, and I won't be surprised if they push it further. Companies love themselves some recurring revenue streams.

I'm going to continue to enjoy this integration, but will personally be installing a ratgdo once backorders clear on it and I receive it.

I hear you. I have a pair of these that got put away with new garage doors/openers. https://www.amazon.com/gp/product/B00M75TEIU/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&psc=1

Going to dust them off and re-install them.

eyeseesharp commented 10 months ago

running HA on VENV and zip file worked for me, i manually replaced the folder (backed up old pymyq in case) and replaced with new- restarted home assistant and reset myq integration and now I'm back in business.

anyone know now how to get this applied to fix with homebridge?

MikeMcGlinch commented 10 months ago

is there any way to use MQTT to get around all this, and localize control?

MikeMcGlinch commented 10 months ago

is there any way to use MQTT to get around all this, and localize control?

BTW - total Noob here.

sanctas commented 10 months ago

is there any way to use MQTT to get around all this, and localize control?

BTW - total Noob here.

Yes, but you need to get a WiFi relay like a Shelly or any number of other options available. There's some discussion about options in the beginning of this thread. OpenGarage.io has options too.

mojomojoman commented 10 months ago

This might be a little easier.

docker exec -it homeassistant /bin/bash
cd /config
wget https://github.com/justinlindh/Python-MyQ/archive/refs/heads/fix-403-forbidden.zip
unzip -o -j fix-403-forbidden.zip -d /usr/local/lib/python3.11/site-packages/pymyq

Restart HA

@sanctas Edit your orig post (very nice instructions by the way) but replace step 4 with these commands. followed by exit and docker restart homeassistant and that should be less steps and less room for error. Vim can give people fits who aren't used to it.

What about those of us not running HA in Docker?

I'm running HA OS, not the docker. Follow instructions above to install Terminal.

  1. cd /root/config
  2. wget https://github.com/justinlindh/Python-MyQ/archive/refs/heads/fix-403-forbidden.zip
  3. unzip -o -j fix-403-forbidden.zip -d pymyq
  4. Restart HA

I just did the above and I'm back online with MyQ as before.

I tried this as I'm running HA OS but it did not work for me. This is driving me nuts as i use home assistant in our building and all of our employees use the companion app for control of our warehouse garage door, time clock, alarm etc...

"it did not work for me" is probably not going to get you much of a response. maybe throw in the error message or more details or a screenshot even?

raton56 commented 10 months ago

This might be a little easier.

docker exec -it homeassistant /bin/bash
cd /config
wget https://github.com/justinlindh/Python-MyQ/archive/refs/heads/fix-403-forbidden.zip
unzip -o -j fix-403-forbidden.zip -d /usr/local/lib/python3.11/site-packages/pymyq

Restart HA

Thank you guys for all your hard work!!! You really make this a great community to be a part of.

mojomojoman commented 10 months ago

running HA on VENV and zip file worked for me, i manually replaced the folder (backed up old pymyq in case) and replaced with new- restarted home assistant and reset myq integration and now I'm back in business.

anyone know now how to get this applied to fix with homebridge?

no i dont use homebridge but you should be able to make the same changes in that project. if you can find the corresponding sections in the homebridge code then this is what you need to change: https://github.com/Python-MyQ/Python-MyQ/pull/22/commits/80aca17aaaa869b2ed69e13a334c1c2690d6cac8

ur7x commented 10 months ago

I'm running HA OS, not the docker. Follow instructions above to install Terminal.

1. cd /root/config

2. wget https://github.com/justinlindh/Python-MyQ/archive/refs/heads/fix-403-forbidden.zip

3. unzip -o -j fix-403-forbidden.zip -d pymyq

4. Restart HA

I just did the above and I'm back online with MyQ as before.

That worked great on my HASS IO system Thanks!

Will this be patched into a future HA update? Will this impact a future HA update?

sanctas commented 10 months ago

This might be a little easier.


docker exec -it homeassistant /bin/bash

cd /config

wget https://github.com/justinlindh/Python-MyQ/archive/refs/heads/fix-403-forbidden.zip

unzip -o -j fix-403-forbidden.zip -d /usr/local/lib/python3.11/site-packages/pymyq

Restart HA

@sanctas Edit your orig post (very nice instructions by the way) but replace step 4 with these commands. followed by exit and docker restart homeassistant and that should be less steps and less room for error. Vim can give people fits who aren't used to it.

What about those of us not running HA in Docker?

I'm running HA OS, not the docker. Follow instructions above to install Terminal.

1. cd /root/config

2. wget https://github.com/justinlindh/Python-MyQ/archive/refs/heads/fix-403-forbidden.zip

3. unzip -o -j fix-403-forbidden.zip -d pymyq

4. Restart HA

I just did the above and I'm back online with MyQ as before.

That worked great on my HASS IO system Thanks!

Will this be patched into a future HA update? Will this impact a future HA update?

This patch is for the MyQ Python library, so if it is merged (likely soon), the next HA update will include the update since they add all the non-breaking package updates.

VinnyD12 commented 10 months ago

This might be a little easier.

docker exec -it homeassistant /bin/bash
cd /config
wget https://github.com/justinlindh/Python-MyQ/archive/refs/heads/fix-403-forbidden.zip
unzip -o -j fix-403-forbidden.zip -d /usr/local/lib/python3.11/site-packages/pymyq

Restart HA

@sanctas Edit your orig post (very nice instructions by the way) but replace step 4 with these commands. followed by exit and docker restart homeassistant and that should be less steps and less room for error. Vim can give people fits who aren't used to it.

What about those of us not running HA in Docker?

I'm running HA OS, not the docker. Follow instructions above to install Terminal.

  1. cd /root/config
  2. wget https://github.com/justinlindh/Python-MyQ/archive/refs/heads/fix-403-forbidden.zip
  3. unzip -o -j fix-403-forbidden.zip -d pymyq
  4. Restart HA

I just did the above and I'm back online with MyQ as before.

I tried this as I'm running HA OS but it did not work for me. This is driving me nuts as i use home assistant in our building and all of our employees use the companion app for control of our warehouse garage door, time clock, alarm etc...

"it did not work for me" is probably not going to get you much of a response. maybe throw in the error message or more details or a screenshot even?

Where could i find the error log that you mention? I still get a 429 error that I've been getting.

drothenberger commented 10 months ago

I still get a 429 error that I've been getting.

You may just need to wait for the cooldown period to expire. The 429 error should tell you how long you have to wait. It may start working after that.

BeerDiet commented 10 months ago

This might be a little easier.

docker exec -it homeassistant /bin/bash
cd /config
wget https://github.com/justinlindh/Python-MyQ/archive/refs/heads/fix-403-forbidden.zip
unzip -o -j fix-403-forbidden.zip -d /usr/local/lib/python3.11/site-packages/pymyq

Restart HA

@sanctas Edit your orig post (very nice instructions by the way) but replace step 4 with these commands. followed by exit and docker restart homeassistant and that should be less steps and less room for error. Vim can give people fits who aren't used to it.

What about those of us not running HA in Docker?

I'm running HA OS, not the docker. Follow instructions above to install Terminal.

  1. cd /root/config
  2. wget https://github.com/justinlindh/Python-MyQ/archive/refs/heads/fix-403-forbidden.zip
  3. unzip -o -j fix-403-forbidden.zip -d pymyq
  4. Restart HA

I just did the above and I'm back online with MyQ as before.

I tried this as I'm running HA OS but it did not work for me. This is driving me nuts as i use home assistant in our building and all of our employees use the companion app for control of our warehouse garage door, time clock, alarm etc...

"it did not work for me" is probably not going to get you much of a response. maybe throw in the error message or more details or a screenshot even?

Where could i find the error log that you mention? I still get a 429 error that I've been getting.

429 means "Too many requests" and it looks like they implement a 15-minute cooldown period. So try in 15.

smgraver1 commented 10 months ago

Where do you see the error messages saying 429 or 409?

dailow commented 10 months ago

Now that the patch has been merged, you should be able to just run this command from your HA install/container.


pip install Python-MyQ==v3.1.13
MikeMcGlinch commented 10 months ago

Now that the patch has been merged, you should be able to just run this command from your HA install/container.

pip install https://github.com/Python-MyQ/Python-MyQ/releases/download/v3.1.13/python_myq-3.1.13-py3-none-any.whl

In the Terminal. correct?

VinnyD12 commented 10 months ago

Where do you see the error messages saying 429 or 409?

I see this in my Home Assistant Core Logs.

Config entry 'myemail' for myq integration not ready yet: Got 429 error - stopping request until 2023-10-12 01:16:25.820074. there were 1 request; Retrying in background

BeerDiet commented 10 months ago

Where do you see the error messages saying 429 or 409?

Run cat /config/home-assistant.log | grep myq

You should see something in your logs like:

2023-10-11 20:22:14.992 WARNING (MainThread) [homeassistant.config_entries] Config entry 'me@gmail.com' for myq integration not ready yet: Got 429 error - stopping request until 2023-10-12 00:39:21.991930. there were 1 request; Retrying in background

VinnyD12 commented 10 months ago

Where do you see the error messages saying 429 or 409?

Run cat /config/home-assistant.log | grep myq

You should see something in your logs like:

2023-10-11 20:22:14.992 WARNING (MainThread) [homeassistant.config_entries] Config entry 'me@gmail.com' for myq integration not ready yet: Got 429 error - stopping request until 2023-10-12 00:39:21.991930. there were 1 request; Retrying in background

Yes i see that in my HA Core logs

smgraver1 commented 10 months ago

so 429 means just wait for cooldown?

drothenberger commented 10 months ago

so 429 means just wait for cooldown?

Yes. https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429

sanctas commented 10 months ago

so 429 means just wait for cooldown?

Yes. You can google error codes btw, that's why they are assigned a specific code. ;)