/* Used to create bullet points on CMS lists by adding matching class to each item */

Push API

This page contains instructions for configuring
chargers with Charge HQ
Please refer to our
charger listing for details on supported models and charger specifications.

The Push API allows users to send solar data into Charge HQ. It is intended for users with unsupported solar & battery systems who wish to develop their own data import mechanisms.

The API is provided as-is and with limited support. Please be aware that the API may change in future, requiring updates to your code.

API Endpoint

To push solar / monitoring data into Charge HQ please use the following API endpoint:

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

This endpoint should be called no more frequently than once every 30 seconds, we recommend setting it to 60 seconds.

Your API Key must be included in the JSON payload (see below), to obtain it ensure you have first created a Charge HQ account, then open the webapp (not the mobile app), go to My Equipment -> Solar / Battery Equipment, select Push API. You can then copy your API Key.

NOTE: the use of Site ID is deprecated and will be removed in future. Please update your software to use API Key instead.

JSON Payload

The payload must be JSON and use the following fields. Most fields are optional. Note this is a Typescript schema, you need to send JSON.

export interface SiteMeterPush {
  // obtain your API key from the app: My Equipment -> Solar / Battery Equipment, Push API 
  apiKey: string

  // timestamp of meter data (milliseconds since epoch)
  // if the meter data is delayed and has a reliable timestamp then this field should
  // be provided if, otherwise it should be left unset
  tsms?: number

  // set this field only if there was an error obtaining the meter data
  error?: string

  // provide the meter data, unless there was an error
  siteMeters?: {
    // if solar is present, provide the following field
    production_kw?: number

    // if a consumption meter is present, the following fields should be set
    net_import_kw?: number //grid import, negative means export
    consumption_kw?: number //total site consumption

    // if accumulated import/export energy is available, set the following fields
    imported_kwh?: number
    exported_kwh?: number

    // if a battery is present, provide the following fields
    battery_discharge_kw?: number //negative mean charging
    battery_soc?: number //eg 0.5 = 50%
    battery_energy_kwh?: number //amount of energy in the battery (optional)
  }
}

Example JSON payload:

{
  "apiKey": "abab01010-a6b1-4206-eeff-ba9b94ed5c0d",
  "siteMeters": {
    "consumption_kw":0.415,
    "net_import_kw":0.415,
    "production_kw":0,
    "exported_kwh":16389.472,
    "imported_kwh":17511.878
  }
}

Data Validation

Charge HQ will check that the values supplied make sense from a power flow perspective.

For sites with a consumption meter (and optionally a battery) the values must satisfy this equation:

consumption_kw = production_kw + net_import_kw [ + battery_discharge_kw ]

Any of these values may be negative provided the equation is still satisfied. In particular, consumption will often be negative if there is an unmonitored solar inverter present.

Messages which fail this validation will be accepted however an error will be shown on the Charge HQ home screen and solar tracking will probably not work correctly.

App Configuration

Before using the push API to send data into Charge HQ, in the app you will need to configure it as your solar data source:

  • My Equipment -> Solar / Battery Equipment.
  • Select "Push API".
  • Copy your API Key for use in your software. If the API Key is not shown, ensure you are using the webapp, not the mobile app.
  • Click save.

Troubleshooting

Error: power values are inconsistent

If you see this error, the values being sent to Charge HQ are failing the validation checks - see Data Validation above. Solar tracking will probably not work correctly.

This is usually caused by a misconfiguration or bug in the software being used to send data to Charge HQ, or can be caused by a misconfiguration of the meter device that is monitoring the power flows.

Existing Integrations

Some users have made their scripts publicly available via GitHub, which may be a useful reference in developing your own. We thank these users for making their scripts available.

Charge HQ has not been involved in the development, nor tested the code and this list is not an endorsement of any of the referenced work. You should exercise your own judgement in choosing to adopt or use any part of it.

General connector

Efergy

Enphase

Home Assistant

Huawei

IotaWatt

Redback

Senec

Sonnen

Sunverge

Zeversolar

Related articles

No items found.