My initial thought--which I'm leaving here because I guarantee someone is going to come along later and say this is impossible--was: I'm not sure how you'd actually set that up. Variables in Rule Machine cannot point to devices, only one of the pre-defined data types (String, number, boolean, etc.). I have seen a request for something along these lines--the ability to set a variable to a device or check if the triggering device is a specific one. At the moment, you'd have a hard time doing that.
Then it occurred to me: %device% is, it appears, a string variable that contains the name of a device. If you don't have collisions in the device display name space (this is the device label if one is set, otherwise it's the device name), trust yourself not to make any typos, want to make things really hard by needing to type names in the first place instead of just picking devices, and don't mind a bit of awkwardness, I tested something like this and it does, indeed, work:
(This logs "Hey, it was switch 1!" any time the "TEST Switch 1" device gets turned on or off; it logs the other string for switch 2. Proof:
)
As you can imagine, this is likely to become unwieldy (and a maintenance nightmare) for large numbers of devices. I also had to use a "proxy" variable, strNameTemp, for %device% because RM does not allow you to create conditionals with arbitrary/predefined variable names, just ones you've defined. I would strongly recommend an app dedicated to this purpose instead. However, if you want to try, I guess this at least serves as a proof of concept that you could. 
