Trigger different actions on a single, double or double click on a binary sensor

Thanks, slashback, But I don’t understand that.

Anyone know how I can use this with a Shelly dimmer 2 connected to 2 momentary switches using mqtt. I can make a binary sensor that detects the relay state but not the switch state so if I press the switch it sends an mqtt message to on but doesn’t trigger back to off when I let go of the button. Thanks

I would create a binary sensor entity that changes on each mqtt message (on or off) on your topic (or on each transition of your binary_sensor), and configure your automation on that switch.

Well, you are talking about a group of light so either you have an entity group.your_group referencing your lights, or you have a light group (Light Group - Home Assistant) referencing your lights.
Just set this group entity in the parameter of the service light.toggle that you will use in the long_click_action, short_click_action or double_click_action of the automation based on this blueprint