Calculate ABS() value in condition:template

I am trying to find a way to calculate ABS() value of this and then to compare if > 1 ?
Any workarounds on that?

condition: template
value_template: ‘{{ (states.sensor.X.state | float | round (2) - states.sensor.Y.state | float | round (2)) > 1 }}’

1 Like
‘{{ (states.sensor.X.state | float | round (2) - states.sensor.Y.state | float | round (2) ) | abs > 1 }}’
4 Likes

Thank you so much! I was tricked by the documentation that says to use Abs() format, not “| abs”. Great!

2 Likes