You currently can’t use templates within the current-state node.
![](//community-assets.home-assistant.io/original/3X/c/0/c0771ed14fdd9b353ad3870b8f7a6906617e5e46.png)
[{"id":"5797dc09.8564a4","type":"inject","z":"2441972b.173ec8","name":"","topic":"","payload":"on","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":150,"y":112,"wires":[["6aa52273.5a220c"]]},{"id":"1eb0621c.7b4fce","type":"inject","z":"2441972b.173ec8","name":"","topic":"","payload":"off","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":146,"y":160,"wires":[["6aa52273.5a220c"]]},{"id":"6aa52273.5a220c","type":"api-call-service","z":"2441972b.173ec8","name":"","service_domain":"homeassistant","service":"turn_{{payload}}","data":"{\"entity_id\":\"light.some_light\"}","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":396,"y":112,"wires":[["457f06bb.c09738","4bf02ca.7240bd4"]]},{"id":"4bf02ca.7240bd4","type":"ha-wait-until","z":"2441972b.173ec8","name":"","outputs":2,"entityId":"light.some_light","property":"state","comparator":"is","value":"payload","valueType":"msg","timeout":"20","timeoutUnits":"seconds","entityLocation":"","entityLocationType":"none","checkCurrentState":true,"blockInputOverrides":true,"x":620,"y":160,"wires":[[],["6aa52273.5a220c"]]},{"id":"457f06bb.c09738","type":"debug","z":"2441972b.173ec8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":620,"y":112,"wires":[]}]