Comments (6)
I might be able to help with this. I know both languages with some fluency (Python more than Go). I'll see if I can get some time to poke through this
from home_assistant_custom_envoy.
This seems like a fun weekend project. Might be able to steal a few hours. I just started using this integration and would love to completely bypass the online requirement portion. Sadly I bought Enphase after talking to them specifically about the local API access.
I have a vested interest in seeing if we can get close to a total off-line state.
from home_assistant_custom_envoy.
Thanks for the code! I don't know go at all, so it will take me quite a while to port this. I don't have a ton of time to work on this but I can make an attempt at some point.
from home_assistant_custom_envoy.
To be honest this Go code is pretty self explanatory, I am happy to write it up as pseudo code. It's essentially:
- POST the enlighten email & password to the login endpoint of the page with the log form. Hold on to the cookies
- With the cookies in hand, GET https://enlighten.enphaseenergy.com/entrez-auth-token?serial_num=ENVOYSERIAL" - which returns a JSON document. The Token property of the JSON is a JWT token that will last 6 months (you'd renew it by going through the process again)
- With the JWT token, you'll POST it to the endpoint of a form which is https://entrez.enphaseenergy.com/entrez_tokens
- You grab those cookies and equipped with that, you can hit your local envoy endpoints
from home_assistant_custom_envoy.
When looking at @briancmpbll code, isn't he already getting the 6month jwt?
This seems pretty close to my own quick hack:
>>> import requests
>>> payload = { "user[email]":"[email protected]","user[password]":"Taco-Playlist"}
>>> with requests.Session() as s:
... p = s.post('https://enlighten.enphaseenergy.com//login/login', data=payload)
... r = s.get('https://enlighten.enphaseenergy.com/entrez-auth-token?serial_num=SOMESERIAL')
>>> r.text
'{"generation_time":1656279809,"token":"REDACTED","expires_at":1671831809}'
Which translates to an expiry Dec 23, 2022.
I haven't stepped through the original code, but presumably if its using the same url, it should also be a 6 month expiry should it not?
from home_assistant_custom_envoy.
Closing this as stale. If you want to open a PR for this change please create another issue with the PR.
from home_assistant_custom_envoy.
Related Issues (20)
- Feature request: Show Battery Temperature HOT 6
- Probleme intégration des valeurs dans Energy HOT 7
- Integration simply stopped working. Reloading times out. HOT 4
- No values when charging and discharging the batteries. HOT 1
- Current and Today's Energy Production with strange values/behaviour HOT 9
- Questions on migrating to new HA Core version HOT 8
- Missing all "net" entities and consumption amps entities, but CTs are installed and enabled HOT 7
- Question: Which Sensor shows the power consumption of the house HOT 2
- Filtrage des valeurs incohérentes HOT 5
- Current measurement does not look ok HOT 4
- disable power production by negative energy prices HOT 4
- All connection attempts failed HOT 16
- HA - Invalid authentication
- Entities have no value anymore after update envoy (automatically by enphase) on 01-04-2024 HOT 10
- Binary Sensor Grid Status no longer available HOT 3
- error communicating with API HOT 5
- support for enlighten v4 API HOT 3
- Question: Which Sensor shows the energy send to the grid? HOT 28
- "Production Current" is non-zero amps at night...huh? HOT 1
- Connectivity issues since a few days HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from home_assistant_custom_envoy.