Skip to content

Commit

Permalink
feat: add operating mode
Browse files Browse the repository at this point in the history
  • Loading branch information
wernerfred committed Apr 20, 2022
1 parent ed7c21b commit 7510b66
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions app/cts700_modbus.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 2 additions & 1 deletion app/prom_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand All @@ -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
Expand Down

0 comments on commit 7510b66

Please sign in to comment.