I’m not sure I understand the question.
Association is a one time event, essentially A configuration step. Say you have a minimote and a Z wave wall switch. You “create the association” one time and one time only. The Z wave wall switch device ID is added to the group list kept in the Minimote. And the minimote device ID is added to the group list in the wall switch. And that’s all there is to it.
From then on, when the minimote sends a “basic” command (“Basic” has a specific Z wave meaningin this context, and is only on/off/dim) to that group, then that group will act on it. That’s all it means.
When creating a button controller, we actually don’t typically associate the wall switch to the Minimote. Instead, we associate the hub to the minimote.
Now when you press a button on the minimote, The hub gets the instruction. But the hub doesn’t itself act on that instruction–it doesn’t turn itself on or off. Instead, you use a smart app to say “when the hub receives a button two press notification then do…”. And that smart app will then send commands out to any other devices you wanted to have respond to that button press. The hub is receiving the button two press notification because the hub is in the Association group for that minimote, but you don’t have to specify that in your smart app. It just happens automatically. When you write the smart app, you just care that the hub knows button two was pressed. As a coder, you don’t care how the hub knows that.
So there won’t be any association code used after the initial set up. Because everything will go through the hub. The association is just used to make sure the hub get told when a button is pressed.
Most of the time in a smart things deploy association code is not needed at all, because the hub automatically adds itself to Association group one for every new device added to the network that supports association.
We only need the one time association configuration code if we want to put the hub into other association groups for a particular device, like group two or group three, or if we want to “directly associate” two Z wave devices so The trigger device can send a message directly to the receiving device without having to go through the hub first. But even in these situations the association code is only used one time to configure the devices. After that, everything happens automatically.
So association is used every time you press a button on a minimote in a smart things set up, but You don’t have to do anything to cause it to be used. ( other than maybe have a line in the DTH saying that this device supports Association, I’m not sure on that part or not.).
But definitely once the configuration is complete, you don’t need any additional code. The right messages will get to the right devices because they are configured in the right way. You don’t turn association on and off for each command being sent. Once it’s on, it’s on until you do a disassociate reconfiguration. This is true for both direct association and the more common association to the hub so it knows a button was pressed.
Did that help any?