Ok, so I am looking at learning how to use RM - and I will be the first to admit my head is kinda assploding a bit - so if I am missing something obvious, dont feel bad laughing at me ...
(and I know I can look at the WebCoRE port to HE, but I would prefer to do this 'native' if I can ...)
I have a simple piston
If Front Door Motion becomes active OR Front Door Unlocks
and Mode is NIGHT
With Entrance and Porch Lights
Capture Current Switch State & Dimmer Level
Set Dimmer Level to 100%
Wait 3m or until Door Locks
Restore Previous States of Entrance and Porch Lights
For the record - if this matters Motion Detector in this case is a RING Doorbell Pro (still connected to ST and linked via HubLink (and sending data properly in the logs) Door Lock is a Schlage - again connected via HubLink and sending Locked/Unlocked properly. I did have to change the Driver to VIrtual Lock instead of Virtual Omnisensor but its showing correct actions in the logs Lights are via Lutron Caseta Pro (standard dimmers) and function correctly in HE)
I am having a hard time figuring out what type or RM to use (Rule, Trigger, Triggered Rule, Actions etc) and how to set this up in the IDE
I guess I am looking for samples to build from, an idiot's guide to RM, or some help building out this fairly simple (in my head coming from WebCore) process ... from which I can hopefully grok it and run with it
I struggled a lot with transitioning from webCore to RM as well. Hopefully one day we will have an RM For Dummies wiki but in the meantime this link might help get you started.
Thanks … working through this I see I can capture the state of a switch, but not a dimmer which is problematic for what I am trying to do …gonna have a bit of Balvenie and rethink this
I’m trying to have lights turn on when a motion sensor detects motion OR a contact sensor opens. The turn off only if the motion sensor doesn’t detect anything for a period of time.
Right you are sir! You have to make a simple rule that translates the contact sensor open/close to a virtual switch on/off action, and then you can define that virtual switch under additional options in Motion Lighting.
However, you can also just as easy (read: easier) create two Hubitat Simple Lighting rules with the Simple Lighting app. One for the motion sensor and one for the contact sensor.
I think you might need 2 rules for this...actually a rule and a triggered rule that then evaluates the rule.
Create a rule that turns the light on when there is motion and shuts off after 3 mins of inactivity (with a cancel on activity within the period...like below
And then a triggered rule that runs only when the contact is open....which also turns the light on (in case there is no motion as well)....but also forces an evaluation of the Rule above.
I think in every scenario I can think of that would work, except if you somehow were able to enter the bathroom without the motion sensor ever detecting you. Then the trigger would call on the rule and if it remained false, the light wouldn't activate. Which really begs the question, why do you need both because a properly placed motion sensor in the bathroom should always detect you.
Anyway, here's another way using a rule and motion lighting, which I believe should do what you want as well. I like motion lighting because of the extra options that are nicely presented, rather than having to work your mind into how to create the rule to do all those motion lighting and contact (switch) tasks.
The light would activate as soon as the door opened (as part of the trigger)...ie before it runs the action to evaluate the rule. Then if there is no motion, it will shut off after 3 minutes.