How to set a specific time?


#1

1) Give a description of the problem
I am unclear on how to set a time when I want this piston to turn on a light bulb. On “What kind of Comparison” I don’t see a a option for “Is” so I can define a specific time.

2) What is the expected behavior?
From Monday - Thursday, I want the HUE light bulb in my daughters room to turn on at 6:10AM, color light blue, and power level at 4%. I have a single switch that powers the fan/light. The piston should check if the light switch is on and if it is on then it should turn on the bulb at that time, if it is off then it should turn the switch on and turn the light bulb on, set colors/power. Then turn off after 30 minutes.

3) What is happening/not happening?
I need help setting the time to test this piston. I think the code is right, but any advice is greatly appreciated to make this code more streamlined.


#2

I think this is how it should look, not tested at all.


#3

Sorry, I am new to Webcore. How did you have it say happens daily?


#4

Add an IF, for Condition instead of Phyiscal Device, select Virtual Device, from there select Time.


#5

I was thinking it would need to be a restriction and not a IF statement. Sorry, my second longest script and learning more each day. Thank you @eibyer!


#6

You can also add a new statement, and choose this:

temp

Which will display the options:

temp


#7

I tested it out this evening and it was able to kick on the light switch when it was off, but it didn’t set the correct brightness or color. Is there a trick to configuring HUE bulbs?


#8

You need to set HSL (hue, saturation, lightness) for color adjustments to HUE bulbs.


#9

To match a precise color, you are absolutely right @allrak
But if you’re OK with a generic color, this command works well with Hue bulbs:

temp


#10

How do you determine the HUE color and Saturation value?


#11

You can set your bulb to your favorite color using any method you like, and then run this small piston to capture the Hue, Saturation & Level of that bulb.


When you want to return to that precise color later, use this code:

temp


Side Note:
If you try to push the RGB color or colorTemperature, it will often fail to recreate the exact color.
(using only Hue, Saturation, and Levels seems to work best for me)


Figuring out HSL values for multicolor bulb