I want the same behavior like the slider but then using a button

Hi,
I have found a M4L patch that lets me allow to open and close groups in ableton.

I want to midi map the function to a cc BUT when doing this with a normal button this only allows for opening the channel and not closing it (doesn't trigger the midi twice).

I found out when using the slider this works like a charm, is there a way to use the same function as that slide and use it as a button?

When "mode" is set to "tap", the button always sends its "on" value, try with "toggle".

got it working with a switch