You’re in luck, I just recently went through this and captured documentation for my future self when I asked a year from now, “How did I do that again?”
There are several steps to creating a local association where one z-wave device can signal an action to another z-wave device without going through the controller.
The first step is ensuring the devices support the action you want to achieve. I’m going to give you an example of 2 devices I recently configured for this - A GE/Enbrighten Z-wave Switch model 14294/ZW3005 and an Aeotec Recessed Door Sensor 7 ZW187. The goal for the direct/local association was for the door sensor open state to turn on the light directly.
One thing not mentioned in most discussions of associations - Both devices should be at the same security level. In my case the door sensor was originally included as S2 security, and the light was included as no security. I had to exclude and re-include the door sensor as no security before making any other changes. You can see the security level of your devices in the Z-wave-JS UI:
Hovering over the red circle will show you “no security”.
The ZW187 supports directly controlling another Z-wave device via Group 2 - from the documentation:
From the association table documentation:
Here it states we have to pay attention to the setting of parameter 3:
Because I don’t want to have the operation work like a refrigerator door (light on when open, off when closed) and I just want the light on faster when the door is opened, we have to set parameter 3 to 3. That sends the on/open command to the light, but not the off/closed command. In my case, I take care of the off command with a separate automation. Note that 0xFF is open/on and 0x00 is closed/off.
To set the parameter use CONFIGURE in the device page:
Because the door sensor is a battery device, you must wake it up to set the parameter.
Note the correct status in parameter 3. You may not have to go through these steps, the default action may be fine for your desired action.
Now setup the association. In the Z-wave-JS UI, expand the sensor you want to send the local/direct association and click on Groups. Click the green Add button. The device will need to be awake for this step as well. Check your device documentation for wake instructions.
Select Root Endpoint, the group you are configuring (in my example group 2), the Target Node (in my example the Garage Light). In my case the target endpoint is No Endpoint. Click the Add button.
Once added you should see the new Group 2 association in the device configuration like below.
That’s it. Now you can test. It’s best to have and review both device configuration documents before you start setting things up. You’ll need to know the Association group, any parameter changes, and how to wake up your device (if it’s not mains powered). Good luck!