Simple repeat color loop with three colors


#1

1) Give a description of the problem
Can’t understand how to get repeat to work in a piston.

2) What is the expected behavior?
Hue Outdoor strip will do a color loop, when a virtual switch turns on, with the colors blue, red and green and continue loop this three colors with a 5 seconds interval until the virtual switch is turned off.

3) What is happening/not happening?
I’m trying to understand Webcore but it is to difficult for me to wrap my head around therefor this reach out.

This seems like a super simple task to do in Webcore but I cant get the repeat functionality to work, can someone do a webcore piston as described above and share the backup code for me to try.

Happy holidays,
//arcspin


#2

I don’t have hue lights so I am hesitant mock-up something that might not work.

The general premise would be to use a repeat loop (make sure you you have advanced statements selected under options so that it is visible).

IF virtual switch changes to ON
THEN
DO *(the remainder is the repeat loop)*
REPEAT
	with lights
		set color to blue
		wait 5 seconds
		set color to red
		wait 5 seconds
		set color to green
		wait 5 seconds
	UNTIL
		virtual switch is OFF

#3

Yes, this is what I trying but it will not work.


#4

Got it.
This Piston works…


#5

Nope, something is wrong.
The dimmer shifts from 25% for green, 50% for blue and 100% for red and then starts over, even though I have set the dimmer to 100%.

This addon does not fix the problem…


#6

Why does Philips Hue outdoor light strip shift the dimmer when colors are changing.

This is what i have to do to get the colors to shine with 100% brightness.
This can be right that I have to do this!?!?!?


#7

Not sure if it will make a difference but have you tested using hex# or even HSL to set the color instead of the presets.


#8

Thanx for the reply and Good thought but the same result.

I’m starting to think this is the Philips Hue light strip that is acting up.

I’ll try some more in the morning


#9

Basically, each color has a level (intensity) associated with it…

So, if you change the color to Red, and then increase the level, then the new color is no longer considered Red. (although it may look Reddish to our eyes)


Pro Tip:

I you send HSL (Hue, Saturation, Level) commands, then you can directly force 100% level, and the end results can be reddish.


#10

Great tip,
This works as intended!

Thank you so much for the help!


#11

Glad you got it working. :grin:

IMO, I think the solution2 should go to @fieldsjm, since he best answered your original question.


#12

Quick follow up on some advice I need.

The color loop do work, but I want to have the piston turn on the RGB bulb 1 and then start the color loop and when the switch 4 is turn of the RGB bulb 1 would also turn off.

To have the RGB bulb 1 to turn on within the repeat set doesn’t feel right and I cant get the switch 4 to also turn of the RGB bulb 1 when the switch is turned off.

Can someone please advise or based on my piston correct it to my desired wish.

Best regards,


#13

This is harmless. WebCoRE is smart enough to not send a “Turn on” command to a device that is already on. (although you could always place it right before the loop, if you want)


You can add a new block underneath the loop to WAIT a couple of sec, and then Turn off Bulb 1.
(or reset color and then Turn off)

Alternatively, you could place the Turn off command inside the ELSE block.
(which will execute whenever Switch4 turns off)


#14

Great,
Something like this works for me.

I do however not understand how to get a “then” & “do” inserted before the “repeat”
My thinking is to have the virtual switch first turn on the RGB bulb 1 and the start the “repeat” process.
I understand that that is not necessary but it will be a good practice for me to better understand webCore pistons.


#15

You can click on “Add a new statement” nearby… and then:
Add an action > Devices: RGB Bulb 1 > Add a Task > Command: Turn on > Add

After the mini-block is created (in the wrong spot), you can drag and drop the block directly above (before) the “repeat”.


Pro Tip:

Alternatively, you can drag & copy your final block (41-45) to that same spot, and then just change off to on.


#16

Thanx a bunch,
That was easy ;o)

Cheers and have a great weekend,

//arcspin