Closed cdb27 closed 8 months ago
What inverter and batteries do you have - the problem is that the battery residual is returning 0, so the capactiy has been estimated at 0.1kWh. You can add a parameter to over-ride the capacity e.g. capacity=10.24 would set the capacity to 10.24kWh
It's a ECS2900-2. I can see the capacity on the app and will check the API this evening see if it is coming through as well. The capacity is 5.76kWh so I will set it manually for now. Thank you.
On Tue, 12 Mar 2024, 16:29 TonyM1958, @.***> wrote:
What batteries do you have - the problem is that the battery residual is returning 0, so the capactiy has been estimated at 0.1kWh. You can add a parameter to over-ride the capacity e.g. capacity=10.24 would set the capacity to 10.24kWh
— Reply to this email directly, view it on GitHub https://github.com/TonyM1958/FoxESS-Cloud/issues/10#issuecomment-1992074978, or unsubscribe https://github.com/notifications/unsubscribe-auth/APD5K7WFOKA2D7LBC4WOWA3YX4UP7AVCNFSM6AAAAABESPBALCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSOJSGA3TIOJXHA . You are receiving this because you authored the thread.Message ID: @.***>
There may be a problem with Open API with the Residual that is returned. The units that Fox provide in the data are 10Wh and I convert this to kWh by dividing by 100. But I have heard that, for some batteries, the units returned are incorrect. This would throw out the scaling of Residual - which may be why you are seeing a very small residual / capacity rather than 0.
Here's an example of what I expect to see:
Please can you run:
get_history(v='ResidualEnergy')
This is the output.
[{'unit': 'kWh', 'data': [{'time': '2024-03-12 20:06:51 GMT+0000', 'value': 0.0070999999999999995}], 'name': 'Battery Residual Energy', 'variable': 'ResidualEnergy', 'date': '2024-03-12'}]
This is the SoC:
[{'unit': '%', 'data': [{'time': '2024-03-12 20:21:51 GMT+0000', 'value': 14.0}], 'name': 'SoC', 'variable': 'SoC', 'date': '2024-03-12'}]
Hence why I am getting 0.05 as the capacity. I think I need to multiply my residual by 10,000 rather than 100?
Thanks.
Fox do not provide the battery capacity via Open API so I have to estimate it from the SoC and Residual. The result can be a bit erratic when the SoC is <20% or >90%. That is why I built in the over-ride to fix the capacity at a known value.
If your residual is 0.0071 and SoC is 14%, the capacity would be calculated at 0.0507kWh. It does look like the value being returned is 100 x too small.
I've added a check to the code for residual < 0.1kWh, so you will find the latest code throws an error anyway and asks you to set the capacity manually.
BTW - what I think is happening here is that Fox is returning the Residual as 0.71 [kWh] but with a unit of 10Wh instead of kWh so it is being scaled down x 100 by my code. I'll have a look and see if I can put a bit more intelligence into the code to automatically adjust the range.
Sounds good, thanks!
On Tue, 12 Mar 2024, 20:50 TonyM1958, @.***> wrote:
BTW - what I think is happening here is that Fox is returning the Residual as 0.71 [kWh] but with a unit of 10Wh instead of kWh so it is being scaled down x 100 by my code. I'll have a look and see if I can put a bit more intelligence into the code to automatically adjust the range.
— Reply to this email directly, view it on GitHub https://github.com/TonyM1958/FoxESS-Cloud/issues/10#issuecomment-1992551671, or unsubscribe https://github.com/notifications/unsubscribe-auth/APD5K7U35TEBSRTKOYRH6ULYX5S7XAVCNFSM6AAAAABESPBALCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSOJSGU2TCNRXGE . You are receiving this because you authored the thread.Message ID: @.***>
Doesn't look like automatically adjusting the range is possible due to the potential range of residual values over different batteries and SoC - there are too many cases where this could go wrong.
v2.1.5 will have a setting, f.residual_scale that adjusts the scaling for values returned by get_real() and get_history() that are used by charge_needed() and elsewhere. The default setting is 0.01.
You would need to set this to 1 to get the correct range / capacity for your battery by the look of it.
When I run the charge_needed() function with no parameters, I am getting the following result. I was expecting that the "Charging for 11 minutes adds 0.04kWh" to say "Charging for XX minutes adds 3.08kWh". I have set my Solcast API key and FoxESS API key and not changed any other setting and data is being returned correctly. Any ideas why this is?