Read data from BYD energy storage using Python and TCP

Robert Diers
1 min readAug 7, 2022


Here’s a piece of code to read the actual data from BYD battery using the TCP socket:

You just need to know the IP and port (typically 8080) of your BYD battery:, 8080)

The following fields will be available:

"soc": state of charge (%)
"maxvolt": max cell voltage (V)
"minvolt": min cell voltage (V)
"soh": state of health (%)
"ampere": actual ampere (A)
"battvolt": actual battery voltage (V)
"maxtemp": max cell temperature
"mintemp": min cell temperature
"battemp": actual battery temperature
"error": will switch from 0 to 1 if an error occurs
"outvolt": actual output voltage (V)
"power": actual power (W)
"diffvolt": difference max and min cell voltage (V)

Thanks for this great project I could use as template ;-)