Templating - comparing temperature to input state

Hi,

I am trying to compare 2 values to use as a condition as follows within an automation:

I want the automation to run if the value of an input is greater than the outside temperature - no matter what i do, the automation runs, even if the condition (should be) is false:

{{states('input_number.hc_mb_et_override') | float >= states('sensor.external_temperature_c') | float}}

Any ideas?

Thanks in advance.

1 Like

Your template appears to be valid. It will evaluate to true when the input_number’s value is greater than or equal to the sensor’s value. You can confirm it by pasting the template into the Template Editor and observing the result.

If you are using it in an automation’s condition and testing the automation by manually executing it (for example, by clicking Run Actions in Configuration > Automations > Your_Automation) then it will be ignored. Manually executing an automation will skip the automation’s trigger and its condition.

If you are not manually executing the automation, but allowing it to be triggered by its trigger, and its condition isn’t working properly, please post the entire automation so we can examine it.

Thanks!

I was testing it by clicking “run” - didn’t realise this would ignore the condition.

The command used to be called “EXECUTE” but in an attempt to better communicate what would happen, it was renamed to “RUN ACTIONS” because only the automation’s actions will be executed (the trigger and condition are ignored).

On the other hand, if you go to Developer Tools > Services and use the automation.trigger service, it shows a check-box (Skip conditions) for optionally excluding the evaluation of the automation’s condition.

1 Like

Thats great, thanks!