First time here so don’t be too hard on me! Trying to create a virtual switch (I think) that can either toggle night mode on/off OR have it control a door lock directly, so that I can have my google home control the virtual switch which will then set mode to night (where I have lock the door as a routine) or if possible the virtual switch itself will control the lock.
I successfully created a virtual switch in IDE, but the only smartapp I could find to use it with was smart lighting which didn’t allow me to choose a lock as a device to control, and also didn’t allow me to control home modes.
So here I am diving into webcore! I’m sure it’s easy enough here to make a simple rule where when mode is switched, lock the door. I’m wondering how I then integrate this newly created rule into my google home? Where do these creations go/what do they become, and how are they accessed to then put them to work?
After creating the switch you should be able to discover it in your google home app. You will likely need to say something like turn the switch on/off instead of lock/unlock.
Then the setup is simple for webcore.
If switch changes to on
Then
Lock the door
If switch changes to off
Then
Unlock the door
Also be sure to check out the dedicated webcore community as these threads are deprecated.
Thanks for the reply! So to be clear, there will be an option in webcore for what I want to create? I’ll select a switch? And with the rules you layed out there, will I run into issues of this switch being turned on and locking the door, and then I go and unlock the door manually, the switch is still turned on thinking it’s locked so won’t allow me to remotely lock it again?
And I appologize for not stating earlier, ideally, and originally, the intent was to use google home to change modes where when in “night” mode, I have outlined in st that lights are turned off and door is locked. Obviously google home doesn’t want to do that for me directly, which is why I dove into the virtual switch workaround. But ultimately I’d like to be able to tie it all back together so that I can initiate mode change via google home and through whatever is necessary to get that lock, locked, and lights off all together.
If you use the trigger changes to then you would not have to worry about the lock trying to lock when you unlock it.
You can also trigger the lock based on routines executing as well.
And while I don’t have a GH I do have several Alexa devices and I have virtual switches that I tell her to turn on or off and then it triggers pistons in webcore. So it’s certainly possible to achieve your results
Is there a system variable in webCoRE to return the day of the week? For example, $DayOfWeek or something like that? Is there a list published somewhere with the built in system variables listed?
ahhhh thanks! I also just noticed I can scroll down under a piston and see all the system variables listed right there. Hey @eibyer while I have you One other quick question. I can’t figure out how to trigger a piston based on a variable having a setting of (not set). I have a weather station that unfortunately doesn’t say ‘0’ for rain fall in the last 24 hours for example, instead it just sets the variable to (not set) and I have a report being read aloud that sounds jacked up with just blank. “in the last 24 hours there has been rain.” is what ends up happening instead of 0 for example. So I have a piston setup that says 'if variable = (not set) then set variable to 0" for example, but it doesn’t trigger. I’ve also tried null, etc. How can I trigger off a variable being in a (not set) state?
Try using an expression instead, try isEmpty(variableName), returns true if it is. Test it in the evaluation console instead of waiting for the piston to execute.
What would the formatting be on (variableName), would it be {@variablename} or just as you expressed it? And if I want to trigger on it not being empty, could I use isNotEmpty(variableName) for the opposite?
Use the name of your existing variable (use @ if it is a global variable), I believe it is case sensitive so pay attention to that. If you want the reverse, then just check for ‘false’ output.
Trying to figure out a system that will turn on my outside light between sunset and sunrise.
Once it has done that I would like it to look at my ring doorbell and on motion turn the light up to 70% and on press turn it up to 100% for a period of time but then return to standby at 30% until sunrise when it will reset back to waiting for sunset.