This can be done with LATCH mode: Try this (untested):
CodePushButtonAction({ "callback": BinaryParameterCallback( mapping = KemperMappings.TAP_TEMPO(), text = "Scanner", color = (255, 255, 255) ), "mode": PushButtonAction.LATCH, "useSwitchLeds": True, "display": YOUR_DISPLAY_LABEL })
The default KemperActionDefinitions.TAP_TEMPO uses momentary mode because this reflects the standard Kemper button behaviour, but if you like it differently, no proplem, just copy its code into your switches.py and alter it like you need in this case just the mode is changed to LATCH, which sends a 1 for enabling and a 0 to disable on the next press and so on. MOMENTARY would send a 1 at push, and a 0 at release.
Works! I do not need to send a second message, works with one message sending value 1, second press disables the beat scanner.
Many Thanks !