Template for Vacuum

Here is what I have, I want to make the battery_level < 10 and status stopped. This is not working:

{%if is_state_attr('vacuum.jackie', 'battery_level', < 10) and is_state_attr('vacuum.jackie', 'status', 'Stopped') %}true{%endif%}

try

{{ state_attr('vacuum.jackie', 'battery_level') | int < 10 and is_state_attr('vacuum.jackie', 'status', 'Stopped') }}

3 things about your question:

  1. can you see vacuum.jackie in Developer tools -> States? (if not, don’t answer the rest as it won’t work :wink: )
  2. getting its state from an attribute is a bit strange, what is states.vacuum.jackie.state in Developer tools -> Template? Maybe it’s better to use that one.
  3. Everything is case-sensitive here so Stopped is not the same as stopped, check that out.