Well, it is done. Probably not the most efficient way to do this but it works. For future reference I’ll put my solution here:
What I first tried was to simply “link” the buttons to other zwave devices. This should be possible by setting some “Configuration Parameters” on the thing, as seen in below screenshot:
Then associating the buttons at association groups, as seen in below screenshot:
important notice: Don’t forget to save at the top right within Openhab
This should set the changes to “pending”. Now on the button send a wake-up signal so it will configure the thing as set in Openhab. (the “pending” indication button will go away).
This should be able to do exactly what I want it to do. Unfortunately it didn’t. Somehow both endpoints got switched by any of the buttons instead of just one. When choosing seperate nodes this did work perfectly, so I had to figure out another way. The other way was using the channel (number) of the scene selection. But I saw in the web panel of openhab it just changed to 1 or 2, and double or tripple press was not registered… In the manual it says that a double press will change the value to either 1 or two and send a parameter (presses 2 or 3 times). I was not able to “catch” that in any way (searched a lot). But after inspecting the log files I found that the value of the number was not 1 or 2, but 1.0 or 2.0. and after double pressing the second number changed (so 1.3 and 2.3). This made me able to set up rules. Yay! Below rule is set to be able to use the button to switch light 1 on:
rule "light1on"
when
Item button changed to 1.0
then
switch.sendCommand(ON)
end
Since the original switch is also used to turn the switch on/off the state of the button needs to be re-initialized, so I chose to set it to 0 if the original switch is used. (becase if it already is 1.0, it will not change to 1.0 and not switch the light on anymore) I added a line to all rules to do this. Example to switch light 1 on the rule is now:
rule "light1on"
when
Item button changed to 1.0
then
switch.sendCommand(ON)
button.sendCommand(0)
end
I put in both rules 4 times for all states (1.0, 1.3, 2.0 and 2.3)
Anyways, I’m helped, maybe improve the code later to get it more “readable”, but for now it works and the wife will be happy ;).