"Mirror" in Smart Lighting SmartApp seems to be inconsistent

A bit of a long post, but I have several behaviours that I need to outline in detail to get across what is going on…

I use “Mirror” behaviour in three setups in my home. In each case, the “Mirror” acts differently. Two work well enough that I have no complaints but only one of those works exactly as I would expect. The third is completely broken when I enable it and I have had to change the rule to “Turn On (and also off)”.
They are as follows:

  1. GE Zigbee Dimmer switch is mirrored by GLEDOpto RGBW strip (set up as a ZLL device). When I turn on or off the GE dimmer, the GLEDOpto strip follows exactly; it doesn’t matter if the action is at the GE Dimmer, through a Smart Lighting automation or just through the standard app (not classic) on Android. This is acceptable but if I turn the GLEDOpto strip on or off in the app then the behaviour is not mirrored to the GE dimmer; such behaviour seems to be described by this answer - How to set up a virtual 3 way between 2 master switches?, but I do not expect to have to mirror in both directions.
  2. Virtual Living Room Lights device is mirrored by a Logitech Harmony Activity and a separate mirror by a Cree Connected Dimmable Bulb. In this case, I can use the Virtual Living Room Lights device or the Harmony Activity to control the living room lights and one activates the other so that both switches are in the same state at all times. If I turn on the lights with the Virtual Device in the SmartThings app and then open the Harmony app, the activity is ‘on’. Turning it off there turns off the Virtual Device and the living room lights with it. This is precisely what I would expect of a mirrored behaviour and I only have the one mirroring rule between the Virtual Lights and the Harmony Activity.
  3. GE Zigbee Dimmer mirrored by two Cree Connected Dimmable bulbs and a separate mirror for a Logitech Harmony Activity. In this case, turning on the GE Dimmer turns on the bulbs but does not activate the Harmony Activity. Turning off the GE Dimmer starts to turn off the Cree bulbs but then they immediately turn back on again despite the GE Dimmer registering as off (it is this behaviour I have had to “fix” by setting the behaviour to “Turn on (and also off)” instead of “Mirror” - hinted at but not resolved here Osram / Sylvania Lightify Strip - Smart Lighting Mirror Switch Behavior) and if I replace the Cree Blubs with a GLEDOpto strip to mirror the GE Dimmer, that works exactly as in case (1) above. If I turn on the Harmony Activity, the GE Dimmer does not respond but if, subsequently, I turn on the GE Dimmer and then turn off the Harmony Activity, there seems to be a race condition where the GE Dimmer and the Harmony Activity turn each other off and on repeatedly with the Cree bulbs following as best they can.

So, what is the designed function of “Mirror”?
Is there some incompatibility with GE Zigbee Dimmers?
Why do Cree Connected bulbs fail to respond correctly to mirroring a GE Zigbee Dimmer device but are fine mirroring a virtual lighting device?

As I stated, case 1 is fine as that is my hallway lights on the GE Dimmer and a hidden coat rack light turns on and off with it; case 2 for my living room lights functions perfectly; case 3 is for my bedroom lights, where I have tried making a virtual bedroom light device to control the individual lights and I can control that with the Harmony Activity just fine, but mirroring the GE Dimmer produces the same strange race condition results (except the Cree Bulbs don’t turn back on when they should be off). For the bedroom, I’d prefer not to have a virtual device since that runs in the cloud and I’d like the GE Dimmer to have direct control over the bedroom lights at all times in case of any internet issues. All I want is for the GE Dimmer and the Harmony Activity to remain in sync and the lights to follow.

I think I have worked out why I only need one mirror with the Harmony Activities: it is because the activity provides the mirror function in return.
However, the hiccup seems to be with mirroring another device with the GE Dimmer. If I create a virtual light device and set up a two-way mirror with the GE Dimmer, I can control the dimmer from the virtual device with no issue. If, then, I try to control the virtual device from the dimmer then it behaves incorrectly: I can turn on the virtual device with the GE Dimmer, but turning off either turns everything back on again or turns things off but not completely.
I think I am beginning to understand “Mirror” a bit better, but I cannot understand why it is not compatible with certain devices and virtual devices.

What do you mean virtual light device? Is it a virtual switch or virtual dimmer?

How can it turn off something not completely?

I add a device in the IDE and the type is a “Simulated Dimmable Bulb”
“Virtual” is nomenclature from this post - FAQ: Creating a virtual Device

“…not completely” means that some of the other devices that are mirrored do not turn off, do not turn off at the some time, turn off and then turn back on again, or cause a race condition where things flicker at a slow-but-aggravating rate.

You have set up multiple direction mirroring then. And probably that causes the whole issue with the other devices too. It explaines that if it comes back on again. (Luckly it is not hitting the race condition then.)

No, I have only tried multi-way mirroring today.
Before I had only one-way mirroring.
If I get my Cree bulbs to mirror my GE Dimmer, they turn on with the dimmer (curiously they don’t turn on with the same brightness) but on turning off the GE Dimmer, they turn back on. This is with only them mirroring the dimmer, not the other way.

I should add that multi-way mirroring has been such a disaster that I am not using it anymore.
However, my setup is still not working as I anticipate.

Similar issue as yours. Race condition.

I don’t have neither the Cree bulbs or the GE Dimmer. So I don’t know what they do, when you do a command to 0%.
Some devices might handle it as turn off and remembers the last value, so might not. Then a turn on might triggers it to a saved value.

Some devices might handle it as set brightness to minimum level and not as turn off.

There is a big difference how the device communicates on/off or change dim level.

OK, I’ll describe a little more.
The post you suggested is somewhat similar, but not the same.

The GE Dimmer acts just like a dimmable bulb but with a local physical switch. I can control it from the SmartThings app just like a bulb (set a dimming value from 1% to 100% and it has an on/off switch. This is the same with the Cree Connected Bulbs, dimming from 1% to 100% and an on/off switch, except the bulb doesn’t have a local physical switch. The only difference is that the device card is a switch for the GE Dimmer and a bulb for the Cree bulb.

The race condition only exists when I bring in a virtual device or switch.

In fact, I think I have just resolved the issue, at least as far as basic function goes…
By changing the Virtual Bedroom Light from a Simulated Dimmable Bulb to a Simulated Dimmer Switch and then mirroring it with both the GE Dimmer and the Harmony Activity and then complimenting the mirroring with reverse direction from the GE Dimmer to the virtual device, I can get stable switching between all three with the virtual dimmer as a buffer. The Harmony Activity passes it’s dimming level to the virtual device but it is not passing the dimming to the GE Dimmer.

Also, It doesn’t address why the Cree bulbs require On/Off control rather than mirroring, as I’d like them to follow the setting on the GE Dimmer.

Scratch that.
It was behaving for a minute or two and now it’s acting up again.

However, if I make the virtual devices Simulated Switches only (no dimming function) then the race condition goes away between the virtual devices.

Nope, scratch that too.
When I make a change, things seem to act like I want them to for a couple of minutes and then they start going wrong.

I have experimented a little further and have a modified setup.
The Cree Blubs have an on/off relationship with the GE Dimmer (not mirroring).
GE Dimmer mirrors and is mirrored by the Virtual Dimming Switch.
The Dimming switch is commanded by the Harmony Activity but it cannot modify the Harmony Activity.

With this setup, I can perform the following activities:

  • turn the lights on and off with the GE Dimmer (albeit not the way I want to) and it modifies the Virtual Dimming Switch correctly. The updates are not passed to the Harmony Activity.
  • turn on the bedroom lights with the Harmony Activity. However, trying to turn the lights off with the Harmony Activity causes the lights to turn off and then immediately back on: the Harmony Activity turns off, but the virtual switch, GE Dimmer and the lights remain on (perhaps the GE Dimmer incorrectly overrides the Virtual Dimmer after the Harmony Activity has changed it).

If the Harmony Activity is on and I try to turn off the lights with the GE Dimmer then the lights and devices do not respond (presumably, the inability to update the Harmony Activity overrides any other change).
I have to turn the Harmony Activity off and then, some seconds later, I can turn off the lights with the GE Dimmer. Sometimes, however, the lights turn back on and I have to hit the switch again to get the lights to turn off and stay off.

If I close the loop and mirror the Virtual Dimming Switch onto the Harmony Activity then I end up with slowly oscillating lights.

The closest setup I can get to it working how I want is the following:
The Cree Blubs have an on/off relationship with the GE Dimmer (not mirroring).
GE Dimmer mirrors the Virtual Dimming Switch (but is not mirrored by the Virtual Dimming Switch).
The Dimming switch is commanded by the Harmony Activity and the Harmony Activity mirrors the Virtual Switch.

With that setup, I can turn the lights on and off with both the Harmony Activity and the GE Dimmer, but turning the lights on or off with the GE Dimmer does not affect the state of the Harmony Activity.

I get the impression that the “Mirror” function needs to take into account corner cases better, and that there is an incompatibility with GE in-wall Dimmers and Cree Connected bulbs (or, possibly, timing between local and cloud activities).
SmartThings should be able to handle the Mirror function and should be able to prompt GE and Cree to inspect their firmware for compatibility.

Interesting thread. Post if you get more info.

I use some virtual switches. Not simulated, virtual, those are two different things. At least for switches and dimmers. My vague recollection is that virtual devices run locally while simulated ones run in the cloud.

My cases are dead simple and work as expected. I use them to effectively group some smart dimmers so I can control several lights with one tile in the app or one voice command.

There is no “reverse mirroring” for this nor do I want it. If I change one of the dimmers individually by any method, only that one changes.

Fascinating.
How do you set up Virtual Devices (local) rather than Simulated (cloud)? I can only find Simulated in the device list on the IDE.

Last night, I tried mirroring in both directions between my GE Dimmer (hallway lights) and GLEDOpto strip (coat rack). Both devices run locally and I was able to switch either on or off and have the other respond immediately.

Perhaps I need my virtual switches to be local.
However, that would not correct the mirroring behaviour between the Cree bulbs and the GE Dimmer…

Never mind, I wasn’t looking at the list closely enough. Found the Virtual Devices and will try them out…

Nope.
Found the Virtual Dimmer type and assigned that.
Using the last setup I described above (the one that worked closest to what I want) I was able to get precisely the same control - one direction only.
Then I closed the loop by mirroring the GE Dimmer to the Virtual Dimmer.
I could turn on the lights with the Harmony Activity but turning off merely turned the Harmony Activity back on.
I tried turning off with the GE Dimmer and it went into a flashing mess. The event was mirrored back and forth between the GE Dimmer and the Harmony Activity through the virtual dimmer with the lights keeping up as best they could. I had to disable two mirrorings to stop the flashing.

What is interesting is that if I break the mirroring to the Harmony Activity and have two-way mirroring between the Virtual Dimmer and the GE Dimmer, I can turn the lights on, but turning off with the Virtual Dimmer or the GE Dimmer turns the lights off and then immediately back on.

There seems to be something very wrong with the way mirror commands are sent between devices. They seem to need some sort of priority, directionality or timestamping that they currently may lack.

In essence, I shouldn’t need the Virtual Dimmer. I should be able to just mirror the GE Dimmer back to the Harmony Activity and have the Harmony Activity instruct the GE Dimmer, but that was just as bad when I tried it.

The turning the lights back on is an issue with the level reporting. One of your devices throws into the mirroring a setLevel command and that turns things back on, or if not a set level, then just an event of level:20 and then the other copies it and sets the level to 20 meanwhile turning it on.
Mirroring was never designed to replace multi way switches. It is to copy one device state to another. When you stand in front of the mirror and turn the light on, light comes on on the other side of the mirror too, but the person in the mirror will not go and turn it off inside the mirror.
It is more for a fixture where you have multiple bulb, or a room with multiple fixtures what you want to set by one controller. You will mirror that controller’s state to the bulbs to control them together.
If you want your complex logic, build mirroring rules in WebCore, both way and limit the time between allowed changes to create a debounce feature.
(Just an experiment, put two physical mirror in front of each other and look at what you will get. Just to understand why your lights start flashing. :wink: You need a debounce introduced to stop that.)

OK, I have taken your observations onboard and have crafted a fix that does not require coding.
By setting up a circular mirror rather than a linear one, I have introduced the delay you said would help.
The Harmony Activity instructs the Virtual Dimmer and it mirrors onto the GE Dimmer. The GE Dimmer mirrors onto the Harmony Activity.
The delay between the Harmony Activity triggering the Virtual Dimmer creates the “debounce” that the system needs. I can watch it happen on the SmartThings app.
I can now turn the lights on and off with both the GE Dimmer and the Harmony Activity without any flashing and all the devices remain in sync.

However, this still does not fix why the Cree Bulbs do not mirror the GE Dimmer satisfactorily.
I’d say someone at Samsung needs to get Cree and GE to investigate their firmware behaviours. I should not need a buffer for the mirroring to a cloud activity and the Cree bulbs sholud adopt the GE settings when mirrored.

Search for Cree in the community forum to see the amount of complaints. They have some terrible firmware and SThas nothing to do with it.
I cannot say anything about the GE Dimmers but look around for that too, you might find some solutions or similar complaints as well.

I’m actually kind of surprised you can mirror between dissimilar things. I’ve just assumed that mirror for a dimmer was only going work for mirroring other dimmers.

I agree, it does seem odd. I tried changing it to on (and back off) from the GE Dimmer to the Harmony Activity and even the circular link started to flicker. There seems to be something quite wrong.

I have submitted a request to GE for help but I must say, this seems firmly with SmartThings. There seems to be something not right with the messaging protocol for mirroring and other influenced behaviour.
Just because a feature is rolled out to provide a simple copy from one device to another does not mean it can’t be used for other purposes and should be made robust because of that.
Plainly the devices are free to ignore certain mirrored parameters and states (as the Harmony Activity does with any dimming setting, whereas it does reflect the power setting), however, SmartThings don’t seem to insist on behaviour, which is dangerous in an ecosystem with disparate devices.

1 Like