Hello, I'm trying to start my migration from ST to HE, I have most webcore rules based on a template I found, I think it was from the webcore forum, and I want to make the same function with rule machine but I'm totally lost. I need help creating the rule. I'm not a programmer so that's why it's very difficult to understand rule machine for me.
If I understand, what you want to happen is to turn on the Hallway Light when motion is active, turn it off 5 minutes after motion stops, but only between sunset and sunrise. Correct?
If so, this is the rule you need:
Conditions: Hallway Motion active
Rule: Hallway Motion active (filled in automatically)
Action for True: Turn on Hallway Light
Action for False: Turn off Hallway Light after delay of 5 minutes cancellable
Restrictions: Only between sunset and sunrise
This could also be done with a Hubitat Simple Lighting rule, which might be easier to understand:
Select Hallway Light, and that you want to turn it on. How to trigger it, with motion; select the Hallway Motion sensor. It will ask if you want to turn if off when motions stops, answer yes, then it will give you a chance to enter 5 minutes. Put the "between sunset and sunrise" in a Restriction at the bottom.
I believe the use of that programmatic variable in webcore is meant to restrict the 2nd if statement so that it only proceeds if motion is what triggered the switch to turn on in the first place.
Thanks for your answer, in addition I believe (I'm not a programmer) that the boolean part of the piston is for: if the light was already turned on manually in the switch it will not turn off with the motion after 5 minutes, how I get this added to the rule?
It's this. for some reason i didn't notice the "cancellable" when i read through bruce's response initially.
But in RM this is accomplishing the same thing you're looking for.
You don't want the lights to turn off if someone's still moving around.
With the use of the off pending cancellation action, any time motion is detected again, that five minute timer gets reset.
It's a different way to accomplish the same thing your piston did with fewer steps.
Ok, I have the same piston for the front porch, but if I turn on the light manually without the boolean part of the piston if I trigger the motion, then the light will turn off after 5 minutes, if it was manually turned on I want it to stay on, the rule will work this way without the boolean part?
Well, if the motion sensor that controls the light is triggered at least once every five minutes, then yes the lights will stay on.
Edit: if you turned your light on without moving in front of the motion sensor, like on a porch with a switch inside I guess, then the lights shouldn't turn off automatically.
I see, I will try it, in ST it will turn off, after I added the boolean piston then it stayed on after the 5 minutes of the motion trigger if the light was manually turned on with the switch inside. Thanks
It looks to me (ignorant of WebCore), that WebCore made very complex something that's very simple in Hubitat with either Rule Machine or Simple Lighting.
I made a simpler version of the webcore piston that performs the same as the rule you created above:
It looks like the piston with the boolean wants it to turn off when inactive and it was the motion that turned it on, and not the user ( handled with the introduction of the programmatic variable ) .
I created the rule you described above in rule machine, and it looks like it turns off when inactive even when turned on manually. Is there something else that can be added to prevent it from turning off when the user turned it on themselves?
You can do this with Motion Lighting. It will do the motion activated on with timed off, and has an option (under Off Options) to not turn off if already on. It also has the time restriction you seek under On Options.
I think the difficult part is physical vs digital control. Depending how many hops your switch is from the hub. Possible the hub doesn't know you turn on the switch physically or digitally.
In this case. You have to use a virtual switch? @bravenel
nice to see one of my example pistons on the wC forum show up here on the HE forum.
this one was for use with a dumb bulb controlled by a smart switch or a direct wired smart bulb.
just nostalgic … ignore me and carry on.
Interesting, I did the test, but when the dumb light was turned on manually with the smart switch and motion was triggered it turns off after 5 minutes. Now, you mention the motion lighting will solve this but, I want to use this with Ring motion too, I already linked Ring and HE to IFTTT, I created a virtual switch that turns off after one second, I got Ring motion and the light turns on on HE but if it was already on(because my wife turned it on to go outside to add water to the plants) then the motion will add the 5 minutes to turn off and eventually it turns off if the person is far from the motion( and my wife will kill me). How can I avoid this not using motion lighting? (Motion Lighting just let you choose motion sensors)
Thank you very much for your answers, this will help me with wife's approval....
Answering my own question, I got it to work, I don't know if I did not understood your instructions but I got it working, here is what I did:
Thank you!!!!!
What are you using to turn on the virtual switch?
Your ring doorbell? In your office room?
Yes, with IFTTT Ring turns on the virtual switch( it will turn off automatically after 1 second, this setting is on HE virtual switch) then Rule Machine does the rest of the magic, it's working great. This is a test, the final will be the front porch, I just have one light in HE doing all the test first then I will do the migration.
I'm just trying to picture your office room with a video doorbell in it being used as a motion sensor .
glad to hear it's working the way you need it to.
Just so you know... The Ring to IFTTT to Hubitat events can take up to 30 seconds to be registered. This is not a Hubitat problem. The delay is caused by the Ring to IFTTT integration. Because of this lag, I left my Ring doorbell on SmartThings and use Hubitat's Hublink integration to automagically create and update a virtual motion device on Hubitat. The result is almost instantaneous.
If/when Hubitat adds a native integration for Ring, then I can probably finally turn off my ST Hub.