I am trying to set up an automation that will toggle a switch based on an mqtt payload. I am using the service_template but can’t seem to get the syntax correct. Can someone please look at what I have and let me know if you see any issues?
- service_template: “{% if (’{{trigger_payload}}’,‘on’) %}switch.turn_on{% else %}switch.turn_off{% endif %}”
Thank you!