Resume state for multiple switches?

Ive to set up an app that on a trigger will turn several switches on for X amount of minutes then turn them off. Now i’m trying to improve upon it by collecting the state of the switch before hand and then return it to the same state after my Trigger → turn on for X minutes.

For example my Lamp is on but the Hallway light is off. The Trigger happens and both lights are set to on and then both turn off after 5 minutes. ideally I’d like the Lamp to remain on while the Hallway light turns off.

Right now I’m defining the switches by

input “switcheson”, “capability.switch”, title: “Turn on these switches”, multiple: true, required: false

turning them on by

switcheson?.on()

and off by

switcheson?.on()

I know that i can poll and store the states with

switcheson?.poll()
state.switchVal = switcheson?.currentSwitch

After that I’m clueless

Then I’m really clueless on doing the same for Hue lights.

1 Like