Skip to content
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

ERR_MYQ_INVALID_SERVICE_RESPONSE recently started appearing #46

Open
julianh2o opened this issue Aug 27, 2021 · 12 comments
Open

ERR_MYQ_INVALID_SERVICE_RESPONSE recently started appearing #46

julianh2o opened this issue Aug 27, 2021 · 12 comments
Assignees
Labels

Comments

@julianh2o
Copy link

julianh2o commented Aug 27, 2021

Hey Thomas,

I've been using this library to control my garage door opener for awhile now and it's been working pretty well. However, recently I've started getting the dreaded ERR_MYQ_INVALID_SERVICE_RESPONSE error. Do you have any advice on how to further troubleshoot this? I'm happy to try to contribute a fix if it turns out there's been a small tweak in the API, but some guidance would be much appreciated.

Relevant snippet: (using express)

    const myq = new MyQ();
    try {
        await myq.login(myq_credentials.username,myq_credentials.password);
        const state = await myq.getDoorState(garage_door);
        res.send(state);
    } catch (err) {
        res.send(err);
    }

Error response:

{
  "name": "MyQError",
  "code": "ERR_MYQ_INVALID_SERVICE_RESPONSE",
  "_serviceError": {
    "message": "Request failed with status code 400",
    "name": "Error",
    "stack": "Error: Request failed with status code 400\n    at createError (/home/julian/blinds/node_modules/myq-api/node_modules/axios/lib/core/createError.js:16:15)\n    at settle (/home/julian/blinds/node_modules/myq-api/node_modules/axios/lib/core/settle.js:17:12)\n    at IncomingMessage.handleStreamEnd (/home/julian/blinds/node_modules/myq-api/node_modules/axios/lib/adapters/http.js:260:11)\n    at emitNone (events.js:111:20)\n    at IncomingMessage.emit (events.js:208:7)\n    at endReadableNT (_stream_readable.js:1064:12)\n    at _combinedTickCallback (internal/process/next_tick.js:138:11)\n    at process._tickCallback (internal/process/next_tick.js:180:9)",
    "config": {
      "url": "Login",
      "method": "post",
      "data": "{\"Username\":\"jul***@gmail.com\",\"Password\":\"******\"}",
      "headers": {
        "Accept": "application/json, text/plain, */*",
        "Content-Type": "application/json",
        "MyQApplicationId": "JVM/G9Nwih5BwKgNCjLxiFUQxQijAebyyg8QUHr7JOrP+tuPb8iHfRHKwTmDzHOu",
        "ApiVersion": "5.2",
        "BrandId": "2",
        "Culture": "en",
        "User-Agent": "3d599e2ae7215f47fb49",
        "Content-Length": 56
      },
      "baseURL": "https://api.myqdevice.com/api/v5",
      "transformRequest": [
        null
      ],
      "transformResponse": [
        null
      ],
      "timeout": 0,
      "xsrfCookieName": "XSRF-TOKEN",
      "xsrfHeaderName": "X-XSRF-TOKEN",
      "maxContentLength": -1,
      "maxBodyLength": -1
    }
  }
}
@simmonyau
Copy link

You might want to update your post to remove your username/password. I'm getting the same error as well and I believe others have commented that it's due to a switch from MY Q developers to api v6 which apparently makes use of an oauth token. Not sure if anyone is actively looking at this though.

@julianh2o
Copy link
Author

You might want to update your post to remove your username/password. I'm getting the same error as well and I believe others have commented that it's due to a switch from MY Q developers to api v6 which apparently makes use of an oauth token. Not sure if anyone is actively looking at this though.

Thanks! Oops :)

@brbeaird
Copy link

It appears MyQ has disabled the v5 API, which is unfortunate but was inevitable. There is a v6 available, but moving over to it is not exactly a simple process.

@simmonyau
Copy link

That's exactly why I bought a relay switch to bypass third party APIs. Got to do what I can to increase the stability of my home automation.

@nsnyder
Copy link
Contributor

nsnyder commented Aug 27, 2021

This is a duplicate of #34. I might try to pull together a PR for V6 when I get some free time, but I'm pretty busy right now.

@koush
Copy link

koush commented Aug 28, 2021

You might want to update your post to remove your username/password. I'm getting the same error as well and I believe others have commented that it's due to a switch from MY Q developers to api v6 which apparently makes use of an oauth token. Not sure if anyone is actively looking at this though.

Thanks! Oops :)

Editing does not scrub the history of the comment which is still visible. Change your password.

@julianh2o
Copy link
Author

julianh2o commented Aug 28, 2021

Editing does not scrub the history of the comment which is still visible. Change your password.

Thank you! Already done, the editing was just to bury my careless blunder ;)

@koush
Copy link

koush commented Aug 28, 2021

I stripped down the MyQ API in Homebridge (https://github.com/hjdhjd/homebridge-myq) into a standalone here:

https://github.com/koush/myq

npm install --save @koush/myq

Works well.

@thomasmunduchira
Copy link
Owner

Hey folks, I'm taking a look at this now. It appears that we need to migrate to the v6 API (tracked in #34) in order to mitigate this. I'm not sure how feasible implementing the new authentication flow is, but I'll take a look at the related projects that have already migrated and see if I can pattern match.

See #34 for future updates. Just a heads up that this won't be an overnight fix, and might take week(s) in order to land v6 support. I appreciate your patience regarding this :)

@cjustinhall
Copy link

I stripped down the MyQ API in Homebridge (https://github.com/hjdhjd/homebridge-myq) into a standalone here:

https://github.com/koush/myq

npm install --save @koush/myq

Works well.

Has anybody tried this? Have you found it successful w the v6 api?

@koush
Copy link

koush commented Aug 29, 2021

Yes it works with the v6 API.

@skykep
Copy link

skykep commented Sep 3, 2021

How are you running it as a standalone? I've installed it but missing the point of execution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

8 participants