Catching repeated identical commands to activate a rule

I’m very new to OpenHAB2 and was wondering how to set about writing a rule for a dimmer. I’m using many KR22E keyfobs in the house mounted on the walls. They have 4 ON and 4 OFF buttons which send commands via RFXCom which are A1 ON A1 OFF, A2 ON A2 OFF etc. I’ve been able to use these to successfully turn both PLCBus and Z-Wave lights on and off.
The issue is with the dimmer function. At the bottom of the KeyFob are two other buttons Bright and Dim. They send A0 On and A0 Off commands. In the PLCBus world the system remembers which A1 to A4 button was last pressed and when the Bright button is pressed it sends a percentage brighter signal to A1 to A4 as required.
How do I implement this in OpenHAB2. It seems that I need a global variable that stores the last A1 to A4 On button to be pressed and then for each Bright or Dim received command it then brightens or dims the stored addresses light. The main problem is repeated presses of the Bright button, which is received as A0 ON and how to catch each one. As the state is not changed from OFF to ON but just has repeated ON commands the Changed function does not work. So how do I catch repeated ON (or OFF for dimming) commands ?

Use when item received update ON and yes you can use global variables to track (eventually count) subsequent ONs

If you just want to dim a light, use a rule with the trigger @mstormi wrote, and then send an INCREASE-command to the light you want to dim. Then you do the same for OFF and DECREASE.

Thanks. That’s just the info I was after.
I’m finding the documentation for OpenHAB comprehensive but for a newbie a bit opaque at times! I think that once I’ve written a few rules successfully then it will all start to make more sense.