Push API

Push API

The Push API allows users to send solar data into Charge HQ. It is intended for users with unsupported solar data sources 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/site-meters

This endpoint should be called no more frequently than once every 30 seconds.

Your SiteId must be included in the JSON payload, to obtain it ensure you have first created a Charge HQ account, then request it via email. Please ensure you include the same email address that was used to create your Charge HQ account in your request.

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 {
  siteId: 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:

{
  "siteId": "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
  }
}

App Configuration

To make use of the data being pushed into Charge HQ, in the app you will need to set it as a solar data source:

  • Settings -> My Hardware -> Solar Data Source
  • Select "Push API".

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.

Efergy

Enphase