Github Mirror / telegraf-plugins: dbb7403f




Convert site stats to LP

Convert site stats to LP

Commit dbb7403f.

Authored 2023-05-15T08:48:50.000+01:00 by B Tasker in project Github Mirror / telegraf-plugins

+26 lines -1 lines

Commit Signature

Changes

diff --git a/soliscloud/soliscloud.py b/soliscloud/soliscloud.py
--- a/soliscloud/soliscloud.py
+++ b/soliscloud/soliscloud.py
# @@ -370,7 +370,7 @@ class SolisCloud:
# "installer": "ACME",
# "dataTimestamp" : "1683905510946",
# "dayEnergy" : 0,
# - "dayEntergyStr" : "kWh",
# + "dayEnergyStr" : "kWh",
# "dayIncome" : 0,
# "batteryTotalDischargeEnergy" : 0,
# "batteryTotalChargeEnergy" : 0,
# @@ -537,6 +537,31 @@ def extractInverterStats(inverter, config):
# ])
# return lp
#
# +def extractSiteStats(site, config):
# + ''' Receive a dict with a site's details and extract stats
# + '''
# + # TODO: it's not clear whether the API will change units
# + # we should probably normalise our output if it does
# +
# + # tags first
# + tags = {
# + "type" : "site",
# + "device_type" : "none",
# + "station" : site['id'],
# + "userId" : site['userId'],
# + }
# +
# + fields = {
# + "readingAge" : f"{round(time.time() - int(inverter['dataTimestamp']))}i",
# + "capacity" : float(site['capacity']),
# + "capacityStr" : f'"{site["capacityStr"]}"',
# + "dayEnergy" : float(site['dayEnergy']),
# + "dayEnergyStr" : f'"{site["dayEnergyStr"]}"',
# + "dayIncome" : float(site['dayIncome']),
# + }
# +
# +
# +
#
# if __name__ == "__main__":
# # TODO: Take from environment
#