Virtual switch used with Google Home to enable/disable rule

I have the lights in the guest bedroom controlled by a motion sensor via Rule Machine. Is like to be able to pause and resume this rule using a virtual switch commanded verbally via Google Home while at the same time- announce the fact that the rule has been paused or enabled. What I've created isn't working. It neither pauses the rule nor fires off message. Can anyone help me with the correct recipe to accomplish this? Here's what I have:

Change your second if to else-if then close it eith an end-if at the end of the rule. That's what stands out to me.

Because it is a virtual switch, you'll need to set up the trigger again using the regular 'switch' capability instead of 'physical switch'.

What @april.brandt and @bjcowles said should do it in addition to making sure that the virtual switch is assigned to a room in your google home app. If it isn't assigned to a room then you may have troubles controlling it via voice from a google speaker.

1 Like