How to distinguish multi-taps for Blue Series dimmers

Hubitat’s Rule Machine sets the internal %value% variable as follows for Inovelli Blue paddle presses (all values are strings):

Switch state commands
Dimmer turns ON = ON
Dimmer turns OFF = OFF

Button state commands:
Tap Up on Light Paddle 1x = 1
Tap Up on Light Paddle 2x = 2
Tap Up on Light Paddle 3x = 3
etc.

Tap Down on Light Paddle 1x = 1
Tap Down on Light Paddle 2x = 2
Tap Down on Light Paddle 3x = 3
etc.

Notice the results for Up/Down taps – the same values for the same number of taps. Accordingly, %value% cannot be used to distinguish an Up paddle double-tap from a Down paddle double-tap.

Instead, the “lastButton” attribute can be used to determine the number of taps. That attribute returns strings like “Tap ▼▼” (down paddle double tap) and “Tap ▲▲▲” (up paddle triple tap). Example test code:

Note that you may still need to test %value% for being equal to “on” or “off” for cases in which a dimmer is turned on/off by another rule.