Self-resetting virtual switch?

I have Ring doorbells and cameras at two locations. Motion is announced through the (8) Echo devices in our house via the Alexa Ring skill. All good, except when I'm cutting the grass, putting Christmas lights up, etc. or it's really windy. We get repeated motion alerts throughout the house and it drives us insane. If I pause notifications in the RIng app, it only silences them on my phone, not on Alexa. If I turn off notifications in the Alexa app I may forget to reenable them, rendering the devices useless.

I want to create a dashboard where we can temporarily disable motion alerts and display the enabled/disabled status. This will have a high WAF, since the annoyance of repeated motion alerts overrides my wife's desire for me not to install geek stuff like a tablet on the wall.

I was thinking a custom virtual switch driver might be the way to go. Besides on/off (on meaning alerts are disabled), I could have custom commands like "disable for 1 hour", etc. In the driver, I think I could set a scheduled job to turn the switch back off at the desired time, and these virtual switches could be monitored and controlled via a dashboard.

The motion alert itself would be done in webcore using Echo Speaks, conditioned on the state of the virtual switch.

Does this make sense? I know I could do it all in webcore but I'm not sure that dashboards can display the state of webcore global variables.

Anyone else have the same or similar issue and resolved it somehow?

This is what I use.

Thanks, might be able to use that as a starting point. I really was thinking about having selectable delay times though, with the delay-ending date/time as an attribute of the virtual switch itself.

I have Arlo cameras that monitor the outside of our home and they are all battery operated. Like you I don't want them recording me cutting the grass or working in the yard so I have a virtual switch that I can turn on and it turns off all the cameras. That was an easy rule in RM. It coudl also be doen in Webcore

In case I forget to turn them back on when I am done I have a rule that turns the switch back on at sunset or if the mode changes to away. If so inclined I could set them to turn back on after any amount of time.

Virtual switches are basically a boolean global. They can certainly be checked in webcore or RM.

Not sure about the Ring integration with HE. If you can disable the notifications in Alexa you could use a virtual contact sensor to trigger a routine in Alexa from HE.

Thanks. Ring integration, etc. isn't really a problem. I've got the notifications in HE already.

My uncertainty at this point is really just what to use for the enable/disable switch and the date/time to restore each motion sensor to normal operation.

This has to be controllable by a dashboard so it's quick and easy to use, I could use webcore global variables, but it might be a little clunky to control them from a dashboard and it would probably require several interrelated pistons.

If I used some sort of custom virtual switch device, it should be fairly easy to control them from a dashboard, with a single webcore piston that monitors for motion events, checks the corresponding virtual switch, and if enabled, creates the announcement via Echo Speaks. I'm thinking that the individual virtual switch devices would be responsible for turning themselves off, without having to set up scheduled tasks in webcore.

A rule that turns the disable switches off at sunset or if the mode changes is a good idea though.

This device driver
https://raw.githubusercontent.com/thebearmay/hubitat/main/dashVariable.groovy

 /*
 * Dashboard Variable Virtual Device
 *
 *  Licensed Virtual the Apache License, Version 2.0 (the "License"); you may not use this file except
 *  in compliance with the License. You may obtain a copy of the License at:
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software distributed under the License is distributed
 *  on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License
 *  for the specific language governing permissions and limitations under the License.
 *
 *  Change History:
 *
 *    Date        Who            What
 *    ----        ---            ----
 *    2020-12-28  thebearmay	 Original version 0.1.0, reversed engineered from the RM Hubitat driver
 * 
 */

static String version()	{  return '0.1.0'  }

metadata {
    definition (
		name: "Dashboard Variable Device", 
		namespace: "thebearmay", 
		author: "Jean P. May, Jr.",
	        importURL:"https://raw.githubusercontent.com/thebearmay/hubitat/main/dashVariable.groovy"
	) {
        	capability "Actuator"
		
		attribute "variable", "string"

     //This one works with the dashboard
		command "setVariable", [[name:"variable", type:"STRING", description:"Both commands store the same variable.  Dashboard tile type applies constraints at the dashboard."]]
		//This one works in webCore
    command "setVariableAlt", [[name:"variable", type:"STRING", description:"Both commands store the same variable.  Dashboard tile type applies constraints at the dashboard."]]   
            
    }   
}

preferences {
	input("debugEnable", "bool", title: "Enable debug logging?")
}

def installed() {
	log.trace "installed()"
    setVariable("installed")
}

def updated(){
	log.trace "updated()"
	if(debugEnable) runIn(1800,logsOff)
}

def setVariable(varStr) {
    if(debugEnable) log.debug "setVariable() $varStr"
    sendEvent(name:"variable", value:varStr)
}

def setVariableAlt(varStr) {
    if(debugEnable) log.debug "setVarALt() $varStr"
    setVariable(varStr)
}

void logsOff(){
     device.updateSetting("debugEnable",[value:"false",type:"bool"])
}

will allow you to have variables interact with a dashboard variable tile. You'd have to have to set up a piston to update it from the global variable (and optionally update the global variable from the tile).

Interesting. But how do you get a webcore global exposed to the dashboard? I didn't see anything in the webcore options to do that.

The device driver acts as a two way connector (I reverse engineered the RM process) from the dashboard to webCore. You'd need to create a small piston to use the setVariableAlt command to sync the driver with the global variable.

Ok, I think I figured it out. You are talking about a HE global variable. I was talking about a webcore global variable.

So you're manipulating a HE global variable, and then exporting that to webcore so it can also manipulate it, or act upon its state. Do I have that right?

Actually I'm using a webCore Global

Ok, I think I get it now. You're creating a virtual device using your driver, which has a single "variable" attribute which represents the virtual variable. Then you expose the device to webcore,

So there's two copies of the data. One is stored in an instance of your device driver, and the other is stored in a webcore global and you have to keep the two in sync within a webcore piston. The piston subscribes to changes on either, and updates the other.

Clever.

Got the idea from the Use Dashboard to Manage Lock Codes discussion when I saw how RM was communicating to the dashboard, but it can be quite useful.