Open philwareublox opened 1 year ago
At the risk of sounding patronising - do you have a "mix" style of system?
;) I have one inverter and all I want is the day timestamped data throughout the day. What API call do I need to do?
I have a non-mix converter and it wasn't too hard to reverse-engineer the API by using a web browser on the Shine server site, and watching network calls. Here's a bit for setting AC charging added to the end of __init__.py
. I haven't put it into this repo until I give it a few more days on my system.
You need to send a full set of parameters to the API, even if they do nothing.
Many thanks grunkyb. Looks a little more effort than I was hoping, but your extra help with the set overnight charging was very helpful.
Hi @grunkyb.
Using the web browser network debug tool I can see the calls to the server.growatt.com server for the getTLXEnergyDayChart calls etc, but I don't understand how I can relate that to the url's I see you use and what this library uses, with the ".do" at the end of the URLs, like 'tcpSet.do'
How do I get to see the correct url for these operations?
Another example: https://server.growatt.com/panel/tlx/getTLXTotalData?plantId=1481705
thanks, Phil.
I'm not sure how @grunkyb is doing his stuff, however this library has been made by looking at the castle made by the Android app (ShinePhone) not the web page. We use the app "NetCapture" running in the background to capture the calls that are made and then get the URLs from there. That's how I recommend testing and making any PRs to this library.
@muppet3000 - AH! That's what I'm missing... Thanks for the tip.
On my side, here's what I'm doing to make the changes.
growattYYYYMMDD
password, select the settings you want to change. Here's I'm setting up my battery for overnight charging. POST
command and the structure of the request. For @philwareublox's request, this is what I send:
and what the structure of the response is:
I can add that in after I've cleaned up my PR with doing the settings on an AC-coupled inverter.
@philwareublox I realise I didn’t address the URL question. Will return to that this evening.
I withdraw my suggestion that I could get the .do
script for the chart data. ☹
The only thing to be aware of is that I don't believe all the URLs are the same between the mobile app and the web page. It would be worth repeating these tests/checks using the method both Indy & I have used to produce the rest of the API.
Fair enough about that. I'm on a "if it works"... There seems to be a lot of redundancy/redirects built into what's happening on the server side.
I'll see what shows up on a packet inspector on the iOS/MacOS side. I expect it'll be similar to Android, but it's worth checking for subtle differences.
@philwareublox Could you try out the get_ac_production_consumption
function and SPA_chart_plot.py
example I've set up in a branch in my fork? Neither the example nor the function are sufficiently generic yet, but I'm curious how it works on others' systems. Setting discovery was done using the Android packet capture method.
When performing a simple request like this:
I get back None for the mix info and other mix data. What could be going wrong?