Problem with double-click in S-Mate

I have 2 dual r3 lite each connected to 2 light bulbs. Also, I’ve s-mate connected to 2 button switch. This switch is bistable.

Is it possible to create an automation, so that each button of this switch turns on 1 bulb after 1st click, after 2nd click turns on 2 bulb and after 3rd click turn off both bulbs?

I tried to use routines with AND logic, but app doesn’t let me add button and state of device in the same condition. Also I tried to use double-click or long press action of S-Mate by changing dip-switch position, but still it’s not working.