Syntax error passes config check

Took me a while to find this because:

  1. I wasn’t wearing my reading glasses.
  2. It passed config check and an automation reload with no errors.
  condition:
    - condition: template
      value_template: >
        {( media_type in ['radio','spotify']
            or is_state('input_boolean.radio_resume','on')
            or is_state('input_boolean.spotify_resume','on') }}

I’m going to take a wild guess and say it’s because:

  1. It is being interpreted as a string
  2. A string that is not “true” is “false”.

That’s cool and all, but in this particular situation it… isn’t.

That is all.

The leading {( effectively disqualifies it as being a template and renders it a string. However, you would think it would be flagged as an error because it makes little sense to accept a string value for value_template.

I do think that requiring trigger and condition templates to evaluate to an actual boolean value (ie. true/false, ‘true’/‘false’, 1/0 would prevent problems like this and the other “bug” I recently got schooled on.

No biggie besides the hour of my life I lost today. Just another caveat to keep in mind. I’ve now added {( ({ (% and the like to my list of you’re a big dummy things to search for when I’m having a difficulty tracking down an error.