That'll work. You could even replace the "ELSE IF" with just "ELSE", because the second trigger (when time is 11:00 pm) will automatically go there since it doesn't meet the first condition.
Ok. Thanks
No, that won't work. I said you only needed to add the trigger. Your conditions were fine. This will never fire because the time is only exactly 11pm for 1ms. Go back to the way it was and add have the triggers be like you have in this version.
I have multiple rules setup that way and they work. It is 11:00 for 1 minute, not 1ms... It isn't looking for 11:00:00.000.
When you have the condition time is equal to, it won't work. The trigger can be an exact time but the condition most certainly cannot. I can pull up the posts from Bruce if you don't believe me.
Yes, it will. I have multiple setup that way. See below. This works, and always has in RM4 (at least on my hub anyway). Feel free to give it a try.
There have been many posts from Bruce advising against doing it this way since the rule is only good for that one minute. But hey, you can do whatever you want. I don't think that is the best way to do it if you want something on for a period of time and don't just want actions at two discrete times.
that is completely different than what you said above though. You said it wouldn't work and was only good for 1 millisecond. That is not the case.
whether it's the best way to do it or not is always a fine discussion though.
Not trying to be argumentative, just pointing out that simple time-based triggers (and conditions) indeed work fine on RM. You are absolutely correct that if the hub is unavailable at that time, the rule will not fire on hub reboot or recovery until the next time event. The missed event will be missed.
Thank you all for your responses and ideas. I will stick with 2 RM's for now. It would nice to see simple lighting adjust color.
Ryan780 - If you could find Bruce's post on timing that would be nice.
I can't right now. You're welcome to search for it yourself if you're that interested. Or you can message Bruce and ask him what he thinks is the best way to do it. But I can tell you....that method would not work for any other trigger except time. So, if you run the rule actions based on anything else, another rule or another trigger, it will not work the way you want. So, you choose what's the best way for you.
Bruce,
Can you Trigger at a certain time and run an action at the same time?
P.S. I know I need to replace the ELSE-IF with ELSE
You should not be turning the light on before you set the color temp. Setting the color temp will turn the light on unless it uses color and level prestaging. And in that case, you should turn it on second, not first. I know that 100% for sure.
Yes, you can do this. With respect to the Trigger Events, and how they interact with your Conditional Actions, this should work.
If it were me, I'd just use two rules, one for each trigger event, and not even mess with the Conditional Action at all. That's more rules, granted, but each would be more efficient that what you have here. In fact, I'd use Simple Lighting for the Turn Off at 11:00 PM. So there would be just one RM rule, the turn on one at Sunset-30.
I defer to @Ryan780 with respect to the Color Temperature setting, as I don't use those personally.
Hence my suggestion to use two rules with no conditions - each with a specific time as trigger.
I am not sure I would consider Sunset to 11:00 pm, one hell of a delay. LOL.
Definitely would be one hell of a delay to determine, as it would change slightly in length everyday. I like the two rules that Bruce said he would use. I have been reworking some of my rules to get rid of conditions and just have a trigger and an action, even if this results in two rules being created where before there was only one. I think its more efficient this way, especially when you can move one of the rules to simple lighting.
Actually, I just double checked and CT is not prestaged the same way colors are. In fact, enabling level pre-staging is bypassed when you issue a setCT/Level, even if you have Level Prestaging enabled. (I have a question out to Mike on a separate thread to confirm if those are intentional or not.) So, right now, you definitely do not need to have the on and the set Color Temp/level commands. If you were using a color here, you would want the on after the setColor.
Update: If you want to know how to prestage CT on bulbs that support it, you have to issue the CT separate from the level, unlike with RGB. See this post for details.
With color Hue bulbs I figured I needed to set CT and level to make sure the light was correct.
** Can I use Scene instead?
At Christmas I change the Hue color bulbs to red and green.
Thanks everyone..
You could use a scene if you wanted. My point was that setting the color temp and level is enough to turn on the light. You don't need the On command too. If you do the ON and the last color was red, it will come on red, then the next command will change to the correct color temp. To avoid the flash of red, just issue the CT/level command and take off the on.
Thank you Guys for all your assistance...
Many ways to do what you want to do. Here's another option with 1 rule, 1 trigger, and no conditions
Trigger:
When time is Sunset-30 minutes
Action:
Color Temperature: Garage light 1, Garage light 2, Porch light 6500: 100
Wait for events: When time is 11:00 PM CDT
Off: Garage light 1, Garage light 2, Porch light