Hi
I used this code:
- name: "96H warm actuele temperatuur is hoger dan maximum"
icon: mdi:check
state: >
{%- if states('sensor.openweathermap_temperature') | float > states('input_number.96h_warm_maximaal_gemeten_temperatuur') | float -%}
true
{%- else -%}
false
{%- endif %}
#Laatste update van bovenstaand
- name: "Laatste update 96H max"
icon: mdi:calendar
state: >
{{ ((as_timestamp(now()) - as_timestamp(states("input_datetime.96h_warm_tijdstip_max_updatet"))) / 3600 )| float | round(2) }}
#Actuele temperatuur is lager
- name: "96H warm actuele temperatuur is lager dan minimum"
icon: mdi:check
state: >
{%- if states('sensor.openweathermap_temperature') | float > states('input_number.96h_warm_minimaal_gemeten_temperatuur') | float -%}
false
{%- else -%}
true
{%- endif %}
#Laatste update van bovenstaand
- name: "Laatste update 96H min"
icon: mdi:calendar
state: >
{{ ((as_timestamp(now()) - as_timestamp(states("input_datetime.96h_warm_tijdstip_min_updatet"))) / 3600 )| float | round(2) }}
The code is functional for 90% but Iâve got a issue with the next part:
#Actuele temperatuur is lager
- name: "96H warm actuele temperatuur is lager dan minimum"
icon: mdi:check
state: >
{%- if states('sensor.openweathermap_temperature') | float > states('input_number.96h_warm_minimaal_gemeten_temperatuur') | float -%}
false
{%- else -%}
true
{%- endif %}
He doesnât use the actual value. He is rounding the values the compare the state with another. If the state is around the 0,5 the answer is true. But I want to use the actual value and not a rounding value.
Does any one know what I do wrong?
The problem now is that went the vallues are fast the same the result is the whole time âtrueâ.
Thank you,
Tom