Rule Machine - Get peer assistance here with setting up rules

Actually, that shows that it probably didn’t run. The good news is that it is scheduled for tomorrow.

Look at the Delay and Execution times for this morning. ST kills an app after 20 seconds, and this one ran for 43.792 seconds. That’s why you should move it to a few minutes earlier or later.

So I moved it to 6:55AM, went into the IDE, updated it and the new time shows, yet it still says the next schedule is tomorrow when in RM it’s set to only Sat/Sun. I have a different rule for M-F

Hmmm
Rick

So you’re saying that I should set my bulbs how I want them, let’s say at 11:57 PM. And then set a trigger for 11:58 PM that will capture the bulbs?

So if I turn on my bulbs how I want them at 11:57 PM, make 1158pm the trigger for capture?

I guess I don’t understand how I’m going to capture the settings. After I manually set my color hue and saturation, how do I go about capturing that?

I want this motion rule to only happen in night mode

What is your trigger going to be for capture and restore?

This is an example of how I set up mine for capture/Restore. It works wonderfully for me. I am using the Phillips white bulbs, I have not tried this on the color bulbs.

Yes, this can be done with only one rule.
I use multiple rules in my programming. I have found to achieve almost perfect stability and reliability this way. My only problems have been from the ST scheduler failing me.

Rule #1 - This one performs the capture and restore functions. It also uses private Boolean to turn on/off the second rule.

Rule #2 - This rule sets the bulbs to a desired setting after the capture has been performed. It is triggered by the action of the first rule changing the private Boolean.

I wanted to restore when Motion is detected during night mode. But I don’t know how to initially capture the settings of the lights. I could manually set the lights how I want them right now. But I don’t know how to save that or capture it. So that I can restore it during night with motion.

Does it matter if they cone on at the previous level? Or are you just wanting them to come on at some level with motion detection in night mode, stay on fire x minutes, and go off?

If you just want them on, try this.

Conditions:
Motion active, night mode
Rule:
Motion active AND in night mode
Action for true:
Turn on dimmers to X level, blue color
Actions for false:
Turn off switches pending cancel in X minutes

The bulbs are four lifx bulbs. I want them to come on different shades of blue when motion is detected at night. I don’t use any other rules for this motion sensor only this.

If you are wanting different colors of blue, you may need multiple rules. But what I wrote above will make them all the same shade of blue.

To do the capture/restore is going to be a complex one, I’ve almost got it worked out.

Well the bulbs be in the shades of blue you want then in when the mode changes to night?

No. They may be off for a different color. Thank you for your help with this I greatly appreciate it.

Hey no problem at all.

Let me make sure I understand fully.

1 - you have four lifx bulbs that are used at all times
2 - you have a motion sensor you are dedicating to this rule
3 - the bulbs are to turn blue when motion detected only in night mode

Questions:

  • will the bulbs be used in night mode? Or are they turned off when entering night mode?

  • if the bulbs are being used in night mode, and they are yellow, you want them to change to blue for x minutes when motion is detected?

  • do you want them to change back to yellow when motion stops? X minutes after motion stops?

I guess I could set up a virtual switch which would activate my lifx scene through IFT TT. I could turn that switch on at five minutes before night mode using IFT TT. As it stands now with my night mode, any lights that are on During night mode automatically turn off after 10 minutes. So if motion is detected anytime during the night after that, they would come on at the preset level from the previous IFT TT action.

This set of rules will only work in night mode AND when motion is active. It will capture the current state of the bulbs and keep them like that until a specified amount of time after motion stops.

After the specified amount of time, the bulbs will revert to their original state.

So, if they are yellow and you’re watching tv, motion goes active, they turn blue. When motion stops, they go back to yellow.

If it’s 2am and you’re in bed and the lights are off, when motion occurs they will turn on to blue. When motion stops they will turn off.

Again, this will only occur in night might, or whatever mode you choose.

Rule #1
Conditions - night mode, motion active
Rule - in night mode AND motion active
Actions for true - Capture bulbs, set private Boolean of Rule #2 to false
Actions for false - delay x minutes pending cancel, restore bulbs, set private Boolean of Rule #2 to true

Rule #2
Conditions - private Boolean false
Rule - private Boolean is false
Actions for true - set dimmers color to blue and to level
Actions for for false - leave blank

No need for a virtual switch, what I just posted will work the way you want it to.

@eric182

Let me know if you have any trouble with this.

Thanks! It’s working out great! Much appreciated------>Bruce and bamarayne

OK, so I deleted my Weekend Morning conditional trigger (the one that was set for Sat/Sun) that was scheduled to run again tomorrow (Monday) and recreated it. It clearly shows that it will run again tomorrow

Select Trigger Events: 7:00AM
Select Action: On Back Lights, Delayed Off: Back Lights: 60 Mins
Only on certain days of the week: Sat Sun

Does it mean the trigger will run at 7:00 tomorrow and since it’s not Sat/Sun nothing will happen? Starting to think that it’s right after all

What am I missing?

Rick

That’s correct. It will be triggered, check the mode, then quit.

For reliability, don’t use 7:00!! Use 6:57 or 7:03; it will be more reliable.

Thanks Bruce, I appreciate the reply

And yes, it’s now set to 6:55 :slightly_smiling:
Rick

I am wondering if Rule Machine has changed something in the area of time triggers.

I have had a rule for a long time that turns off a set of lights at 1AM every morning. For the past week or so it has stopped working. The issue is NOT caused by failed timed events. The rule simply does not fire anymore. The rule is so simple that it is baffling why it doesn’t work so maybe someone out there has a different way to do the same thing?
Screen shot of rule attached