[HOW-TO] Using the Z-Wave Association Tool in SmartThings

Seriously? If this is what I think it is I’m going to be very very happy. :hugs:

I’m looking forward to testing @EricM_Inovelli :slight_smile:

Missing a huge opportunity here to assign direct associations for multi-tap like all Jasco switches/dimmers have. That’s really the only thing stopping me from replacing my GE dimmers. A separate group for each #x tap would be ideal.

This has definitely been on our list for a while. It may not make firmware 2.0 because that version is focused on bug fixes + a few extra features, but it is planned.

:heart::heart::heart::heart::heart::heart::heart::heart:

Can’t wait!

@EricM_Inovelli - thanks for this guide. So I’m trying to set this up in a room where I have a red series dimmer tied to 6 sconce wall lights…each with an illumin bulb in them. Can you show us what we need to do in the settings of the red series dimmer to make it where it doesn’t turn off the load, but turns off & dimms the bulbs using the association? Am I supposed to disable local and remote control from the switch or from the child devices (bulbs)…very confused.

A few comments for you. First, the association group only supports 5 devices. :frowning:

Other than that I recommend that you configure the dimmer as follows:

  • Local control disabled
  • Set the “Dimming Speed” option to 0 (this is the first preference option).
  • Dimming speed (from switch), Ramp rate, Ramp rate (from switch) should be set to 101 (to keep them the same as the “Dimming Speed”.
  • Default level for local & Z-wave to 100
  • State After Power Restored to 99

You can disable remote control as well, but remember that if you ever need to turn the switch off or change a setting, you need to enable remote control to do so. This includes setting up the associations. So if you have remote control disabled and you try to setup the associations with the tool, it won’t work.

Try setting it up with Group #2 first and test it. On & Off should work in this test and once everything looks good, you can try group 4.

With all of this in mind, check the “Troubleshooting” section in the first post if you are still having problems.

1 Like

Does the LZW31-SN support secure pairing? I’ve excluded and re-paired it multiple times but never pairs securely.

Yes, it does. It supports S2 security and will downgrade to S0 if S2 fails.

Are you using SmartThings? You might want to try to reboot your hub or make sure you aren’t on the edge of your z-wave range.

Yep, using SmartThings and the switch is actually 5 feet nearer my hub than another that is paired securely. I gave up on getting it to pair securely and just swapped out the dimmer switch nearby that did pair securely. I needed to associate it with an inovelli switch at the other end of the 3-way setup since I couldn’t make the 3-way work with a dumb switch or auxiliary switch. That’s a whole different conversation, but I was tired of going down that rabbit hole and found an alternate solution. Anyway, it’s all good now, just wish there was an easier way to set up securely.

Yeah, it definitely bugs me that you can’t choose what type of inclusion you are doing in SmartThings.

Some devices I’ve used in the past had one sequence for a secure join and another for an insecure join. Hubitat blocks secure joins from all but locks and garage door openers by default so it isn’t generally an issue there.

Yep, you are correct. Hubitat does allow you to change the setting to secure join every device, but it is disabled by default.

Quick question (apologies if this is a stupid question, but I am new to this) - I have a scenario where I have a hallway/entrance light and a stairway light (neither are smart bulbs). They are on separate circuits and are on 2 separate Inovelli switches. I would like for both lights to turn on/off and dim together and to be able to control this from either switch. Would your solution posted here help to create the functionality I have just described?

Thanks in advance!

It sounds like this can be accomplished with using association groups 2 & 3, but I actually haven’t tested that setup.

One issue might be that the destination switch would only change its level after you let go of the button on the source switch. So, say both switches are at 90% and you hold one down to dim down to 20%. The other switch won’t dim down to 20% until you release the button on the first switch. That might take some getting used to.

I have installed both parts of the App from the links above in SmartThings IDE “My Smart Apps”, however the app never shows up in my Smarthings app (classic or the new one). It should be under Automation/Smart Apps. I have installed, uninstalled, installed again over the last two days multiple times but the app never shows up. I could use some help. Other apps (WebCoRe) i have installed this way have worked.

Hi Sir! I have another issue with the association tool. Could you please give me some advice/guidance on this one? Dimmer LZW31-SN Red SmartThings - Dimmer not joining Association

Hi @Bingwit, the app should show up as described. Did you make sure that the app is installed and published?

Also, you need to install the app in the SmartThings app as well.

Automation > + Add a SmartApp > My Apps > Z-Wave Association Tool

I setup an association between two dimmers in a 3 way configuration. I wanted both of them to constantly be in sync no matter which you controlled.

Here is what I had to do.

On each device I had to set the association behaviour (parameter 12) to local. The reason being is I found it created a loop of I left it at all. Watching the logs the devices just kept sending the changes back and forth to each other. Setting it to local only it would only send the change when controlled at the switch. The one downside is they don’t stay in sync if I operate them remotely. I’m still playing with this.

Then on each dimmer I added the other dimmer to groups 2 and 3.

Everything seems to work fast and better than using the hub. If I turn on or off either switch the other does the same. If I dim either switch the other does the same. And only one of the switches is actually controlling the light.

I’m trying to figure out how I can keep this functionality working when sending commands remotely and avoiding the loop mentioned above. It must be one of the association behaviour options.

What code do I need to add to non-inovelli DH to get them to work with the Z-Wave Association Tool?

You have to add the following methods (below). You also need the command “processAssociations()” somewhere appropriate for the specific device. If it is a sleeping device it needs to have this in its WakeUp Notification method. If it is an “always awake” device, it can be put in its “updated()” or “refresh()” method. That method returns the commands as “un-formatted” z-wave commands so they need to be formatted at one point. For example:

def cmds = processAssociations()
return commands(cmds)

private command(physicalgraph.zwave.Command cmd) {
    if (state.sec) {
        zwave.securityV1.securityMessageEncapsulation().encapsulate(cmd).format()
    } else {
        cmd.format()
    }
}

private commands(commands, delay=1000) {
    delayBetween(commands.collect{ command(it) }, delay)
}

Those previous two methods may not be necessary. It just depends on how you are sending commands through the hub.

def setDefaultAssociations() {
    def smartThingsHubID = (zwaveHubNodeId.toString().format( '%02x', zwaveHubNodeId )).toUpperCase()
    state.defaultG1 = [smartThingsHubID]
    state.defaultG2 = []
    state.defaultG3 = []
}

def setAssociationGroup(group, nodes, action, endpoint = null){
    if (!state."desiredAssociation${group}") {
        state."desiredAssociation${group}" = nodes
    } else {
        switch (action) {
            case 0:
                state."desiredAssociation${group}" = state."desiredAssociation${group}" - nodes
            break
            case 1:
                state."desiredAssociation${group}" = state."desiredAssociation${group}" + nodes
            break
        }
    }
}

def processAssociations(){
   def cmds = []
   setDefaultAssociations()
   def associationGroups = 5
   if (state.associationGroups) {
       associationGroups = state.associationGroups
   } else {
       if (infoEnable) log.info "${device.label?device.label:device.name}: Getting supported association groups from device"
       cmds <<  zwave.associationV2.associationGroupingsGet()
   }
   for (int i = 1; i <= associationGroups; i++){
      if(state."actualAssociation${i}" != null){
         if(state."desiredAssociation${i}" != null || state."defaultG${i}") {
            def refreshGroup = false
            ((state."desiredAssociation${i}"? state."desiredAssociation${i}" : [] + state."defaultG${i}") - state."actualAssociation${i}").each {
                if (it != null){
                    if (infoEnable) log.info "${device.label?device.label:device.name}: Adding node $it to group $i"
                    cmds << zwave.associationV2.associationSet(groupingIdentifier:i, nodeId:Integer.parseInt(it,16))
                    refreshGroup = true
                }
            }
            ((state."actualAssociation${i}" - state."defaultG${i}") - state."desiredAssociation${i}").each {
                if (it != null){
                    if (infoEnable) log.info "${device.label?device.label:device.name}: Removing node $it from group $i"
                    cmds << zwave.associationV2.associationRemove(groupingIdentifier:i, nodeId:Integer.parseInt(it,16))
                    refreshGroup = true
                }
            }
            if (refreshGroup == true) cmds << zwave.associationV2.associationGet(groupingIdentifier:i)
            else if (infoEnable) log.info "${device.label?device.label:device.name}: There are no association actions to complete for group $i"
         }
      } else {
         if (infoEnable) log.info "${device.label?device.label:device.name}: Association info not known for group $i. Requesting info from device."
         cmds << zwave.associationV2.associationGet(groupingIdentifier:i)
      }
   }
   return cmds
}

def zwaveEvent(physicalgraph.zwave.commands.associationv2.AssociationReport cmd) {
    if (debugEnable) log.debug "${device.label?device.label:device.name}: ${cmd}"
    def temp = []
    if (cmd.nodeId != []) {
       cmd.nodeId.each {
          temp += it.toString().format( '%02x', it.toInteger() ).toUpperCase()
       }
    } 
    state."actualAssociation${cmd.groupingIdentifier}" = temp
    if (infoEnable) log.info "${device.label?device.label:device.name}: Associations for Group ${cmd.groupingIdentifier}: ${temp}"
    updateDataValue("associationGroup${cmd.groupingIdentifier}", "$temp")
}

def zwaveEvent(physicalgraph.zwave.commands.associationv2.AssociationGroupingsReport cmd) {
    if (debugEnable) log.debug "${device.label?device.label:device.name}: ${cmd}"
    sendEvent(name: "groups", value: cmd.supportedGroupings)
    if (infoEnable) log.info "${device.label?device.label:device.name}: Supported association groups: ${cmd.supportedGroupings}"
    state.associationGroups = cmd.supportedGroupings
}