Dealing with virtual switch


I have a virtual switch (contact sensor) that I use to control my EZVIZ cameras within Smartthings with the additional IFTTT routines. It works like that:

  1. If I open the virtual switch, the IFTTT routine arm the cameras
  2. If I close the virtual switch, the IFTTT routine disarm the cameras.

Simple. But there is one problem. It is only synced one way. So if for some reason I change the cameras state inside the EZVIZ app (it is also used by my wife so the probability that somebody will do it is high) not in Smartthings, those changes aren’t reflected in Smartthings. So the virtual switch do not change its state. You can imagine that causes a problem because from that moment my virtual switch won’t work as it suppose to (I will open it thinking it is closed although it is not, so it won’t arm the cameras).

Is there a way to make a routine in Smartthings to always check first what is the state of the switch?

So if I’m closing the switch, first it checks if it’s open. If not, it opens it first and than closes it. That would solve the problem.

The proper solution is using not one virtual switch but two, one called ArmEzviz and another DisarmEzviz for instance.

Both would be momentary switches, always off except for a brief moment when you switch them to trigger the action. For a regular virtual switch you can add an action to auto turn off after a few seconds.

That’s what I do to trigger stuff that cannot be synced.


Thanks, that worked!


With WebCoRE, for example, you can set up a rule that checks the state of your virtual switch before executing the disarm or arm action with IFTTT. This way, if the switch state gets out of sync due to changes in the EZVIZ app, SmartThings can correct it before proceeding with the arm/disarm routine. It takes a bit of setup, but once it’s done, it can provide the syncing you’re looking for between EZVIZ and SmartThings.