Locking a switch

Good morning everyone!

I’ve been trying for a long time but can’t find a solution;

I have a motorized damper ;controlled with Shelly1 with Esphome.

From home assistant I have a button that activates the motion command ;I managed to make it “lockable” against accidental contacts ;to be able to command it you need to double tap and you can use it for 10 seconds.

Now I want to have a switch that deactivates the operation of the command; I would like to use it in an admin tab, to stop in case of need the functionality on user windows.
I tried with template lock, but I can’t make it work, maybe I’m wrong.

I attach some screen of the configuration.

Thanks a lot for the tips

esphomeconfig