What's a good way to toggle a script?

Toggling lights is easy via the light.toggle service.

I have two scripts, one turns on an entitiy with special parameters and the other turns it off (again special parameters and a delay).
What is a neat way to run the turn on script if entity is off and run the turn off script when the entity is on?

I have one wall panel button that should do both depending on whether the light entity is on or not.

@danny, I think you are looking for Template Switch, I do believe this will do what you want.

2 Likes

I have done templating before but only for sensors! This is great, thanks for the pointer.