From d231615ebb77129ef345d7fc297f62d1a704ec91 Mon Sep 17 00:00:00 2001 From: Viktor Barzin Date: Fri, 24 Apr 2026 11:12:56 +0000 Subject: [PATCH] =?UTF-8?q?[monitoring]=20Fix=20fuse=20voltage=20alerts=20?= =?UTF-8?q?=E2=80=94=20divide=20raw=20deciVolt=20reading=20by=2010?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The tuya-bridge exporter reports `fuse_main_voltage` and `fuse_garage_voltage` as raw uint16 from the Tuya protocol, which encodes voltage in deciVolts (e.g. 2352 = 235.2V). The 200/260V thresholds were comparing against the raw integer, so both FuseMainVoltageAbnormal and FuseGarageVoltageAbnormal fired continuously during normal mains conditions. Dividing in the expression also makes `{{ $value }}V` render the correct human-readable value in the alert summary. Root fix would be in tuya-bridge `_decode_value()` where `name.startswith("voltage")` returns `int.from_bytes(...)` without the /10 scaling that `decode_voltage_threshold` applies. Leaving that alone to avoid breaking the automatic_transfer_switch scrape which uses a different code path (`parse_voltage_string`). --- .../monitoring/modules/monitoring/prometheus_chart_values.tpl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stacks/monitoring/modules/monitoring/prometheus_chart_values.tpl b/stacks/monitoring/modules/monitoring/prometheus_chart_values.tpl index d0bbf25b..0051982e 100755 --- a/stacks/monitoring/modules/monitoring/prometheus_chart_values.tpl +++ b/stacks/monitoring/modules/monitoring/prometheus_chart_values.tpl @@ -979,14 +979,14 @@ serverFiles: annotations: summary: "Garage fuse temperature: {{ $value }}°C (threshold: 70°C)" - alert: FuseMainVoltageAbnormal - expr: fuse_main_voltage < 200 or fuse_main_voltage > 260 + expr: fuse_main_voltage / 10 < 200 or fuse_main_voltage / 10 > 260 for: 5m labels: severity: critical annotations: summary: "Main fuse voltage: {{ $value }}V (expected 200-260V)" - alert: FuseGarageVoltageAbnormal - expr: fuse_garage_voltage < 200 or fuse_garage_voltage > 260 + expr: fuse_garage_voltage / 10 < 200 or fuse_garage_voltage / 10 > 260 for: 5m labels: severity: critical