Battery Query returning no values
Hi, could anyone please advise why "Values" are empty for battery/real/query?
I want to query battery capacity, remaining kw, current %, is this the right endpoint?

Code: Select all

https://www.foxesscloud.com/op/v0/device/[b]battery/real/query[/b]?sn=xxxx
Please below the response I get!

Code: Select all

{
    "errno": 0,
    "msg": "Operation successful",
    "result": {
        "data": {
            "remainCapacity": {
                "unit": "Ah",
                "value": "--"
            },
            "batteryDesignCapacity": {
                "unit": "Ah",
                "value": "--"
            },
            "batteryDesignEnergy": {
                "unit": "kWh",
                "value": "--"
            },
            "chargeEnergyToTal": {
                "unit": "kWh",
                "value": "1339"
            },
            "dischargeEnergyToTal": {
                "unit": "kWh",
                "value": "1406.6"
            },
            "batteryRemainEnergy": {
                "unit": "kWh",
                "value": "--"
            },
            "acType": "--",
            "batteryType": "--"
        }
    }
}
Attachments:
20260114 172326.png
Re: Battery Query returning no values
This is a new endpoint and, so far as I can see, doesn't return any data apart from the charge and discharge energy.

To get the battery details, you need to use a number of other queries:

Get Device Detail to get a list of the batteries attached to the inverter and their capacity. Sum the battery capacity values to get the total capacity.

Get Device Real-time data with the relevant variables to get the current battery SoC, voltage, current, temperature, throughput etc.

If you use Python, this get_battery() api wrapper does the work for you: https://github.com/TonyM1958/FoxESS-Clo ... nformation
H1-6.0-E hybrid inverter
6 x HV2600 v2 batteries
16 x JA Solar 405w panels
7 x Tigo TS4-A-O optimisers
Re: Battery Query returning no values
Thank you tony.matthews1!

Three more things, if you could help please!
  • The real/query endpoint doesn't seem to return Soc_1 variable when filtered
20260115 103943.png
  • With battery %, the values don't seem to match on API response vs what's shown on the app
20260115 102010.png
  • Few other variables are also not getting filtered!
20260115 105458.png
Re: Battery Query returning no values
Confusingly on a single battery system the variable name is actually 'SoC' not 'SoC_1', whereas on a multi-battery system you don't have a SoC you have SoC_1 & SoC_2 - change the name to SoC and it will return a value.

The temperature you see in the app is the lowest cell temperature, whereas batTemperature is the temperature at the BMS power junction and is usually 6-10C higher than the lowest cell - sadly despite our continued requests Fox have not added the lowest cell temperature to the OpenApi.

Similarly as for SoC the variable names for a single battery system are 'invBatPower', and 'batTemperature'
Post Reply