jesserizzo / envoy_reader

MIT License
37 stars 26 forks source link

Add Battery storage data #74

Closed gtdiehl closed 3 years ago

gtdiehl commented 3 years ago

Adding Battery storage data that is coming from /production.json

"storage": [{"type": "acb","activeCount": 4,"readingTime": 1595203104,"wNow": -178,"whNow": 285,"state": "charging","percentFull": 6}

Battery storage data will only be returned when the battery is installed in the Envoy system. To determine if the battery is installed we check for the presence of the percentFull attribute, as in the above example.

If a battery is not present the /production.json page will return:

"storage":[{"type":"acb","activeCount":0,"readingTime":0,"wNow":0,"whNow":0,"state":"idle"}]}

In which case the API will return a message saying the battery storage is not available.

Pull request recommendations:

Thanks for contributing!