What is the difference between the "virtual" switch and "simulated" switch?

What is the difference between the virtual switch and simulated switch?

Is there a way to use a virtual contact sensor to use shm to get notification when a light is left on for x minutes?

Virtual Switches are newer and run locally. Simulated Switches are the same thing but are older code and are cloud based.

Although you can use SHM for your rule, you should try webCoRE as it will do that and much more.

1 Like

Virtual will also process an on/off command irrelevant of current state.

1 Like

@prjct92eh2
Thanks, that is good to know

What are some use cases for this?

I am also trying a third party dth “universal” and this seem to enable the “conversion” of type of events, so if I want to use shm to notify a light left on, I can use this device type to convert on, to open which shm can send notifications on.

What can I do with “virtual”?

Thanks in advance

I have had a lot of trouble with Virtual switches. I had a bunch of Simulated that I wanted to run local so swapped them over. What I found was that webCore was not able to correctly register the on/off event. The on/off event would trigger the piston but when the piston went to check if the state had changed it said it had not. My setups where it was a problem was where I have a Virtual switch with several other lights tied to it. When the virtual switch goes on so does the other lights and same for adjusting dimming. Usually motion triggers the virtual switch. The pistons generally check if the state changed before doing anything. I.e. if already on it doesn’t re-execute the on steps and for off vice versa. Swapped the back to Simulated and they work fine.

Are you asking why people use non-physical switches in general? Or why they specifically use the “virtual” DTH? The specific answer is just because it runs locally.

The general answer is that there are a number of different reasons.
One of the most common is that there is something (which could be a third-party system like Amazon Alexa or a third-party security system or a third-party automated sprinkler system) Which can recognize that a switch can come on in smartthings. Maybe through IFTTT, maybe through a direct integration. So you create a non-physical device, control it using SmartThings logic, and that switch going on or off is picked up by the other system so it triggers events over there. Or the other way around, the other system turns that switch on or off and then you have SmartThings do some set of events. Again, very commonly used with both smart speakers and with IFTTT.

Another use for non-physical devices is to set up a timer on a particular switch. You set the conditions for the non physical Device so that you can still use the actual physical device in other ways at other times.

http://thingsthataresmart.wiki/index.php?title=How_to_create_a_virtual_timer_for_a_light

Still another use before we had webcore was to have one non-physical device stand in for a whole group of actual devices, such as with the motion sensor zone manager smartapp. Nowadays I think more people use webcore and just list out the whole group of devices, but sometimes the non-physical representation of the group is still useful, particularly when working with smart home monitor.

Did that help any? Or did I misunderstand the question? :sunglasses:

4 Likes

JD, that was a great summary.

Although the virtual switches were around before, they really are a necessity if you do much with the Echo. From my old mainframe programming days it’s like having a working storage switch that enables you to tie logic and functionality together.

Thanks

2 Likes

I get an access denied message when I try to create a virtual switch any ideas?

Are you using incognito browser?

I got it working, but my idea didn’t work.

How do we define what happens when the virtual switch is turned off? I have it working for On but nothing happens for Off, and I can’t see where to specify the Off action

Smart Lighting or the automation creator are two options.