How to use an Automation trigger attribute as a template condition?
Trying to have an automation to run only if the TRV that triggers the automation is not off.
This is my attempt:
“{{ state_attr( ‘{{ trigger.entity_id }}’ , ‘system_mode’) != off) }}”
But i get the following error:
Message malformed: invalid template (TemplateSyntaxError: unexpected ‘)’) for dictionary value @ data[‘condition’][0][‘value_template’]
This did the trick.
I noticed that the > is important as well, without this I still got the error:
value_template: >
{{ state_attr( trigger.entity_id, ‘system_mode’) != ‘off’ }}