From 5880ce2100cb254541e2d0a24d4d809b639e194f Mon Sep 17 00:00:00 2001 From: reachableceo Date: Wed, 2 Sep 2026 19:08:32 -0500 Subject: [PATCH] test(plant): default_value+none-render on 3 down-host snmp sensors [#344] --- packages/plant_snmp.yaml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/packages/plant_snmp.yaml b/packages/plant_snmp.yaml index 1250ceb..520038d 100644 --- a/packages/plant_snmp.yaml +++ b/packages/plant_snmp.yaml @@ -12,13 +12,14 @@ sensor: community: kn3lmgmt baseoid: .1.3.6.1.4.1.8072.1.3.2.3.1.2.9.108.109.115.101.110.115.111.114.115 accept_errors: true + default_value: "-999" unit_of_measurement: "°F" unique_id: pfv_artroom_temperature value_template: >- {% set ext = value | regex_findall('External:\s*\+?(-?\d+\.?\d*)') %} {% set int = value | regex_findall('Internal:\s*\+?(-?\d+\.?\d*)') %} {% set c = (ext | first) if ext else ((int | first) if int else none) %} - {{ ((c | float * 9 / 5) + 32) | round(1) if c is not none }} + {{ ((c | float * 9 / 5) + 32) | round(1) if c is not none else none }} - platform: snmp name: "PFV garage temperature" @@ -27,13 +28,14 @@ sensor: community: kn3lmgmt baseoid: .1.3.6.1.4.1.8072.1.3.2.3.1.2.9.108.109.115.101.110.115.111.114.115 accept_errors: true + default_value: "-999" unit_of_measurement: "°F" unique_id: pfv_garage_temperature value_template: >- {% set ext = value | regex_findall('External:\s*\+?(-?\d+\.?\d*)') %} {% set int = value | regex_findall('Internal:\s*\+?(-?\d+\.?\d*)') %} {% set c = (ext | first) if ext else ((int | first) if int else none) %} - {{ ((c | float * 9 / 5) + 32) | round(1) if c is not none }} + {{ ((c | float * 9 / 5) + 32) | round(1) if c is not none else none }} - platform: snmp name: "PFV tsys1 rack temperature" @@ -48,7 +50,7 @@ sensor: {% set ext = value | regex_findall('External:\s*\+?(-?\d+\.?\d*)') %} {% set int = value | regex_findall('Internal:\s*\+?(-?\d+\.?\d*)') %} {% set c = (ext | first) if ext else ((int | first) if int else none) %} - {{ ((c | float * 9 / 5) + 32) | round(1) if c is not none }} + {{ ((c | float * 9 / 5) + 32) | round(1) if c is not none else none }} # --- Native lm-sensors hosts (label picked per host ground truth 2026-08-27) --- # tsys3 Precision 7510: CPU package @@ -197,11 +199,12 @@ sensor: community: kn3lmgmt baseoid: .1.3.6.1.4.1.8072.1.3.2.3.1.2.9.108.109.115.101.110.115.111.114.115 accept_errors: true + default_value: "-999" unit_of_measurement: "°F" unique_id: pfv_subopi3_temperature value_template: >- {% set m = value | regex_findall('temp1:\s*\+?(-?\d+\.?\d*)') %} - {{ ((m | first | float * 9 / 5) + 32) | round(1) if m }} + {{ ((m | first | float * 9 / 5) + 32) | round(1) if m else none }} - platform: snmp name: "PFV subopi-dev-3 temperature"