Get devices which are switched on


#1

Is it possible to get the names of devices which are switched on, and then perform some action on these, for example change the dim level?


#2

Yes, here’s a rough example…


#3

Exactly what I was looking for, thank you very much!


#4

A slightly related question - what’s the best way to take the attributes of each of those devices and save to current state (in order to be restored later)?


#5

I haven’t done it myself but first thing that comes to mind is doing it with some kind of list.


#6

I have a piston like so, but not sure if this is the proper way to do it:


#7

Hmm let me modify the one I posted above and see if it works. I’m not at home to play with lights at the moment :wink:

Edit:
I just changed the Log tas to Capture state… If you try this, you’ll have to add the Restore logic.