Compare commits

4 Commits

Author SHA1 Message Date
Ben Roberts
917d038bf9 Drop time-of-day tag which makes data difficult to use with victoria-metrics/promql 2020-08-31 14:01:47 +01:00
Ben Roberts
ca49193748 Cast config settings to floats 2020-08-31 14:01:38 +01:00
Ben Roberts
c6517663bc Update example config file with SMETS2 settings 2020-08-31 13:52:31 +01:00
Ben Roberts
73cf170e18 Handle unit conversion for SMETS2 gas meters
SMETS2 gas meter consumption is measured in m3 rather than kWh, so conversion
from one unit to the other is required.
Algorithm and description of terms is taken from:
https://www.theenergyshop.com/guides/how-to-convert-gas-units-to-kwh

This commit adds additional config file options to the `gas` section:
- `meter_type` (default `1` for backward compatibility)
  Enables unit conversion from m3 to kWh before reporting metrics to influxdb
- `volume_correction_factor` (default `1.02264`)
- `calorific_value` (default `40`)
2020-08-31 12:06:42 +01:00

View File

@@ -102,7 +102,7 @@ def store_series(connection, series, metrics, rate_data):
time = period.datetime().strftime('%H:%M') time = period.datetime().strftime('%H:%M')
return { return {
'active_rate': active_rate_field(measurement), 'active_rate': active_rate_field(measurement),
'time_of_day': time, #'time_of_day': time,
} }
measurements = [ measurements = [