Boolean template condition

Hi, can anyone see what’s wrong with this template condition? Can’t find any info on how to do this check. I want ‘true’ if they’re different. Always comes back as false at the moment, even though they’re different.

"{{ states('input_boolean.heating' ) != states('binary_sensor.heating' ) }}"

Any help appreciated, thank you!

How are you testing this? The condition tester in the Automation editor is bugged and does not work with Template conditions. The conditions work, it’s just the tester that is at issue.

If the above is not the source of your problem please post your entire automation config. There’s nothing obviously wrong with the way you have set it up, but how you configure what you have what you’ve pasted may also lead to issues.

These will work:

condition:
  - "{{ states('input_boolean.heating' ) != states('binary_sensor.heating' ) }}"
  - condition: template
    value_template: "{{ states('input_boolean.heating' ) != states('binary_sensor.heating' ) }}"

The following will not because they are effectively double wrapped in quotes:

condition:
  - condition: template
    value_template: ' "{{ states('input_boolean.heating' ) != states('binary_sensor.heating' ) }}" '
  - condition: template
    value_template: >
      "{{ states('input_boolean.heating' ) != states('binary_sensor.heating' ) }}"

Thanks a lot for the response. The issue was that I’d used quotes in the UI! I switched to the yaml editor and it clearly showed the issue… :man_facepalming:. Thank you!