Git Product home page Git Product logo

Comments (5)

brbeaird avatar brbeaird commented on July 22, 2024 1

Hey @hjdhjd - I wanted to mention that my new version of this integration does use your library. Just wanted to say thanks - it is really awesome and greatly simplified the work I had to do. Cheers.
https://github.com/brbeaird/SmartThings-MyQ-Edge

from smartthings_myq.

brbeaird avatar brbeaird commented on July 22, 2024

If you keep hitting issues with token generation, sit tight. I may have another solution that actually brings the whole thing back into the SmartApp so we can avoid it altogether. Will be another few days probably.

from smartthings_myq.

hjdhjd avatar hjdhjd commented on July 22, 2024

Hi guys…I thought you’d find this helpful….I’m the author and maintainer of the Homebridge myQ plugin. I’ve finally gotten around to breaking out my API implementation as it’s own library @hjdhjd/myq that you can use.

It’s a full implementation of the v6 myQ API, and I’ve had thousands of users on it for almost a year. It’s solid, though welcome any contributions or feedback to further improve it. I thought I’d raise it to your attention…there’s a lot of independent efforts around myQ out there, and thought it might be a good idea to try to get some critical mass around a robust implementation for those of us supporting the various smart home ecosystems to collaborate for the good of all.

It eliminates the need for the token generation process you’ve got here, for what it’s worth. Library’s pretty straightforward to use, and you can look at my own Homebridge plugin to see it in action if you want a live example to work from.

Welcome any thoughts…good luck!

from smartthings_myq.

jschnurr avatar jschnurr commented on July 22, 2024

I was able to use @hjdhjd's library successfully. Here is the code:

import { myQApi } from '@hjdhjd/myq';

const myQ = new myQApi('<email>', '<password>');

await myQ.refreshDevices();
console.log(myQ.refreshToken);

However, I also discovered something else. The MyQ API seems sensitive to which IP address I'm using. While on WiFi at home, the MyQ app fails to login with There was an error connecting to the server. Please check your connection and try again.. That corresponds to the error I get from @hjdhjd/myq:

myQ API: https://partner-identity.myq-cloud.com/connect/authorize?client_id=IOS_CGI_MYQ&code_challenge=<challenge>&code_challenge_method=S256&redirect_uri=com.myqops%3A%2F%2Fios&response_type=code&scope=MyQ_Residential+offline_access 
Error: 400 Bad Request
myQ API: Unable to access the OAuth authorization endpoint.

However, when I switch to the mobile network or VPN, both work successfully.

Unfortunately, I cannot get the @brbeaird SmartApp to work - presumably because my SmartThings controller is sitting on my network, using my IP.

from smartthings_myq.

brbeaird avatar brbeaird commented on July 22, 2024

A couple things here:

  • Thanks, @hjdhjd for dropping by and for that sweet library. I will definitely make use of it in the next generation of this app. Sadly, I cannot make use of it here because the actual logic of this SmartApp runs in the SmartThings cloud on Groovy, so I cannot directly use it as-is. Eventually, these cloud-hosted Groovy apps will be deprecated, and I will probably write some kind of self-hosted javascript equivalent that uses the new SmartThings API and imports the new myQApi npm package.
  • The good news is the token generator is no longer needed with the latest SmartApp version I pushed out. @laalfonso - feel free to give the latest code a try if you want to avoid the need for a manual token. Details on that change are now on the Readme.

from smartthings_myq.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.