Battery state and operation from API

3 comments started 2024-03-06 last 2024-03-06
APIsHome Automation
W
#1 williamsdb

Hi,

I have been using the api to get the energy flow information successfully. Is it possible to get information about the current state of the battery? I am looking for the percentage charged (although I can work this out given the amount of charge) and the current change state (charging, paused etc).

Secondly, is it possible to operate the battery (pause, charge, discharge etc) from the API?

I couldn't find end points for either of these.

Thanks

D
#2 DD

williamsdb Yes.

https://givenergy.cloud/docs/api/v1#inverter-data-GETinverter--inverter_serial_number--system-data-latest
gives latest state, and power

"battery": {
            "percent": 92,
            "power": -1917,
            "temperature": 27.9
}

(you'd have to infer state from the direction of the power flow, and choose an appropriate small number to designate as idle).

Those battery operations look like the quick settings on the app. You can implement those, but not through direct calls. If you look in the portal's activity log (under the remote control page) after performing those operations, you'll see what settings the app actually uses to implement them. I think pause is done by setting charge and discharge power to 0, for example; charge is done by configuring a timed charge from 0000 to 2359; etc.

W
#3 williamsdb

DD Perfect just what I needed, thanks!