Neargrid MQTT Driver
The following integration can be used to send site measurements via MQTT, and receive commands for the different device types installed.
Python demo script
Contact a-TroniX to request a demo script.
Prerequisites
Cloud Controller
The sites will be controlled via a Cloud Controller. Please contact a-TroniX to set up a new Cloud Controller
Site Setup
Once a Cloud Controller has been created, it will contain a unique serial number (<Controller SN>).
New sites can be generated on the Cloud Controller using unique site filters <site_filter>
These two variables must be used in the MQTT Topics and Body.
Warning
Using identical site filters will result in errors.
Device Selection
| Device Type | Supported |
|---|---|
| Solar Inverters | ✅ |
| Storage Devices | |
| Heatpumps | |
| Grid & Consumption Meters | |
| EV Chargers | ❌ |
Note
The devices in a site cannot be edited after creation.
MQTT Credentials
a-TroniX will supply MQTT credentials. The MQTT username must be entered when generating a new site.
Note
The credentials must only be supplied once. One set of MQTT credentials can be used to control all sites.
Sending measurements
To send measurements to the a-TroniX Controller, the following MQTT topic can be used for publishing: standard1/outbound/neargrid_meas/<site_filter>/<Controller SN>/
Optional fields are mentioned in italics.
The following fields can be sent per device type:
-
Storage
- mean_soc_perc
- active_power_W
- today_charged_Wh
- today_discharged_Wh
- energy_stored_Wh
-
Solar
- active_power_W
- today_energy_Wh
-
Heat Pumps
- operation_modes
- Possible operation modes are off, on
- active_power_W
- Equals nominal power while heat pump is on
- operation_modes
-
Meters
- active_power_W
- today_imported_energy_Wh
- today_exported_energy_Wh
The message must be structured as follows:
{
"time": "<Unix Timestamp>",
"data": {
"state": {
"grid": {
"active_power_W": <Grid Active Power in Watts>,
"today_imported_energy_Wh": <Grid Imported Energy in Watt-hours>,
"today_exported_energy_Wh": <Grid Exported Energy in Watt-hours>,
},
"meter": {
"active_power_W": <Grid Active Power in Watts>,
"today_imported_energy_Wh": <Grid Imported Energy in Watt-hours>,
"today_exported_energy_Wh": <Grid Exported Energy in Watt-hours>,
},
"storage": {
"energy_stored_Wh": <Energy Stored in Watt-hours>,
"mean_soc_perc": <Mean State of Charge Percentage>,
"active_power_W": <Active Power in Watts>,
"today_charged_Wh": <Energy Charged on the Current Today in Watt-hours>,
"today_discharged_Wh": <Energy Discharged on the Current Today in Watt-hours>,
},
"solar": {
"active_power_W": <Solar Active Power in Watts>,
"today_energy_Wh": <Energy Produced Today in Watt-hours>.
},
"heat_pump": {
"active_power_W": <Heat Pump Active Power in Watts>,
"operation_modes": <Heat Pump Operation Mode>
}
},
"response_code": <Response Code>
},
"fields": {},
"requestTime": "<Unix Timestamp>",
"time": "<Unix Timestamp>",
"siteNodeId": "<site_filter"
}Measurement Acknowledgement
When a measurement has been successfully received, an acknowledgement will be sent on the following topic: standard1/rp_one_s/neargrid_ack/<site_filter>/<Controller SN>
This acknowledgement can be used to:
- Verify that the measurement message was received successfully.
- Verify that the measurement message contained all necessary data.
Receiving commands
To receive commands from the a-TroniX Controller, subscribe to the following MQTT topic: standard1/outbound/neargrid_cmd/<site_filter>/<Controller SN>/
The response is structured as follows:
{
"extraTags": {
"nodeId": "<Controller SN>_site_0"
},
"time": "<Unix Timestamp>",
"fields": {
"solar_policy": "<policy>",
"solar_power_setpoint_w": 5000,
"storage_policy": "<policy>",
"storage_power_setpoint_w": -5000
}
}The list of policies than can be received is found here: List of Potential Policies
