Swagger UIswagger

sonnenBatterie API
 1.0.0 

[ Base URL: = ip of the system ]

The sonnenBatterie API allows to remote control a sonnenBatterie. Most API endpoints require an authentication token. This token is available in the sonnenBatterie Dashboard (‘Software-Integration’).
Unproteced endpoints are marked below.

Example request:

curl --header ‘Auth-Token: TOKEN’ http://SYSTEM-IP/api/v2/latestdata

api

POST/api/v2/setpoint/discharge/{watt}
Sends a discharge command to the battery (Write API)
GET/api/v2/status
Gets status data for this sonnenBatterie

Gets status data for this sonnenBatterie. This endpoint does not require an authentication token.

Variable Example Value Unit Description Data type
Apparent_output 226 VA, volt-ampere All AC output of apparent power in VA Integer
BackupBuffer 0 %, percentage Backup-buffer in percentage that is set on the system. Integer
BatteryCharging false - Boolean that indicates the charge status. True if charging Boolean
BatteryDischarging false - Boolean that indicates the discharge status. True if discharging Boolean
Consumption_Avg 223 W, watt House consumption in watts, average over the last 60s Integer
Consumption_W 232 W, watt House consumption in watts, direct measurement Integer
Fac 49.999000549316400 Hz, hertz AC frequency in hertz Float
FlowConsumptionBattery false - Boolean that indicates the energy flow at the installation site. True if battery feeds the consumption Boolean
FlowConsumptionGrid true - Boolean that indicates the energy flow at the installation site. True if grid feeds the consumption Boolean
FlowConsumptionProduction true - Boolean that indicates the energy flow at the installation site. True if production feeds the consumption Boolean
FlowGridBattery false - Boolean that indicates the energy flow at the installation site. True if battery is charging from grid Boolean
FlowProductionBattery false - Boolean that indicates the energy flow at the installation site. True if production is charging the battery Boolean
FlowProductionGrid false - Boolean that indicates the energy flow at the installation site. True if production feeds into the grid Boolean
GridFeedIn_W -208 W, watt Grid Feed in negative is consumption and positive is feed in Integer
IsSystemInstalled 1 - System is installed or not Integer
OperatingMode 2 - Operating mode that is set on the system:
  • 1: Manual charging or discharging via API
  • 2: Automatic Self Consumption. Default
Integer
Pac_total_W -5 W, watt AC Power greater than ZERO is discharging Inverter AC Power less than ZERO is charging Signed Integer
Production_W 28 W, watt PV production in watts Integer
RSOC 4 %, percentage Relative state of charge Integer
RemainingCapacity_W 674 Wh Remaining capacity based on RSOC Integer
Sac1 75 VA, volt-ampere Output of apparent power in VA on Phase 1 Integer
Sac2 75 VA, volt-ampere Output of apparent power in VA on Phase 2 Integer
Sac3 76 VA, volt-ampere Output of apparent power in VA on Phase 3 Integer
SystemStatus OnGrid - String that indicates if the system is connected to the grid (“OnGrid”) or disconnected (“OffGrid”) String
Timestamp 2020-12-10 11:26:01 - Local system time String
USOC 0 %, percentage User state of charge Integer
Uac 230 V, volt AC voltage in volts Integer
Ubat 50 V, volt Battery voltage in volts Integer
dischargeNotAllowed false - Boolean that indicates the discharge status. True if no discharge allowed, based on battery maintenance Boolean
generator_autostart false - Boolean that indicates the autostart setting of the generator. Boolean

Parameters

No parameters

Responses

CodeDescription
200
{
  "Apparent_output": 96,
  "BackupBuffer": "0",
  "BatteryCharging": false,
  "BatteryDischarging": false,
  "Consumption_W": 0,
  "Fac": 50.0239143371582,
  "FlowConsumptionBattery": false,
  "FlowConsumptionGrid": false,
  "FlowConsumptionProduction": false,
  "FlowGridBattery": false,
  "FlowProductionBattery": false,
  "FlowProductionGrid": false,
  "GridFeedIn_W": -3,
  "IsSystemInstalled": 1,
  "OperatingMode": "2",
  "Pac_total_W": 7,
  "Production_W": 0,
  "RSOC": 21,
  "Sac1": 96,
  "Sac2": null,
  "Sac3": null,
  "SystemStatus": "OnGrid",
  "Timestamp": "2020-03-26 17:10:06",
  "USOC": 12,
  "Uac": 238,
  "Ubat": 209,
  "dischargeNotAllowed": false,
  "generator_autostart": false
}
PUT/api/v2/configurations
Sets the value of configurations (Write API)
GET/api/v2/latestdata
Gets latest data for this sonnenBatterie (Read API)
POST/api/v2/setpoint/charge/{watt}
Sends a charge command to the battery (Write API)
GET/api/v2/configurations/{name}
Gets the value of a given configuration (Read API)
GET/api/v2/powermeter
Gets the latest power-meter measurements (Read API)

Gets the latest power-meter measurements.

Parameters

No parameters

Responses

CodeDescription
200
[
  {
    "a_l1": 0,
    "a_l2": 0,
    "a_l3": 0,
    "channel": 1,
    "deviceid": 4,
    "direction": "production",
    "error": -1,
    "kwh_exported": 0,
    "kwh_imported": 0,
    "v_l1_l2": 0,
    "v_l1_n": 0,
    "v_l2_l3": 0,
    "v_l2_n": 0,
    "v_l3_l1": 0,
    "v_l3_n": 0,
    "va_total": 0,
    "var_total": 0,
    "w_l1": 0,
    "w_l2": 0,
    "w_l3": 0,
    "w_total": 0
  },
  {
    "a_l1": 0,
    "a_l2": 0,
    "a_l3": 0,
    "channel": 2,
    "deviceid": 4,
    "direction": "consumption",
    "error": -1,
    "kwh_exported": 0,
    "kwh_imported": 0,
    "v_l1_l2": 0,
    "v_l1_n": 0,
    "v_l2_l3": 0,
    "v_l2_n": 0,
    "v_l3_l1": 0,
    "v_l3_n": 0,
    "va_total": 0,
    "var_total": 0,
    "w_l1": 0,
    "w_l2": 0,
    "w_l3": 0,
    "w_total": 0
  }
]
401

401 Unauthorized