Skip to content

Instantly share code, notes, and snippets.

@farmio
Created January 21, 2021 19:02
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save farmio/618ca3c1b3f335dd966b19a92acef832 to your computer and use it in GitHub Desktop.
Save farmio/618ca3c1b3f335dd966b19a92acef832 to your computer and use it in GitHub Desktop.
Telegraf Input and Processor plugin configuration for Fronius Inverters using SolarAPI
###############################################################################
# PROCESSOR PLUGINS #
###############################################################################
[[processors.strings]]
## Replace all non-overlapping instances of old with new
## Trim the given prefix from the field
[[processors.strings.trim_prefix]]
field_key = "*"
prefix = "Body_Data_Site_"
[[processors.strings.trim_prefix]]
field_key = "*"
prefix = "Body_Data_0_"
###############################################################################
# INPUT PLUGINS #
###############################################################################
# Read formatted metrics from one or more HTTP endpoints
[[inputs.http]]
# measurement name
name_override = "smartmeter"
# override default http query interval
interval = "1m"
## One or more URLs from which to read formatted metrics
urls = [
"http://${FRONIUS_IP}/solar_api/v1/GetMeterRealtimeData.cgi?Scope=System"
]
## Data format to consume.
# json parsing
data_format = "json"
json_time_key = "Body_Data_0_TimeStamp"
json_time_format = "unix"
# data filtering
# EnergyReal_WAC_Plus_Absolute ... Import
# EnergyReal_WAC_Minus_Absolute ... Export
# Power* individual phases; *_Sum only sum of all phases.
fieldpass = [
"Body_Data_0_Energy*",
"Body_Data_0_Current_AC_*",
"Body_Data_0_Power*",
# "Body_Data_0_*_Sum"
]
[[inputs.http]]
# measurement name
name_override = "powerflow"
# override default http query interval
interval = "1m"
## One or more URLs from which to read formatted metrics
urls = [
"http://${FRONIUS_IP}/solar_api/v1/GetPowerFlowRealtimeData.fcgi"
]
## Data format to consume.
# json parsing
data_format = "json"
json_time_key = "Head_Timestamp"
json_time_format = "2006-01-02T15:04:05Z07:00"
# data filtering
fieldpass = [
"Body_Data_Site_P_*",
"Body_Data_Site_rel_*",
"Body_Data_Site_E_Total"
]
@farmio
Copy link
Author

farmio commented Jan 21, 2021

I haven't tested the envirnoment variable unpacking (${FRONIUS_IP}) yet. I've just hardcoded the IP.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment