I’m too tired to go into all the details, right now but I will give the concept and other people can follow up with you if you decide you want to go this route.
First, the short answer is that you can’t toggle a routine. However, you can initiate a routine when a different switch turns on, and you could have that switch be a toggle. So you would still have two routines, but instead of tapping the routine itself, you would have a widget or a virtual device and its State change within automatically run the appropriate routine of the two routines.
The medium answer is that if you have an android phone, this can be done with sharptools and Tasker.
The long answer is that if you have an iOS phone and/or you don’t want to use Tasker for some reason you can still do it just with code by setting up a virtual toggle, but the set up is a little complicated. I’m sure there’s a way to do it in Core, I just don’t know that one. Alternatively, you can see how one member did it in the following article:
Most of these methods don’t change the fact that you still have one routine to turn everything on and another routine to turn everything off. The difference is that you are now getting a toggle switch or widget that you can go directly to and it will then automatically run the right routine.
Based on what @RobinWinbourne posted below, if you use web core you could have a routine as a true toggle, but you still end up with one routine and one webcore piston, so two things to maintain. But the UI might be cleaner.
So I’m not sure if any of that really meets your requirements, but if it does sound like something you’d like to pursue, other people can help you get it set up.
@joshua_lyon @fabrguer @RobinWinbourne