Smartlights problem (loop)

Hey guys!
I’m using the mirror behavior function is the smartlights app, but it s not working properly.
I tried with two brand switches, but doing the same.

So i want to mirror 2 switch to do the exact same function (turn on/off)
When i set up the mirror behavior, it is working, they are working fast and good.
BUT, when you press it a little faster, for example accidentally. The switches going crazy, and they going into an infinity loop turning on/off themselves.

Please check this video, so you guys can see it:

I tried with z-wave switches
And tried with zigbee switches as well

Is there a solution for this problem?

Brand and model of the switches?

The one what i tried is the neo coolcam z-wave switches.
The other is the zemismart push switches.
Both using the original handler (zwave switch, zigbee switch) local.

Is one switch mirroring the other, or you set up that A mirrors B and B mirrors A too?

1 Like

Hey Gabor!
I set up A mirroring B
And B mirroring A
I tried this and mirror behavior too.
Same situation…

Amúgy üdv :wink:

I guess you did use SmartLighting. Where you select copy behavior and the device to mirror.
If you did the set up to A mirror B and after in another rule B mirror A, that can cause the wires to cross.
You would expect that it would just mirror and it does in normal conditions, but with the quick change you are introducing a race condition which triggers and infinite loop with the two mirrors. One solution is to have only one mirror, but you need to make a decision which switch is the master to mirror, but that is not what you really want.
Second solution could be to add some rule through maybe WebCore, if the quick switching happens (Debounce?) to set all switches the same.
Third solution, do some rewrite on the DH, if custom DH, to not allow quick switching. (Debounce?)
Fourth solution, which is a mixture of two and three, add a virtual switch in the setup with a code not allowing debouncing. The limit should be about 3-5 seconds.

But you need to know, it means if you need to change quickly the light, it will not allow you. (There are some Philips non-smart adjustable brightness bulbs, which does change brightness with a quick on/off. You would be unable to use it.)


That’s the brand. What are the model numbers?

(First rule of home automation “the model number matters.“ :wink: )

There are some configurable parameters which might help, but they depend on the exact model number.

1 Like

Hello Gabor!
Thanks for the detailed message!

My problem is that i am not a pro programmer to write in Webcore or Custom DH.

Smartlighting included in smartthings so i thought it will work without problem.
So i cannot set this within smarttlighting?
Or this isn’t a known problem?


@BrianRain, please provide the product number for @JDRoberts and he might be able to help with some device specific settings. It is a quiet specific use what causes this issue. Denouncing might be a known issue, even if it is coming from a race condition.
Try to turn off the mirror just to confirm that it is done by ST. Beacuse what @JDRoberts comment suggests that is might be a know issue with these switches.
Try without the mirror do the quick tapping and see if it works normally.

1 Like

Sorry for the late answer!

I am using now the zemismart zigbee switch:

They are works perfectly with smartthings if i choose “zigbee switch” in my devices. So they are local.
Also, when they are mirrored, and i tap on the app quickly… they do the same.
So its smartthings problem.
Can you help me guys somehow?

If you can see the issue in the app, then you are causing a race condition. Then probably the mirroring is not the right choice for you.

Are these switches just virtually controlling the bulb or are they physically connected?

Hey Gabor!

The no.1 switch has physycally connected to the light.
The no. 2 switch has not.

So i mirrored them. When i switch no.2 switch, it triggers no.1 switch. And vice versa.

I tried with two brand switch and doing the same. So it’s a smartthings problem.

I guess the previous switch was a similar with local execution. Was it?

I understand. You are trying to mimic a two way switch. But the only difference in that setup, the switches are behaving as toggle switches, none of them has definite on and off state.

I think the local execution is fast enough to be able to cause a race condition in the cloud.
Probably the solution would be and extra virtual switch in mirror, but the DH for that has to have a debounce feature.
It should be like this:

A <—> V <—> B

Where A and B are your two switches and V is a the virtual switch. And <—> is the both way mirroring.

I wouldn’t suggest to modify the DH for the zigbee switch otherwise you would loose the local processing. That comes handy with other features which would might run locally, like motion sensors. And the Automations in the new App. Anyhow the Smart Lighting mirroring is running in the cloud.

The debounce should be something like the virtual switch would not change state if the previous command was less than 2-3 seconds ago.

@JDRoberts, any other idea? Does that switch has programmable debounce feature? Or any better solution in your mind what can kill the race condition?

Hey Gabor!
Thanks for your answer!

I thought smart lighting is local, that’s why it is so fast.

Also, 1 sec would be enough i think for delay.

Can somebody try To repriduce this with two switches? Just mirror them, and tap one of them in the app quickly?

I am curious that it is only my problem or this is a common stuff

Anyone can help with this?
I am going crazy… i built a new house, planned everything and this problem so annoying :frowning:
It is always happening if the hub acts a little bit slower, and not immediately turns the second switch.
So you switch again, and BOOM. they going crazy…

I am ready to make videos or tests, just need to know how to solve this…


@BrianRain Smart Lighting runs locally if the devices are using local DH. If something not runs locally, that is highlighted with small print there.

There is another topic, where local execution was just discussed. New app + local processing = problem?

I don’t have two switches, but mirroring is really copying between devices. It is not working really well when it is both ways. Maybe try to build some pistons with WebCore with added debounce.