Virtual Switch that follows the state of Physical Switch

This is one of the built-in problems with an asynchronous design. Interestingly, in some cases turning something on that you think is already on is harmless. In other cases not so good. So with ST if the state of a device is lost for a moment, things depending on that state being correct will fail.

It is possible to work around some of this with custom apps, but not all of it. Some of this behavior is intrinsic to the architecture of ST even when it is working properly. Toss in some ST server / comms issue, and itā€™s gonna fail.

1 Like

This is my idea.

when it runs set a state.

state.running for instance and give that a value of true

At the same time have a method that only has state.clear() as an action and call that method a minute later.

Then only run any of the switch actions if
state.running != true

Essentiality only allowing one action per minute

This may help you with the app you were trying to build beofre @baldeagle072

Guys if you do improve upon the code do let us know, For now the code is working. I have incorporated in Binder for dual relay and virtual switches and the relay (1 & 2) are able to stay in sync.
Just one problem though. I am not able to catch the event for physical throw of switch, I do not know if the switch is generating it, it should. Noting in

def parse(String description) {
 log.debug "Parsing desc => '${description}'"

def result = null
def cmd = zwave.parse(description, [0x60:3, 0x25:1, 0x32:1, 0x70:1])
log.debug cmd
if (cmd) {
    result = createEvent(zwaveEvent(cmd))
}
log.debug "Parsing result => '${result}'"
return result

}

I just installed a Linear WS15Z wall switch and a Linear WT00Z accessory switch.

I was planning to use Big Switch so the WT00Z controlled the WS15Z via ST per JDRobertsā€™ suggestion.

However, Big Switch is no longer on the list of Officially Published Apps. Can someone tell me where to find it? Or it is no longer working? If so, is there a replacement with similar functionality.

I didnā€™t want to use the minimote to associate the switches since JDRoberts said that ST will not know the status of the switches if they talk directly to each other.

Would appreciate any help, suggestions!

You can use Rule Machine to do this, and much moreā€¦

Thanks Bruce, I installed Rule Machine and plan to use it in the future.

But for now, I found that the Smart Lighting app will let my WT00Z accessory switch control the master WS15Z switch.

The WT00Z is basically a one button scene controller!

Looks like this only sync on/off on switches, which works really well. Is it possible to add dimming level sync as well on dimming lights?

It worked very well for months. But last weekend all of a sudden the 2 switches ping pong each other indefinitely so I had to remove it, any idea what may have caused it?

This has happened to me off and on. I guess it is due to occasional
network delays. I either reboot the hub or throw the breake on the device
to reset it. Hope it helps.

Yes, I rebooted the hub to get them out of the infinite loop too.

I put the smartappp back and ya itā€™s working fine now again. Thanks.

Would be nice to have a mechanism to prevent it from happening. My wife (who triggered this) was not pleased :sweat_smile:

Hi, I also had the two switches ā€œping pongā€ yesterday. And I checked the code of @tslagle13 and found out that the code does not help prevent loop, it worked because of how smartthing works as @JDRoberts explained. So if something goes wrong, it may loop.
(the ā€œifā€ lines were useless 'cause it check the status of the active device it self)
So I did change the code and it still works and I believe it will not cause any looping.
I still leave the credit to @tslagle13 in the code. Cheers.


Btw, I think this code can be done simplier with WebCoRe, but I still use this code to work with my multi-switches device after some modification.

1 Like