I'm trying to turn a plug on if there is motion then turn off after 45 mins if motion is inactive however the plug stays on if motion keeps being detected. Unsure where i'm going wrong. I currently have this:
Trigger
Front Room Sensor changed
code
IF (Front Room Sensor active(T) [TRUE]) THEN
Cancel Delayed Actions
On: Sonos System --> delayed: 0:45:00 (cancelable)
ELSE
Off: Sonos System
END-IF
I was going to use the simple lighting however i'm trying to make it part of a larger rule where i can turn a virtual button on/off which would allow the rule to be on auto or manual override
Looks like you've got this rule sorted out above. Hooray for the community!
You may be interested to know that there is an example exactly like what you want in the Rule 4.0 docs, which I'd recommend reading. Too late to save you some time here, but maybe for the rest of this rule or the next one, you'll discover something helpful.
For all your future documentation desires: the "?" icon in the upper right of any app that has one (which should include all the native ones) will take you to docs for that app:
(For RM that will technically take you to the docs Wiki, not the forum thread I linked to above, but the wiki page was created from that post, and I find the post with inline screenshots easier to follow.) In 2.1.9, you'll also see a new video link next to that, which in this case will take you to an RM video on Hubitat's YouTube channel (but there are more if you just go to their channel).
The docs.hubitat.com site is also good (and where most of these will take you), also accessible from the "Documentation" link on the main page in the admin UI and the footer of every page.