In this repo you can find various code/config examples flows for Node-RED in Home Assistant.
Hardware: Aqara Switch
Flow source: Sonos Switch
Functionality:
- One click: Play/pause current play list/radio
- Double click: Next (only works with playlist not with radio)
- Hold: Volume up/down (will alternate between the two)