Closed mtziortzis closed 3 months ago
any ideas @jgriss ? :)
Edit: I think i figured it out. It seems the plant_id being returned is not the one i use. After some debugging from their API i found another plant id and when i use that I get the exact same data back.
Edit2: Nevermind. That data just happen to match the ones i was expecting. It is not the right ones i was looking for. However after digging more around I found that the data i am looking for are coming from
uni003eu5.fusionsolar.huawei.com/rest/pvms/web/station/v1/overview/station-real-kpi
Can you please add this functionality there ?
Hi @remedix
First of all thank you for reporting this issue! Unfortunately, my time to work on the package is very limited at the moment.
Since moving to the new API, I am also experiencing a lot of missing values in the plant_data structure. Yet, all the values that are returned are correct in my case. I just compared totalBuyPower
, totalUsePower
and totalOnGridPower
etc.
Could you let me know, which values exactly you are looking for?
Hi @jgriss Thank you for taking some time to look into this.
I think it comes down to state results. Let me explain.
In the current dashboard of fusionsolar there are two sets of data. The Plant KPIs (which seems to be off (delayed?) as shown here:
And the almost realtime data shown here:
The method fsclient.get_power_status()
gets the first data (Plant KPIs) - the 'stale' ones
However the API endpoint uni003eu5.fusionsolar.huawei.com/rest/pvms/web/station/v1/overview/station-real-kpi
seems to have the latest (real time) ones.
I tried the following from the browser
Nothing seems to be changing the stale data so they must be coming from the server.
I think fsclient.get_power_status()
should get the data from the endpoint as explained above - this will ensure the latest data. I hope this steers you to the right direction.
Hi @mtziortzis ,
Sorry, time available for the project is a bit irregular...
Your observation is correct, the numbers shown in the overview seem to be stale.
Yet, you can already get the up-to-date data shown in the table using the get_plant_stats
function combined with get_last_plant_data
.
There, the productPower
slot corresponds to the current production value.
Sorry, just read the first part of your message. In my tests, the values shown in the table and the ones in get_last_plant data match. I'll check how I can support the new endpoint though
Hi,
A second update: The more up-to-date data is also available in the station list which you can retrieve using get_station_list
@mtziortzis I've added a new function get_current_plant_data
in version 0.0.24 that uses the new endpoint.
First off, thanks for this great library. I was using this just fine until i got migrated to the new subdomain. The data i receive now are a bit off. I verified:
Here is the response i am getting from the
fsclient.get_last_plant_data(plant)
{'onGridPowerRatio': None, 'selfUsePower': {'time': '2024-02-11 13:03', 'value': None}, 'selfUsePowerRatioByUse': None, 'existInverter': True, 'totalBuyPower': None, 'existEnergyStore': False, 'totalProductPower': 25.67, 'existIrradiation': False, 'dischargePower': {'time': '2024-02-11 13:03', 'value': None}, 'radiationDosePower': {'time': '2024-02-11 13:03', 'value': None}, 'mainsUsePower': {'time': '2024-02-11 13:03', 'value': None}, 'buyPowerRatio': None, 'selfUsePowerRatioByProduct': None, 'totalSelfUsePower': None, 'chargePower': {'time': '2024-02-11 13:03', 'value': None}, 'existCharge': False, 'existMeter': False, 'onGridPower': {'time': '2024-02-11 13:03', 'value': None}, 'dieselProductPower': {'time': '2024-02-11 13:03', 'value': None}, 'disGridPower': {'time': '2024-02-11 13:03', 'value': None}, 'selfProvide': None, 'productPower': {'time': '2024-02-11 13:03', 'value': None}, 'usePower': {'time': '2024-02-11 13:03', 'value': None}, 'meterActivePower': {'time': '2024-02-11 13:03', 'value': None}, 'totalUsePower': 25.67, 'chargeAndDisChargePower': {'time': '2024-02-11 13:03', 'value': None}, 'existUsePower': False, 'totalOnGridPower': None}
The actual values of totalProductPower and also the value of
stats.current_power_kw
are way off.Is there anything else i should try ? Notice all the 'None' values - i assume that is not right