Revert to original state once complete?


#21

This concept works great for a single bulb…


#22

@WCmore

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?


#23

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


#24

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


#25

Happy to be able to help!


#26

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?


#27

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.

temp

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


(Edited picture)


#28

@WCmore
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?


#29

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


#30

@WCmore
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…
ZLL RGBW Bulb

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


#31

I am using the default DH, which happens to be

temp

with my Hue bulbs… but feel free to experiment.


#32

@WCmore

Thanks.
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:


#33

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


#34

@WCmore

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
#35

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…


#36

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


#37

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?


#38

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:

temp


When the bulb is ON, I get this:

temp


When the bulb is OFF, I get this:

temp


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

WebCore expression problem
#39

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


Issues with grabbing color of two RGB light strip