Generic switch

As per this thread : How create switch to run one script for on and a different script for off?

I would like to see the ability to make a generic switch to be able to call scripts or services for the on /off functions.

My use case is to be able to use alexa to turn my tv on and off by the use of a switch with the on function calling my tv_on script and the off function calling my tv_off script. This is a secondary tv that is controlled by my harmony hub through the use of an ir extender (tv is not associated with any harmony activities so as not to disturb the viewers of my main system). The switch does not need to monitor the state (it can’t anyways) so switch templates do not work.

1 Like

Done. https://github.com/home-assistant/home-assistant/pull/9272

2 Likes

Ohhh yes. I have many cases like that. And for usage with Alexa, now, I need to call two different commands, which is a bit akward and difficult to remember (very low WAF)