मुख्य कंटेंट तक स्किप करें

Scholt 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

This test code does a simple job of continuously sending dummy measurements to an installation, and receiving commands:

Please download the file below in your preferred Python IDE. Fill in your serial number, site filter and MQTT-credentials and execute the script:

Prerequisites

Eniris will supply the MQTT Credentials, as well as the <Controller SN> and <site_filter>, which must be used in the MQTT Topics and Body.

Sending measurements

To send measurements to the SmartgridOne Controller, the following MQTT topic can be used for publishing: standard1/outbound/scholt_meas/<site_filter>/<Controller SN>/

The following fields can be sent per device type:

  • Storage

    • energy_stored_Wh
    • mean_soc_perc
    • active_power_W
    • today_charged_Wh
    • today_discharged_Wh
  • Solar

    • active_power_W
    • today_energy_Wh
  • 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>.
},
},
"response_code": <Response Code>
},
"fields": {},
"requestTime": "<Unix Timestamp>",
"time": "<Unix Timestamp>",
"siteNodeId": "<site_filter"
}

Receiving commands

To receive commands from the SmartgridOne Controller, subscribe to the following MQTT topic: standard1/outbound/scholt_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