From 7510b66d7d739fd24e9d09b9064835341f7187b8 Mon Sep 17 00:00:00 2001 From: wernerfred <20406381+wernerfred@users.noreply.github.com> Date: Wed, 20 Apr 2022 15:44:22 +0200 Subject: [PATCH] feat: add operating mode --- README.md | 1 + app/cts700_modbus.py | 1 + app/prom_export.py | 3 ++- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 62b34ab..378cc4a 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,7 @@ The following metrics are exposed: | `nilan_cts700_water_temp_top` | `20520` | T11 top temperature in DHW water tank | Celsius | `Gauge` | | `nilan_cts700_water_temp_wanted` | `20460` | Hot water set point | Celsius | `Gauge` | | `nilan_cts700_humidity_average` | `20164` | Average Humidity | Percent | `Gauge` | +| `nilan_cts700_operating_mode` | `20120` | Operating mode | | `Gauge` | ## Installation diff --git a/app/cts700_modbus.py b/app/cts700_modbus.py index f80ed43..ccb7dce 100644 --- a/app/cts700_modbus.py +++ b/app/cts700_modbus.py @@ -15,6 +15,7 @@ "water_temp_top": [20520, 0.11], "water_temp_wanted": [20460, 0.11], "humidity_average": [20164, 1], + "operating_mode": [20120, 1], } client = ModbusTcpClient(host, port=port) diff --git a/app/prom_export.py b/app/prom_export.py index b2960b8..ba4ed95 100644 --- a/app/prom_export.py +++ b/app/prom_export.py @@ -17,7 +17,7 @@ gWaterTempTop = Gauge('nilan_cts700_water_temp_top', 'Water temperature top', ['scale']) gWaterTempWanted = Gauge('nilan_cts700_water_temp_wanted', 'Water temperature wanted', ['scale']) gHumidityAverage = Gauge('nilan_cts700_humidity_average', 'Humidity average') - +gOperatingMode = Gauge('nilan_cts700_system_state', 'System State') gIndoorTemp.labels('°C') gOutdoorTemp.labels('°C') @@ -38,6 +38,7 @@ def setMetrics(): gWaterTempTop.labels('°C').set(values['water_temp_top']) gWaterTempWanted.labels('°C').set(values['water_temp_wanted']) gHumidityAverage.set(values['humidity_average']) + gOperatingMode.set(values['operating_mode']) except: print("Unexpected error") raise