Automation when current temperature reaches target temperature?

I’m trying to create an automation that will notify me when the current temp reaches the target temp from a climate entity. Not sure how to get it to trigger? (Use-case: I have a Traeger integration that uses a climate entity for the probe and wanting to announce on my speakers when the probe reaches temp)

Thanks!

use a template trigger using as the value_template the current temp and target temps being equal to each other.

my syntax is off somehow on this comparison, would you happen to know where?

"{{ (state_attr('climate.traeger_probe_p0', 'current_temperature') | float) =  (state_attr('climate.traeger_probe_p0', 'target_temperature') | float) }}"

The error I’m getting is…

TemplateSyntaxError: expected token 'end of print statement', got '='

1 Like
"{{ state_attr('climate.traeger_probe_p0', 'current_temperature') | float(0) == state_attr('climate.traeger_probe_p0', 'target_temperature') | float(0) }}"
  • To set a variable’s value you use =
  • To check if two values are equal you use ==

NOTE

The use of the float filter in this particular case may not be necessary. The values being compared may already be floating point numbers and not strings.

1 Like

Thanks! I was close :slight_smile:

You’re welcome!

I suggest you mark finity’s post with the Solution tag because it was the first to offer the correct suggestion. My post merely corrected a template syntax error.

1 Like