Wait template, help

I’m using the GUI to add a wait template where I want it to continue the automation when 2 sensor values have decreased to 12. Values are the state of charge percentages from 2 batteries.

What needs to be added to get this wait template to work?

{{states(‘sensor.lilygo_rs485_venus_3_marstek_battery_state_of_charge’)==‘12’}}"
{{states(‘sensor.lilygo_rs485_venus_4_marstek_battery_state_of_charge’)==‘12’}}"

How long does it take to reach 12%.
Having long delays is not good.
It’s better to trigger on this value

I see two main issues:

  1. If both those need to be true, you should combine them with an and.
  2. The == comparison is literal, the values must be “12”… not “11.9”, not “12.0”, etc. For numeric values, convert the state to a float or integer, then use >= or <=.
{{ states('sensor.lilygo_rs485_venus_3_marstek_battery_state_of_charge') | float <= 12 
and states('sensor.lilygo_rs485_venus_4_marstek_battery_state_of_charge') | float <= 12 }}

Thanks for helping out, your suggestions gives an error: Message malformed: invalid template (TemplateSyntaxError: unexpected char ‘‘’ at 9) for dictionary value @ data[‘actions’][14][‘wait_template’].

Is that fixable?

Yes, that is due to the fact that you didn’t format the original post properly and I forgot to remove the “pretty” quote marks… I have fixed it in my post above.

Thank you!