Git Product home page Git Product logo

Comments (2)

mattosaurus avatar mattosaurus commented on September 26, 2024 1

Thanks for the detailed response, I hadn't realised quite how complicated this was!

I'm currently working on a library for accessing a GivEnergy battery as control of that is of more use to me initially than this gateway. Once that's done I'll get back to working on this library and can then share it with you when complete to see if you want to include it or not.

Keep up the good work.

from enphase-api.

Matthew1471 avatar Matthew1471 commented on September 26, 2024

Apologies for the delay in reply, I found a few vulnerabilities in the IQ Gateway that I have been responsibly disclosing to Enphase.

To answer your question, a lot of the information has been found from either looking inside the client side JavaScript (https://envoy.local/backbone/application.js) and running it through a JavaScript prettifier to unminify it.

Some further information was obtained from decompilation of the Android Enphase Installer ToolKit.

The documentation is produced by gateway_generate_docs.py which is undergoing continuous improvements. The program has a metadata file (API_Details.json) where I teach it the URLs / JSON response and it fetches the JSON response and then derives the schema.. I then fill in the blanks from either my own knowledge "v" being "230" in the UK means V = "Voltage" or from the JavaScript/tookit code.

Through my research I've accidentally stumbled across the firmware and also the source code that runs on the IQ Gateway - it's written in lua and Ruby.. but I am unsure of the legality of sharing that and in all honesty most of the API end-point functionality can (and was) mostly be derived from the above - the JSON that comes back from the HTTP GET should be pretty much the same irrespective of what software we're running. Obtaining the public key for the JWT was a nice touch however - haven't seen that information anywhere else! Also a lot of the APIs actually behind the scenes themselves make further HTTP API requests - so I'll definitely include in the documentation where is the best to get which bits of data (briefly, the /stream/meter is just /ivp/meters/reports behind the scenes with some JSON key/value re-mapping and on a timer!).

If you create a C# wrapper and it follows the same lean principles (not too many third party dependencies etc) as the rest of the project I'd love to include it in this project. I put some of the code inside the "Python" folder in the hope that there could later be a "C#" folder etc for clients in other languages.

One thing I hadn't realised when I started this project was just how massive it would be - which is why I invested time in writing a script to automatically produce the documentation and to infer JSON schema etc.. I plan to always be improving the documentation. Some of the "examples" are in-use in my house (gateway_amqp_meters.py, amqp_database_meters.py and amqp_unicorn_hat_hd.py) so while the documentation and the library was the primary focus, the examples actually are written to be production ready.

Hope you enjoy this project as much as I have :). If you have any pull requests I'll happily add stuff in - just might tweak it to be in keeping with the simplicity of the project (no dependency hell).

from enphase-api.

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.