Github Mirror / telegraf-plugins: 3dbc85dd




Add support for standing charge utilities/telegraf-plugins#14

Add support for standing charge utilities/telegraf-plugins#14

Commit 3dbc85dd.

Authored 2023-07-05T17:30:21.000+01:00 by B Tasker in project Github Mirror / telegraf-plugins

+13 lines -1 lines

Commit Signature

Changes

diff --git a/octopus-tariffs/octopus-tariffs.py b/octopus-tariffs/octopus-tariffs.py
--- a/octopus-tariffs/octopus-tariffs.py
+++ b/octopus-tariffs/octopus-tariffs.py
# @@ -26,11 +26,22 @@ def getPricing(meter, session):
# from_str = yday.strftime("%Y-%m-%d %H:%M:%SZ")
#
# # We can now use this to retrieve pricing
# + #
# + # TODO: we should check if the meter records the tariff type as STANDARD
# + # if not, we should be looking at day-unit/night-unit
# result = session.get(f"https://api.octopus.energy/v1/products/{product_code}/electricity-tariffs/{meter['tariff-code']}/standard-unit-rates?period_from={from_str}")
#
# for pricepoint in result.json()['results']:
# + pricepoint['type'] = "usage-charge"
# meter['pricing'].append(pricepoint)
#
# + # We also need to grab the daily standing charges
# + result = session.get(f"https://api.octopus.energy/v1/products/{product_code}/electricity-tariffs/{meter['tariff-code']}/standing-charges?period_from={from_str}")
# +
# + for pricepoint in result.json()['results']:
# + pricepoint['type'] = "standing-charge"
# + meter['pricing'].append(pricepoint)
# +
# return meter
#
# def generateLP(addresses):
# @@ -68,7 +79,8 @@ def priceToLP(price, tariff_code):
# tags = [
# "octopus_pricing", # the measurement name
# f"payment_method={price['payment_method']}",
# - f"tariff_code={tariff_code}"
# + f"tariff_code={tariff_code}",
# + f"charge_type={price['type']}"
# ]
#
# fields = [
#