Template Alarm Control Panel

There is no way to use a code directly as you would think. I think this is an oversight in implemention. You have to put it in a condition for your action. See my example here:

https://community.home-assistant.io/t/esphome-alarm-system/