Short (multi) & hold press to turn on/off/dim items (JSScripting)

This would be much easier for end users to find, install, and use if it were published as a rule template on the marketplace. That would let the avoid the need to create the rule, triggers and actions manually. It’s already a UI rule so you are most of the way there already. Your constants at the top can be parameters the user fills out when instantiating the rule from a tempalte.

See How to write a rule template for a tutorial, check out the examples on the marketplace, or ask here if you run into trouble.

Beyond that, I’d recommend using the private cache as opposed to the shared cache. I can’t imagine where some other rule would care bout these variables. The private cache is specific to this one script so there is no chance some other rule will pop up and overwrite your variables.

2 Likes