Advice on multiple timers / light switches

  • Platform information:
    • Hardware: Debian 10, 64 bits, 4 Gb RAM, old Acer small factor desktop
    • Java Runtime Environment: OpenJDK 11.0.5
    • openHAB version: 2.5
  • Issue of the topic: please be detailed explaining your issue
    Hi Happy New Year 2020!
    I’m just looking for example code of rules to use multiple timers but without declaring each of them as a separate variable. I have some infrared z-wave devices, and z-wave light switches, and when the infrared sensors get triggered, turn on the light for a specific time.
    The issue is that I don’t want to rewrite the code for each light, and I was successful with most of it, except the part of the timers. How do you maintain multiple timers? Do you use an array?
    Thank you for your help / guide / pointer

See Rich’s design pattern
A “Map” in DSL rules can be used a sort of “array” holding multiple timers.