I’m a bit unclear on what exactly you’re trying to accomplish with an association here. Zwave associations are meant where two devices on the zwave network talk to eachother directly, completely bypassing the controller. An example of an association I use is double tap on a Jasco switch for my downstairs lights. I have two sets of lights, on two different switches in two different parts of the same room. One switch is hooked to one set of lights, the other is the second set. With double tap association, if I double tap the switch for “light A” down, it turns off “light b”. It does this directly between the switches - so even if zwavejs2mqtt is stopped or the machine is off, the double tap still works since it bypasses the controller.
Associations aren’t able to accomplish complex automations, since the controller is bypassed (which would have the logic to control a complex automation). In my example, the double tap will trigger regardless of any automations I set in Home Assistant, again since the controller is bypassed here. With a PIR, if you directly associate it to a switch, it will always trigger regardless of any automation triggers you setup. This generally results in undesirable situations, and triggering a switch by direct automation with a motion sensor is generally not helpful since you can’t add any conditions to the trigger.
Also, you would set the association on the device you want to be the trigger. If you want the motion sensor to trigger the Aeotec, you would have to set the association on the motion sensor. If you associate something to group 4 on the Aeotec, what you are doing is triggering some other zwave device to go on and off when you turn switch s2 on and off on the Aeotec - basically making it work in unison. This generally would be if someone wants another bank of lights to turn on and off the same time you turn the switch on and off without wiring them to eachother. I don’t know what motion sensor you are using and if it has an “on and off” to activate or not, but that’s the only possible thing I could see you trying to do here with a motion sensor associated to group 4.
If you want more details, it might be better posting exactly what your “more complex automation” is that you are trying to accomplish, so we can get a better idea of it and hopefully offer some more helpful advice.
If you want to set associations in zwavejs2mqtt, go to the control panel, select your device, click groups, then click “add”
One thing to keep in mind, zwave devices associated with eachother must be included with the same security class - ie non-secure devices can only associate to other non secure devices, and S2 devices and only associate to other S2 devices. If you want to use association and the security classes are different, you will have to exclude/reinclude with matching security classes for it to work.