Setup guides → Push API

Push API

No adapter for your inverter? Send the readings yourself from a shell script, a Node-RED flow or a cron job.

How oftenEvery 30 seconds — no faster
Works withAnything that can make an HTTP request

The endpoint

POST https://api.sunplug.app/ingest/site
Authorization: Bearer <your API key>
Content-Type: application/json

{
  "tsms": 1785759034000,
  "production_kw": 4.2,
  "net_import_kw": -3.1,
  "consumption_kw": 1.1,
  "battery_discharge_kw": 0.0,
  "battery_soc": 0.62
}

Your key is in the app under Settings → Equipment → Send us your own readings.

The fields

tsmsWhen the reading was taken, milliseconds since 1970
production_kwSolar generation. Always positive
net_import_kwGrid. Positive importing, negative exporting
consumption_kwWhole house, including car charging
battery_discharge_kwPositive discharging, negative charging. Optional
battery_socA fraction — 0.62 for 62%. Optional

The one thing to get right

Export must be negative. Everything balances: consumption = production + net_import + battery_discharge. With the grid sign backwards, Sunplug sees a 3 kW import on a sunny afternoon and will not charge, with no error.

If you measure two of the three, leave the third out; it will be derived. A wrong third value is worse than none. Production alone is refused.

An example

curl -sS -X POST https://api.sunplug.app/ingest/site \
  -H "Authorization: Bearer $SUNPLUG_API_KEY" \
  -H "Content-Type: application/json" \
  -d "{\"tsms\": $(($(date +%s) * 1000)),
       \"production_kw\": 4.2,
       \"net_import_kw\": -3.1,
       \"consumption_kw\": 1.1}"

How often

Every thirty seconds; faster buys nothing. Slower is accepted and shown as less fresh. Duplicates and slightly out-of-order readings are fine.

The data age beside the dashboard's live figures should settle at your sending interval. If it climbs, your posts are failing: the response body names the rejected field.

Coming from ChargeHQ

Field names, units and sign conventions match ChargeHQ. Three things change:

What you send ChargeHQ:

POST https://api.chargehq.net/api/public/push-solar-data

{
  "apiKey": "YOUR-KEY",
  "siteMeters": {
    "production_kw": 4.2,
    "net_import_kw": -3.1,
    "consumption_kw": 1.1
  }
}

The same reading, sent here:

POST https://api.sunplug.app/ingest/site
Authorization: Bearer YOUR-KEY

{
  "production_kw": 4.2,
  "net_import_kw": -3.1,
  "consumption_kw": 1.1
}

No endpoint accepts ChargeHQ's format unchanged.

Stuck, or would rather have an adapter? Email me.