diff --git a/packages/plant_snmp.yaml b/packages/plant_snmp.yaml index 17bc718..4a475e5 100644 --- a/packages/plant_snmp.yaml +++ b/packages/plant_snmp.yaml @@ -271,8 +271,8 @@ sensor: unit_of_measurement: "°F" unique_id: pfv_tsys6_drac_ambient value_template: >- - {% set c = value | regex_findall('ambient_temp (\d+)') | first if value is match('ambient_temp') else none %} - {{ ((c | float * 9 / 5) + 32) | round(1) if c is not none else 'unknown' }} + {% set m = value | regex_findall('ambient_temp (\d+)') %} + {{ ((m[0] | float * 9 / 5) + 32) | round(1) if m | length > 0 }} - platform: snmp name: "PFV tsys7 DRAC inlet" @@ -286,8 +286,8 @@ sensor: unit_of_measurement: "°F" unique_id: pfv_tsys7_drac_inlet value_template: >- - {% set c = value | regex_findall('inlet_temp (\d+)') | first if value is match('inlet_temp') else none %} - {{ ((c | float * 9 / 5) + 32) | round(1) if c is not none else 'unknown' }} + {% set m = value | regex_findall('inlet_temp (\d+)') %} + {{ ((m[0] | float * 9 / 5) + 32) | round(1) if m | length > 0 }} - platform: snmp name: "PFV tsys7 DRAC exhaust" @@ -301,8 +301,8 @@ sensor: unit_of_measurement: "°F" unique_id: pfv_tsys7_drac_exhaust value_template: >- - {% set c = value | regex_findall('exhaust_temp (\d+)') | first if value is match('exhaust_temp') else none %} - {{ ((c | float * 9 / 5) + 32) | round(1) if c is not none else 'unknown' }} + {% set m = value | regex_findall('exhaust_temp (\d+)') %} + {{ ((m[0] | float * 9 / 5) + 32) | round(1) if m | length > 0 }} - platform: snmp name: "PFV tsys7 DRAC CPU1" @@ -317,7 +317,7 @@ sensor: unique_id: pfv_tsys7_drac_cpu1 value_template: >- {% set t = value | regex_findall('(?:^|\n)temp (\d+)') %} - {{ ((t[0] | float * 9 / 5) + 32) | round(1) if t | length > 0 else 'unknown' }} + {{ ((t[0] | float * 9 / 5) + 32) | round(1) if t | length > 0 }} - platform: snmp name: "PFV tsys7 DRAC CPU2" @@ -332,4 +332,4 @@ sensor: unique_id: pfv_tsys7_drac_cpu2 value_template: >- {% set t = value | regex_findall('(?:^|\n)temp (\d+)') %} - {{ ((t[1] | float * 9 / 5) + 32) | round(1) if t | length > 1 else 'unknown' }} + {{ ((t[1] | float * 9 / 5) + 32) | round(1) if t | length > 1 }}