diff --git a/Home_Assistant/blueprints/hasp_Display_Temperature_with_Icon_and_Colors.yaml b/Home_Assistant/blueprints/hasp_Display_Temperature_with_Icon_and_Colors.yaml index 296a018..04bc0ac 100644 --- a/Home_Assistant/blueprints/hasp_Display_Temperature_with_Icon_and_Colors.yaml +++ b/Home_Assistant/blueprints/hasp_Display_Temperature_with_Icon_and_Colors.yaml @@ -190,6 +190,12 @@ blueprint: default: false selector: boolean: + roundtemp: + name: "Round sensor values to nearest integer" + description: "Enable this if you don't want decimal places involved" + default: true + selector: + boolean: mode: parallel max_exceeded: silent @@ -225,11 +231,12 @@ variables: thermometer_full_threshold: !input thermometer_full_threshold thermometer_full_color: !input thermometer_full_color colortemp: !input colortemp + roundtemp: !input roundtemp haspobject: '{{ "p[" ~ hasppage ~ "].b[" ~ haspbutton ~ "]" }}' commandtopic: '{{ "hasp/" ~ haspname ~ "/command/" ~ haspobject }}' jsoncommandtopic: '{{ "hasp/" ~ haspname ~ "/command/json" }}' jsontopic: '{{ "hasp/" ~ haspname ~ "/state/json" }}' - temperature: >- + temperature_value: >- {%- if temperature_sensor|lower == "none" -%} {{- state_attr(weather_provider, "temperature") -}} {%- elif temperature_attribute|lower == "state" -%} @@ -237,6 +244,12 @@ variables: {%- else -%} {{- state_attr(temperature_sensor, temperature_attribute) -}} {%- endif -%} + temperature: >- + {%- if roundtemp == true -%} + {{- temperature_value | round -}} + {%- else -%} + {{- temperature_value -}} + {%- endif -%} icon: >- {%- set temp = temperature|int -%} {%- if temp <= thermometer_quarter_threshold|int -%}