Back Porch Light Automation Disabling

Hi @Tom_C,

My use case is similar to yours, but I’ve included a motion sensor under an eve into the scenario. I use 2 Smart Lighting apps so everything runs local.

I use one Smart Lighting app to turn on my deck lights when my screen door opens between sunset and sunrise. It does not turn the lights off.

I use another SL app to also turn on the lights (or keep them on) when motion is detected during the same sunset/sunrise restrictions, but more importantly to turn off the lights after motion has stopped for 2 minutes.

The motion sensor can “see” the door and our dog on the deck, so as long as there’s any kind of motion, the light will stay on. This is also handy for when unexpected visitors (like owls and raccoons) show up after dark.

Off the top of my head I think I’d try to do something with a variable predicated upon the switch being physically turned on and off.

I haven’t tested this, but if you look at the interactions for a switch, you’'ll see both physical and programmatic. If the physical interactions only relate to the switch being turned on and off manually, then you ought to be able to set a variable’s state to reflect if the switch was turned on or off.

Once that variable properly reflect’s the manual turning on and off, you can condition the automation to run only when the light has been turned off using the value in the variable.

That’s my theory. Haven’t actually tried it. :sunglasses:

I do just this with my outside light and door. works fine. nothing more annoying than turning on the outside lights and then someone comes out the door and wrecks it all!

In such cases where I want automations to temporarily to be suspended, I either:

  • Create a virtual ‘Override’ Switch that the piston checks for at each run. If that’s on, the piston doesn’t run its automations.
  • For dimmers, I can add logic to the piston to look for a 100% setting. If the light(s) is/are set to 100%, no automation takes place.

Use cases for these two solutions are different but for those cases, they both work equally well.

Hi Iflorack… Is webCoRE needed for this virtual Override Switch or can this be done with Smarttthings Smartapps? Can you provide some detail on how this is set-up. I’m just getting started with Automations.

I also use a modified version (see below) of this piston (by @bangali) that’s discussed over on the webCoRE Community forum. There are a couple of variations discussed, one is for a smart bulb/dumb switch and the other is for a smart switch/dumb bulb.

I’m using one like the smart switch/dumb bulb version in my workshop. Under normal circumstances, turning the light on with motion and off after two minutes of inactivity works fine. However, if my wife will be working in a somewhat ‘hidden’ corner and not moving very much while there, making the light stay on is desirable.

Just change the defined variables at the top and it should work. My version uses two sensors but you can use this with just one by removing one and changing the other to yours. Anyway, here’s my version:

1 Like

I use webCoRE because I wanted some other decision parameters that made it the better choice. But Smart Lighting can certainly be used. Once you create the Virtual Switch, create your Smart Lighting Automation based on motion or time or whatever you’d like and then under “+ More Options” select ‘Only if Switch’ is OFF - and select your virtual switch.

Hi Iflorack… Thanks for the information. I am loading over the webCoRE system to Smartthings.

I am looking to do an automations as follows:

  1. I have set up a switch (its an open close door/window switch) that can use an external dry contact to change the state from open to close. The set of contacts are closed (via SPDT relay) when my Furnace Fan is running and open when my Furnace Fan is not running. The modified window/door switch clearly shows me when my furnace fan is running and not running.

I am using this as a Trigger to Start all my Ceiling Fans in the house (Ceiling Fans run when the Furnace Fan is running). The Fans have a GE Smart Ceiling Fan Switch that is controlled by Smartthings and I set up a certain Fan speed (using the dimmer switch %).

The problem I have is… If the Fan is already on via the manual switch, I do not want it to turn off when the Furnace Fan turns off.

I have a total of 4 Ceiling Fans.

Can you give me some guidance on this?

I have set up the Virtual Switch. What do I use to change the state from On to Off on the Virtual Switch if the Manual Switch was used to turn on the fan?

There is a SmartThings Wiki that has an FAQ to do this but it seems to be down right now. Here’s a link to a message that tells you how to create a Simulated Switch. I think there has recently been a ‘Virtual Switch’ choice added to the IDE so I’d probably use that because it runs locally.

I’m sorry Lee and I very much appreciate your help. I found out how to create a Virtual or Simulated Switch.

For my issue, how do I change the simulated switch from on to off or off to on when a ceiling fan is turned on or off using the manual wall switch? I can see the options for the Smart Lighting that allows me to run or not run the automation based on a switch being on or off. Just can’t see how I tie the Virtual Switch or Simulated Switch to the manual setting of the Ceiling Fan switch.

To be honest, I didn’t read the entire message stream back to your original post where you described the intent regarding your fans, and determining physical vs programmatic actions. I was answering how to use a Virtual Switch to control an automation running or not - not the part about how you determine physical vs programmatic actions and then automatically turning the virtual switch on. In my case, I usually turn the virtual switch on via the SmartThings app, ActionTiles or by voice with my ten echoes. In your use case, that won’t truly address what you’re trying to do.

You need an automated way to determine if the fans were turned on manually or via automation so you can then turn the fans off - or leave them on based on which it was. Smart Lighting isn’t able to do that.

Theoretically, webCoRE can do it by tracking physical changes versus programmatic device changes. However, from what I understand most devices are not capable of reporting the difference between physical and programmatic actions. Even the ones that are, do not properly relay the needed data through a repeater. At the same time, many DTH’s are unable to determine the difference between physical and programmatic actions. So, unfortunately, it rarely works directly.

One potential way around all of this would involve using a Boolean variable and setting it to true when you use any programming logic with the targeted switch (or fan in your case) and then it will be assumed that anytime it is false that there was a physical interaction. An example of this concept is a few messages back in this thread where I posted my webCoRE piston for my Workshop Lighting (Back Porch Light Automation Disabling - #8 by lflorack)

Sorry I wasn’t paying attention enough to answer your actual original question, but I hope this helps.

This peaked my curiosity as when I posted earlier about using webCore to flip a virtual switch it was based on my theory, not my experience with having utilized this technique.

I have GE 12722 switches so I tested to see if webCore could throw a virtual switch based on physically turning the switch on and off. I found that webCore could indeed flip the virtual switch on and off when the switch was physically thrown. When the switch was programatically thrown, the virtual switch remained unchanged.

Of course, this test only pertains to a GE 12722. If you are using another switch, you may not have the same results.

That is the switch I am using.

I’m still trying to figure out how to do this with Smartthings Smart Lighting or Webcore.

Could you take a shot a building a webcore app using the GE Switch? If you could use some type of on/off or open/close smart switch as the trigger that would be great. I am not figuring out what I need to do with the Virtual Switch to make this work.

Excellent testing (and results). I have some of those switches too, so it’s good to know. Glad you took the time to rest it out.

Here is the code to turn your virtual switch on and off when the real switch is physically turned on and off. So with this, your virtual switch will tell you if the real switch was physically last turned on or off. This enables you to enable or disable the automated portion of what you are trying to do based upon the condition reported by the virtual switch.

Switch 1 is the “real” switch. Switch 2 is the virtual switch.

1 Like

So Cool. Thanks very much!

Hi Brian.

I actually have the GE 14287 Switch. This is designed for Ceiling Fans and allows the speed to be changed.
Using your Piston and changing the names (switch 1 = GE Switch, switch 2 = Virtual Switch), it looks like the virtual switch changes to on from a physical push of the button or a software start (from SmartThings). I’m thinking this is the case because the physical paddle switch can also be used to change the speed of the fan (speed 1-2-3).

Any thoughts?

You can change the example that @Bry provided from just turns on or turns off to include IF sections for each of the speed levels too. You’ll need to check to ensure that this switch provides the proper physical vs programmatic feedback for this to work. But if it does, you should be good to go.

@johnandy, I don’t quite understand your question but what @lflorack said is what I think may answer your question.

The key here to see if your “real” switch will work in this scenario is to see what interactions the switch exposes to webCore. In webCore, select the drop-down for “Which interaction” to see your options. In this case, you are looking for “Physical interaction” which, at least for the switch I tested, only fires when the switch is physically pressed. If the switch you are using doesn’t expose this interaction, then this technique won’t work.