-
Notifications
You must be signed in to change notification settings - Fork 7
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
X3 Hybrid G4 - swapped data #12
Comments
It looks like this in the app:
With first argument being
Which is why in pseudo-code I wrote this:
Now looking at this I see that the issue is
Not sure how I messed that up. Does it result in correct values with that change? I'll check other places and submit a PR soon, thanks! |
@nazar-pc Oh, I don't think we are talking about the same thing :D from my point of view, the data was just fine. Just the data in the list for positions 86, 87 and 88, 89 (feed-in and consumed respectably) is the data showing total, increasing, aggregate value for these metrics. That's why it would be nice to rename it, adding _Total, Meanwhile, the data that I think is missing in your API docs for X3 Hybrid G4 are positions 90,91 and 92,93 (feed-in and consumed respectably) - this one is actual "daily" usage, reset every day. It might not be present in the app, that would explain why it's not in this API docs ;) (With list positions above - I mean the list of metrics from the local API payload as grabbed off the WiFi dongle.) |
I see. I guess those entries were not used in the app, hence I had no credible information to go off and I was trying to not make things up. I wouldn't mind adding them and renaming the already existing names for clarity, but let's have in-line comment that those are not from the app itself (so we will not have similar information for other inverters). Also I see the latest version is 6.3.0 and I last looked at 0.4.5 in August last year, probably worth extracting the latest version and see what they have in there now. |
6.3.0 doesn't minify the source code anymore, which makes reading A LOT easier. They still don't mention the other FeedInEnergy variant though. |
Uuuh, now you've got my attention! :D Do you think we (well, you, It's way above my head) might find some new metrics in the newer app? I wonder if we might get the metrics for the actual Phase 1/2/3 power pulled from the grid - as said here those called Grid 1/2/3 are actually not what inverter pulls from the grid. The best thing is - the inverter 'know' how much it pulls from the current clamp meter, and it shows it on the LCD display. It might be that the API just not expose that... (EDIT - the above was response to your previous message, you're just too fast!) I guess App does not use daily data for feed-in and consumed - tbh, it's not necessary, you could just subtract yesterday's total from current. |
As we're looking at the metrics from two different points of view, just wanted to show you what I get off local API:
This represents: Feed In Total 1.6kWh |
For #11 I'm wondering if latest PR fixes the measurements you see, I'm going through latest app version now and will update the docs if there is anything to update |
Found issue with power for X3 Hybrid G3 as well |
I wonder if value calculation part is right in squishykid/solax library - used in Home Assistant Solax integration |
Some of it was right, some of it was wrong (two issues were fixed in the today's release for my X1 Hybrid Gen 4). They (Solax engineers) have a very confusing way to represent data structures and mobile app is VERY badly designed IMHO. They don't reuse constants or anything, you literally see indices of random data structures all over the place and there is absolutely no indication of what is what. They don't make life easy for themselves. I corrected and extended Data1 and Data2 locally, now need to finally decipher how they distinguish between the two because there were reports in the past that inverters were not correctly identified according to current instructions I deciphered. I wish Solax Power open sourced the app and documentation properly, it is a big benefit to have Home Assistant integration IMHO. |
So I looked around and... something is clearly missing. The app doesn't know the description of the data fields of my X1 Hybrid Gen4 and when I loaded Android app's UI on my desktop (with a proxy and some slight code changes) it indeed wasn't able to load the data, yet the Android app somehow works 🤯 It is as if there is some kind of translation/conversion in the native code that I can't find despite all attempts. It shouldn't work, yet it does. There are many inverters missing in the latest version and I don't understand how it can possibly support them all. Also all the EV charger support seems to be gone too 🤔 Pinged Solax again, but don't have high hopes about it. Since the app was compiled as release version I can't do live debugging of it either. |
It wouldn't hurt either if in the local API responses they would send a dict with proper key names instead of a hundred or so numebrs... Well, it is what it is :) Are you getting any replies from solax, is there any dialogue? I've been wondering myself about getting in touch with them. |
It is an embedded system, it is probably easier for them to dump it like that.
They do respond, though they don't like Open Source as much as I do and don't seem to get the value of their inverters being one of the very few supported out of the box in offline setting by Home Assistant. |
Just wanted to tag you @nazar-pc to let you know that it seem in here we have two fields a bit wrong for X3 Hybrid G4.
I worked today on squishykid/solax#178 in the solax library, you can see there in detail what I changed to sort it out. I think it's still worth it to investigate and correct here in api docs if applicable (unless like with that other issue of mine it would make updating this a chore).
The problem in API docs seem to be lines 252-253 here:
Data[86], Data[87]
seem to be a total increasing value for FeedInEnergy, same applies toData[88], Data[89]
for ConsumeEnergy.Also we seem to be missing the following:
Data[90], Data[91]
as FeedInEnergy_TodayData[92], Data[93]
as ConsumedEnergy_TodayIn general it would boil down to the below:
I can work on fixing this, will open PR once done if you don't mind - let me know if I got something wrong!
The text was updated successfully, but these errors were encountered: