Hello jojoro,
I also have Xiaomi switches and these are also read via an automation in HA. In general, I have the feeling that a “direct” automation in HA is more stable than a flow in Node-RED, but maybe it’s just my feeling. I tried to create a tutorial for you. Maybe it will take you further. I have not installed the “Xiaomi Palette” and I do not need it.
On the first picture you can see an overview of the complete flow.
The first node is “events: all” and here “xiaomi_aqara.click” is entered for “Event Type”.
Next, a “switch” is created to get the “Xiaomi Switches” displayed individually!
Next, I created two “switch” nodes to read the “single” or “double” click on each button …
Finally, I turn a “plug” with a “single” click on and off …
Maybe this will help you! There may be an easier way, but that’s the way it works. If a simpler or better way is shown here, I am also trying to try and learn something new. I am not a professional and have received much help here in the forum …
Good luck!!!