Virtual Dimmer in Association groups?

I am using the switch connected to S2 on one of my Fibaro Dimmers downstairs to control an other Fibaro Dimmer upstairs via Associations groups #4 & #5. Is it possible to control a virtual dimmer in the same way? I tried to enter the Device Network ID of my virtual dimmer but it didn’t work…

Unfortunately no. Association is a feature of zwave itself and depends on an actual physical transmission, it won’t work with a virtual device.

The whole point of zwave direct association is that the hub is not involved, it’s just one Z wave device talking directly to another.

Oh… :frowning: Is there any other solution for this?

I tried some coding myself, but it’s not responding right everytime…

def dimUp(devices) {

if (state.doDim == “yes”){
state.currentLevel = "${devices*.currentLevel[0].toInteger()}"
def nextLevel = state.currentLevel.toInteger() + stepSize
state.newLevel = nextLevel.value
devices*.setLevel(nextLevel)
}
}

def dimDown(devices) {
if (state.doDim == “yes”){
state.currentLevel = "${devices*.currentLevel[0].toInteger()}"
def nextLevel = state.currentLevel.toInteger() - stepSize
state.newLevel = nextLevel.value
devices*.setLevel(nextLevel)
}
}

def dimLevel(evt) {
if (state.doDim == “yes”){
if (state.newLevel && evt.value) {
if (state.dimDirection == “up”) {
if (evt.value == “100”){
state.doDim = “no”
}
dimUp(slave)
}

    else if (state.dimDirection == "down") {
        if (evt.value == "0"){
    	state.doDim = "no"
   		}
  dimDown(slave)
  }

}
}

Tagging @anon36505037

Thanks for your reply.

I have all that under control. :slight_smile: Missed to paste paste that part of the code in my post above.

When I get Scene ID 22 (Hold) it triggers the “dimUp” or “dimDown” according to what direction it should go. (The direction changes everytime Scene ID is 23 (Release).)

With my code above it sometimes feels lite there is a lag. I think that i maybe might be because it runs over and over again until the switch is released?

I just thought about something. I run my code against a Trådfri bulb. Can it be that the trådfri bulb is causing the lag? That it is slow i reaction?
Maybe it would run smoother if I used a virtual dimmer, and then set the Trådfri to follow that level?

I tried it. It is too easy! :wink: I like the challenge in trying to write my own smartapps.

But eventually I will probably give up, and then will I most likely use webcore. :slight_smile:

I just want to be able control the Trådfri from a wall-switch. On/off (no problem) and dim level.
The Trådfri is stand alone, it doesn’t have to be synced to anything. I just want the same smooth dimming function that I get from the Fibaro.

I tested to assign a virtual dimmer instead and use the “dim with me” smartapp to make the Trådfri bulb follow. Didn’t work… Trådfri just follows a few steps and then stops.
Even if I use the slide on my phone to change the level on the virtual dimmer the trådfri doesn’t follow.

I have a “good night kids” scene that is supposed to turn on trådfri and set the level to 10%. It doesn’t do that either. Turns on, but that’s it. It used to work, worked yesterday…