Fronius Cloud Integrations - SolarNetwork/solarnetwork GitHub Wiki
This page descirbes the Cloud Integrations support for Fronius. See Fronius Solar.web API for information about the Fronius API.
The Fronius integration service identifier is s10k.c2c.i9n.fronius
. The following service
properties are supported:
Property | Description |
---|---|
accessKeyId |
The Fronius access key ID to use. |
accessKeySecret |
The Fronius access key value to use. |
baseUrl |
An optional alternate URL to use to access the cloud service. |
The Fronius integration supports the following Cloud Datum Stream Service implementations:
Service | Identifier | Description |
---|---|---|
Fronius | s10k.c2c.ds.fronius |
Polling datum stream using the Fronius API. |
The Fronius datum stream service identifier is s10k.c2c.ds.fronius
.
The following service properties are supported:
Property | Description |
---|---|
placeholders |
An optional Map of placeholder names with asscoiated values, to make available to Datum Stream Mapping Property value references |
sourceIdMap |
A map or comma-delimited mapping list of component IDs to associated source ID values. See source ID mapping for more information. |
upperCaseSourceId |
When true then force all source ID values to upper case. Defaults to false if not specified. |
multiStreamMaximumLag |
A maximum amount of time to accommodate partially reported data across multiple datum streams before giving up. When resolving multiple datum streams within a request and any stream lags behind other streams, the polling reference time will not advance beyond the lagging stream's latest timestamp for at most this duration. Can be specified as an ISO duration like PT2H for "2 hours" or an integer number of seconds. Defaults to PT3H (3 hours). Configure as PT0S or 0 to disable. |
virtualSourceIds |
A list or comma-delimited list of virtual source IDs. See Virtual datum streams for more information. |
The following placeholders are supported on the placeholders
service property:
Placeholder | Description |
---|---|
systemId |
A single Fronius system ID value to associate with the datum stream |
deviceId |
A single Fronius device ID value to associate with the datum stream |
The following Data Filters are supported:
Filter Key | Description |
---|---|
systemId |
An Fronius system ID value |
deviceId |
An Fronius device ID value |
The Fronius integration uses the following data value cloud-speicifc metadata keys (refer to the Fronius API documentation for more information on possible values):
Key | Description |
---|---|
activationDate |
A device activation date, in ISO 8601 timestamp format |
capacity |
A battery capacity |
channelType |
The device channel type, for example EnergyExported
|
deactivationDate |
A device deactivation date, in ISO 8601 timestamp format |
deviceCategory |
A device categorization, for example Primary Meter
|
deviceLocation |
A device location description, for example Grid
|
deviceType |
The device type; the supported types are: Battery , EVCharger , Inverter , Ohmpilot , Sensor , SmartMeter
|
installationDate |
The device install date, in ISO 8601 timestamp format |
isOnline |
A boolean used in EVCharger devices |
lastImport |
The date a system last received data from one of its devices, in ISO 8601 timestamp format |
maxChargePower |
A battery maximum charge power |
maxDischargePower |
A battery maximum discharge power |
maxSOC |
A batter maximum state of charge |
minSOC |
A battery minimum state of charge |
numberMPPTrackers |
An inverter number of MPTT trackers |
numberPhases |
The number of AC phases supported by the device |
peakPower |
The maximum power output of a system |
The Fronius cloud data value model is represented in 3 levels:
- System
- Device
- Channel (property)
System and Device objects have unique IDs. Channels have names like EnergyExported
or GridPowerA
. Value references are formed as:
/{systemId}/{deviceId}/{channelName}
For example:
/3e210d7d-2b9e-43d6-830a-000000000000/5faf4ac6-e79e-4b42-a644-000000000000/ApparentPower
Using placeholders a value reference could be instead specified like:
/{systemId}/{deviceId}/EnergyExported
By default the Fronius Datum Steam service will generate unique source IDs based on the combination
of the Datum Stream sourceId
value and the pattern /{systemId}/{deviceId}
taken
from the configured data value references in the stream's property mappings.
Assuming your Datum Stream was configured
with a sourceId
of S01
, you could configure mapping properties like this:
Value Reference | SolarNetwork Property | Property Type |
---|---|---|
/3e210d7d/5faf4ac6/VoltageA |
voltage_a |
i |
/3e210d7d/5faf4ac6/EnergyExported |
wh_exp |
i |
/3e210d7d/4b42a644/GridEnergyExported |
wh_exp |
i |
/3e210d7d/4b42a644/GridEnergyImported |
wh_imp |
i |
☝️ Note the reference component IDs shown here have been shortened for brevity.
Then SolarNetwork would generate 2 datum streams:
S01/3e210d7d/5faf4ac6
S01/3e210d7d/4b42a644
You can also define an explicit mapping of components to source IDs with a sourceIdMap
service
property on a Datum Stream. This can be
specified as a map or comma-delimited mapping list of component IDs to associated source ID values.
For example in JSON, the sourceIdMap
service property could be specified as an object like:
{"/3e210d7d/5faf4ac6":"S1/INV", "/3e210d7d/4b42a644":"S1/GEN"}
or a string like:
"/3e210d7d/5faf4ac6=S1/INV, /3e210d7d/4b42a644=S1/GEN"
A complete example of the Datum Stream could look like this:
{
"enabled": true,
"name": "Fronius Test",
"datumStreamMappingId": 1,
"schedule": "3600",
"kind": "n",
"objectId": 123,
"sourceId": "unused",
"serviceIdentifier": "s10k.c2c.ds.fronius",
"serviceProperties": {
"sourceIdMap": {
"/3e210d7d/5faf4ac6": "S1/INV",
"/3e210d7d/4b42a644": "S1/GEN"
}
}
}
Here the generated datum streams would be S1/INV
and S1/GEN
because of the sourceIdMap
setting. The unused
sourceId
setting would not be used, and SolarNetwork would generate 2 datum
streams:
S1/INV
S1/GEN
☝️ When
sourceIdMap
is configured, only the devices explicitly included will be generated into datum streams, and all other devices will be ignored.
When an explicit sourceIdMap
service property is configured, a set of placeholders is automatically
generated from the mapping keys:
{systemId}
{deviceId}
This means you can configure value references that take advantage of those placeholders in the
stream's associated datum property mappings. For example, given the previous sourceIdMap
example:
{
"sourceIdMap": {
"/3e210d7d/5faf4ac6": "S1/INV",
"/3e210d7d/4b42a644": "S1/GEN"
}
}
and a set of property mappings like this:
Value Reference | SolarNetwork Property | Property Type |
---|---|---|
/{systemId}/{deviceId}/VoltageA |
voltage_a |
i |
/{systemId}/{deviceId}/EnergyExported |
wh_exp |
i |
/{systemId}/{deviceId}/GridEnergyExported |
wh_exp |
i |
/{systemId}/{deviceId}/GridEnergyImported |
wh_imp |
i |
Then both the S1/INV
and S1/GEN
datum streams would be resolved. Although all mappings will be
applied to all datum, only inverter devices support VoltageA
and EnergyExported
and only meter
devices support GridEnergyExported
and GridEnergyImported
, so the effective value references
are:
Effective Value Reference | SolarNetwork Property | Property Type |
---|---|---|
/3e210d7d/5faf4ac6/VoltageA |
voltage_a |
i |
/3e210d7d/5faf4ac6/EnergyExported |
wh_exp |
i |
/3e210d7d/4b42a644/GridEnergyExported |
wh_exp |
i |
/3e210d7d/4b42a644/GridEnergyImported |
wh_imp |
i |
Because Fronius does not provide meter-reading style energy data channels typically mapped to an
accumulting wattHours
property, an expression property can be used to derive one. For example,
assuming a wh_exp
property mapped from a EnergyExported
or GridEnergyExported
channel:
has('wh_exp') && hasOffset(1, timestamp) && offset(1, timestamp).props['wattHours'] != null
? offset(1, timestamp).wattHours + wh_exp
: has('wh_exp')
? wh_exp
: 0
Similaryly, a "reverse" style meter-reading style expression could generate a wattHoursReverse
property, assuming a wh_imp
property mapped from a EnergyImported
or GridEnergyImported
channel:
has('wh_imp') && hasOffset(1, timestamp) && offset(1, timestamp).props['wattHoursReverse'] != null
? offset(1, timestamp).wattHoursReverse + wh_imp
: has('wh_imp')
? wh_imp
: 0
Additionally, Fronius may not provide "phase aggregate" data channels. For example a meter might
provide GridPowerA
, GridPowerA
, GridPowerC
channels. Assuming you map each of those channels
to properties named watts_a
, watts_b
, and watts_c
, you could configure an expression to
generate a watts
total power property like this:
has('watts_a') ? sum(group('watts_.*')) : null
Another phase aggregate example is to calculate an average voltage from voltage_a
, voltage_b
,
and voltage_c
properties configured from GridVoltageA
, GridVoltageB
, and GridVoltageC
channels:
has('voltage_a') ? round(avg(group('voltage_.*')), 1) : null
This service supports the Cloud Datum Stream import service.