Revert to original state once complete?


This concept works great for a single bulb…



Thanks! :slight_smile:
So, are these the only things I need to modify in order to use it?

  1. the bulb/device being used
  2. what I want it to do between Capture and Restore

…or do I need to do something with the variables or anything else?

Also, I see this in a lot of Pistons (including this one)…

/* */

…usually with a number in it.
What is it for, and do I need to do anything there with this one?

UPDATE: Actually, I just tried it, and it worked. So, thanks!
I think I may be able to poke around a little bit and figure out how this works, but for now, I at least have something I can duplicate elsewhere if I want to.

Something else… when it Restores, it turns it ON, even if it was off prior to the Capture.
Is there any way of getting it to Restore without turning it on, or do I basically need to tell it to turn it back off after a Restore?


Yes, when you import ‘dxyx’ it will ask you which bulb. Just point it to the bulb you want. You can customize the 2nd block for any fancy light show etc. No need to touch the variables here.

/* This is a comment */

In the ‘define’ section up top, those symbols show the previous variable captured.
In the rest of the code, those symbols symbolize a comment. Often added to help keep track of the code, but that comment is not acted on by webCoRE.

You can capture the switch state the same way as the hue, or simply add a line to turn off the bulb


Sweet! Thanks a lot for all of your assistance.
Now…where is your donate link? :slight_smile:


Happy to be able to help!


Dude! I got it! lol
I finally got around to playing with that piston you posted, and I got it all working how I need it for one of my Hue Iris lights. So, thanks again. :slight_smile:

One more Q…
The way it is now, this piston only works for a single Hue Iris light.
In my current case, I am trying to do this for a number of Iris lights.

Is there a way of reconfiguring this to handle multiple lights within the same lines of code, or will I basically have to duplicate everything for each light that I want to do this with?


That piston is really designed for a single bulb, but if you have a group of lights (all using the same color) you can add many bulbs to the “Set color to HSL” block.


(but still only saving one of them to the variables)

(Edited picture)


Awesome! Thanks.

Now though…my earlier excitement was premature…

I thought it was all working, but for some reason, even though some restoration is happening (i.e. it is now indeed turning them back off at the end), it’s still not restoring them to the previous color; instead, it’s just leaving them at the color that was last used in the intervening automation, between the Capture and Restore operations.

So, is this just something about these ‘Friends of Hue’ lights that doesn’t work with the same set of commands as what works with the regular Hue lights, or what?


Make sure there is a slight pause (Wait) after your fancy lighting effects and before the restore.
(we want the lights to ‘settle down’ before restoring)

If that doesn’t help, we’d need to see your latest piston


Indeed, there is. At this point, I’m still only using the example piston that you posted, but just with my modifications for my stuff, plus the switch state.

So, there is already a 500ms wait immediately after the ‘do something’ segment (which I left just as you made it).

All I’m doing to run it is clicking ‘Test’.

I wonder if perhaps I need to revisit Device Handlers. I recall there being somewhat of an adventure getting these things working properly when I first got them 2-3 years ago, and it wasn’t as easy as just popping them in and using whatever DH they got by default.

I just checked, and as of now, they’re using the following DH…

Does that seem right for a ‘Friends of Hue’ Iris Light from Philips?


I am using the default DH, which happens to be


with my Hue bulbs… but feel free to experiment.



Well, no dice. I tried every possible DH I could find in the built-in stuff, as well as others on the forum, but the one I’m using is the only one that actually works…at all.

Bummer, because I’d really like to be able to control these things more than I’ve been able to this whole time.
Oh well. Some day I will be able to afford to replace them all with colored lights that actually work. For now though, I will just go on as I’ve been doing.

Thanks again for all of your assistance with this project! :slight_smile:


Yea, without seeing your piston, I cannot add any more to this either…



Here ya go…

NOTE: The only part that is working (with regard to Capture/Restore) is the part I added (the switch state) to what you posted. That is what makes me think perhaps these other commands just don’t work with the ‘Friends of Hue’ Iris lights that I have.

Trying to Make Phillips Hue Bulbs Blink and Return to Original State

You may be right. I have never seen a color bulb that did not accept the HSL command. I wonder if there is a new updated device handler out there you could use…


Ya, I’ve looked extensively.
Now I’m looking exhaustively. :slight_smile:


I just tested this and it does not work like it is suppose to work :frowning:
For me it seems that switch state is always “0” even if bulb has been on before piston runs.

Everything else works but switch state problem makes it unusable in my case.

Can anyone help?


Yes, this is true when using an integer. (I usually use a STRING instead)

Here is a quick example of the same switch being written to a integer, a string and a boolean variable:


When the bulb is ON, I get this:


When the bulb is OFF, I get this:


In this case:

  • a string is easiest to work with…
  • a boolean can work if you add extra code
  • an integer won’t be helpful here at all


The only way I could get the capture attributes to work was to use the following- color, colorTemperature, level, and switch.
note- I’m using Sylvania lightify smart+ A19 RGBW bulbs