Rule Machine question

I have a very dumb question. This below rule fires outside of the listed Modes if the motion sensor senses motion for more than 5 minutes. (also humidity is below 75%) . No other rules interfere with this device so this is the only rule supposed to control it.
any help appreciated.

I think it's the fact that you have manage conditions AND required expression,

I would move the conditions to required expression. (Someone please correct me if I'm wrong)

This is in Rule Machine, correct? Turn on all logging and post the logs from when it runs at the incorrect time.

This looks like Rule Machine .. what do you mean by defined expression? I'm not familiar with that in RM.

Sorry I meant required... fixed.

I think it is because you use a Stays that way trigger. Try the cancel pending action when it becomes false for the required expression.

Manage conditions shows any conditions used in the actions or conditional triggers. There is nothing unusual about having both required expressions and conditions showing in 'manage conditions'.

so yes its a rule machine rule and not sure how you mean to update it. I only want the vent to start if motion is active for 5 min. or you mean I should move this to required expression ? not sure if I can add an AND between two required expressions because it has to be TRUE only if its in specific mode and there's motion.

removed the required expression, let's see if it will work this way.

I wonder if any of you messed up this much for a simple extractor fan control muhaha....

also before I forget, THANK YOU for your suggestions.

Did the cancel pending actions not work?

Your required expression should not have allowed the rule to trigger except in the mode you specified. Since you used a and stays, however, if the motion triggered while in the required mode and keeps changing states even if the mode changes, essentially the rule has already triggered, and is waiting.

I was curious if setting the cancel pending actions would stop the wait and then it could not trigger again if not in correct mode. Not sure if that would work, but it's the only reason I could see that your rule did not work as originally shown.

Your current method, as you have already verified, will work fine though.

you're probably right. if its triggered, its just waiting. I get back to the original rule and keep this clone stopped for a while.
I have found the "cancel pending actlions". will try this way:

here's the json export of the original rule:

{"deviceReplacements":{"57":{"deviceName":"Ikea TRADFRI Control Outlet (#3)","deviceLabel":"Bathroom ExtractorFan (m)","deviceTypeName":"Ikea TRADFRI Control Outlet","deviceTypeNamespace":"hubitat"},"368":{"deviceName":"Aeon Multisensor 6","deviceLabel":"Bathroom-TH (m)","deviceTypeName":"Aeon Multisensor 6","deviceTypeNamespace":"hubitat"}},"appReplacements":{"670":{"appTypeName":"Rule-5.1","appTypeNamespace":"hubitat","appType":"sys","appName":"Rule-5.1","appLabel":"Bathroom ExtractorFan (m)","parentAppInstalledAppId":"257","parentAppTypeName":"Rule Machine","parentAppTypeNamespace":"hubitat","parentAppName":"Rule Machine","parentAppLabel":"Rule Machine","childApps":{},"singleInstance":false}},"appData":{"670":{"state":{"paused":false,"parens":{"0":0,"2":0,"4":0},"actionDone":true,"p.PB":"true","ndx":33,"dateFormat":"yyyy-MM-dd","nestedBlock":[false],"installedRules":[{"652":"Bathroom (m) - CheckMotion"},{"673":"Bathroom ExtractorFan (m) clone"},{"446":"Dehumidifier On (4AM)"},{"616":"Heating-Cost-Consumption-Reset"},{"530":"Heating-Off"},{"529":"Heating-On"},{"273":"Hubitat Bootup Cleanup"},{"289":"Kill Switch - OFF"},{"288":"Kill Switch - ON"},{"641":"Other-Devices-Consumption-Reset"},{"391":"Outlet #5 on-each-night (phone-chargers 3:00 AM for 3 hours)"},{"415":"Outlet #7 Dyson Charging - ON at  23:00 for 3 hours"},{"353":"Periodic refresh of all lights and outlets"},{"606":"PollHeating"},{"555":"Temp-Auto-Bedroom-Day"},{"557":"Temp-Auto-Bedroom-Night"},{"527":"Temp-Auto-LivingRoom-Day"},{"651":"Temp-Auto-LivingRoom-Day-OffIfNoMotion"},{"525":"Temp-Auto-LivingRoom-Night"},{"565":"Temp-Auto-Office-Day"},{"567":"Temp-Auto-Office-Night"},{"537":"Temp-Away"},{"272":"Toothbrush charging"},{"553":"heating-cost"},{"600":"historic-consumption-data"},{"639":"other devices cost"},{"649":"reset"}],"clonedName":"Bathroom ExtractorFan (m)","selectActionsParams":{"label":"Bathroom ExtractorFan (m)"},"editCondIf":null,"waitDone":{},"stopOnST":false,"usesTime":false,"nestedIf":[false],"SSecs12":0,"inIf":true,"trigCustoms":["motion"],"inUseTrigConds":[],"setDisabledActs":true,"hhmmss12":"0:05:00","capabDone":true,"skipping":true,"lastEvtName":"Bathroom-TH (m)","predCapabs":[17,"17"],"locationBlocked":[],"pbFixed":true,"inRepIf":null,"ruleNdx":5,"notEqual":true,"actionList":["4","7","1","2"],"firstR":{"0":false,"2":false,"4":false},"timeHandlersUpdated":true,"actLabelIndent":"","unUsed":["17"],"prevStateUpdated":true,"varSettingsUpdated":true,"certainTimes":[],"disabledActions":[],"hasWhileRule":false,"blockIf":false,"eval":{"0":[17],"2":[23,"AND",24],"4":[28,"OR",29]},"lastEvtText":"Bathroom-TH (m) motion is active","capabstrue":{"22":"Humidity of Bathroom-TH (m)(<span style='color:black'>73</span>) reports > 75","12":"Bathroom-TH (m) motion active and <b>stays</b> that way for: 0:05:00"},"nestedSkipAll":[false],"skipType":"if","lastEvtDate":"2024-04-04","parenLev":0,"unusedConds":[],"nestedInIf":[],"actions":{"1":{"wait":null,"delay":"0:15:00","modes":{},"method":"getDelay","indent":"","rule":null,"cond":0},"2":{"wait":null,"delay":"","modes":{},"method":"getOnOffSwitch","indent":"","rule":null,"cond":0},"4":{"wait":null,"delay":"","modes":{},"method":"getOnOffSwitch","indent":"","rule":null,"cond":0},"7":{"wait":null,"delay":"","modes":{},"method":"getIfThen","indent":"","rule":4,"cond":0}},"usesDate":false,"actNdx":8,"lastEvtValue":"active","installed":true,"waitEvents":[],"private":"true","waitNdx":{},"isPredicate":false,"SHours12":0,"copyL":[],"changedValues":true,"simpleCond":false,"nestedRepIf":[],"lastEvtTime":"19:50","condOper":"cond","nestedElse":[],"hasPredicate":true,"varTriggersFixed":true,"setCopyActs":true,"skipAll":false,"cutAction":[],"broken":false,"stopped":false,"wasRepeating":null,"rulesList":[],"hasPrev":[],"nestedLabel":[null],"oldInputAct":null,"stateVarsUpdated":true,"lastEvtDevId":"368","n":"12","waitCondNdx":3,"token":3,"SMins12":5,"capabsfalse":{"17":"Mode in [Day, Evening, Late Evening]","28":"Bathroom-TH (m) motion inactive","29":"Humidity of Bathroom-TH (m)(<span style='color:black'>70</span>) is < 75"},"stPrimed":true,"allLocalVars":{},"varSettingsOld":{},"timeFormat":"HH:mm","doActN":"N","olddValues":true,"inUseConds":["17","28","29"]},"appSettings":[{"deviceList":null,"multiple":false,"name":"condTrig.12","type":"enum","value":""},{"deviceList":null,"multiple":false,"name":"cut1","type":"button","value":""},{"deviceList":null,"multiple":false,"name":"istDev22","type":"bool","value":"false"},{"deviceList":null,"multiple":false,"name":"chkBox1","type":"button","value":""},{"deviceList":null,"multiple":false,"name":"I1","type":"button","value":""},{"deviceList":null,"multiple":false,"name":"copyAct","type":"button","value":""},{"deviceList":null,"multiple":false,"name":"chkBox2","type":"button","value":""},{"deviceList":null,"multiple":false,"name":"I2","type":"button","value":""},{"deviceList":null,"multiple":false,"name":"pausRule","type":"button","value":""},{"deviceList":null,"multiple":false,"name":"butEndIf","type":"button","value":""},{"deviceList":null,"multiple":false,"name":"actSubType.7","type":"enum","value":"getIfThen"},{"deviceList":null,"multiple":false,"name":"delayMinute.1","type":"number","value":"15"},{"deviceList":null,"multiple":false,"name":"chkBox4","type":"button","value":""},{"deviceList":null,"multiple":false,"name":"I4","type":"button","value":""},{"deviceList":null,"multiple":false,"name":"I5","type":"button","value":""},{"deviceList":null,"multiple":false,"name":"I7","type":"button","value":""},{"deviceList":null,"multiple":false,"name":"actSubType.1","type":"enum","value":"getDelay"},{"deviceList":null,"multiple":false,"name":"SSecs12","type":"number","value":"0"},{"deviceList":null,"multiple":false,"name":"actSubType.2","type":"enum","value":"getOnOffSwitch"},{"deviceList":null,"multiple":false,"name":"stays22","type":"bool","value":""},{"deviceList":null,"multiple":false,"name":"chkBox5","type":"button","value":""},{"deviceList":null,"multiple":false,"name":"actSubType.4","type":"enum","value":"getOnOffSwitch"},{"deviceList":null,"multiple":false,"name":"chkBox7","type":"button","value":""},{"deviceList":null,"multiple":false,"name":"butElse","type":"button","value":""},{"deviceList":null,"multiple":false,"name":"not29","type":"bool","value":""},{"deviceList":null,"multiple":false,"name":"not28","type":"bool","value":""},{"deviceList":null,"multiple":false,"name":"cut7","type":"button","value":""},{"deviceList":null,"multiple":false,"name":"cut4","type":"button","value":""},{"deviceList":null,"multiple":false,"name":"cut5","type":"button","value":""},{"deviceList":null,"multiple":false,"name":"cut2","type":"button","value":""},{"deviceList":null,"multiple":false,"name":"uVar.1","type":"bool","value":""},{"deviceList":null,"multiple":false,"name":"actType.1","type":"enum","value":"delayActs"},{"deviceList":null,"multiple":false,"name":"editToken","type":"button","value":""},{"deviceList":null,"multiple":false,"name":"state_28","type":"enum","value":"inactive"},{"deviceList":null,"multiple":false,"name":"state_29","type":"number","value":"75"},{"deviceList":null,"multiple":false,"name":"stopRule","type":"button","value":""},{"deviceList":null,"multiple":false,"name":"1.0.false","type":"button","value":""},{"deviceList":{"57":"Bathroom ExtractorFan (m)"},"multiple":true,"name":"onOffSwitch.2","type":"capability.switch","value":null},{"deviceList":null,"multiple":false,"name":"lvTable","type":"button","value":""},{"deviceList":{"57":"Bathroom ExtractorFan (m)"},"multiple":true,"name":"onOffSwitch.4","type":"capability.switch","value":null},{"deviceList":null,"multiple":false,"name":"insertToken3","type":"enum","value":""},{"deviceList":null,"multiple":false,"name":"insertToken2","type":"enum","value":""},{"deviceList":null,"multiple":false,"name":"1","type":"button","value":""},{"deviceList":null,"multiple":false,"name":"2","type":"button","value":""},{"deviceList":null,"multiple":false,"name":"4","type":"button","value":""},{"deviceList":null,"multiple":false,"name":"5","type":"button","value":""},{"deviceList":null,"multiple":false,"name":"7","type":"button","value":""},{"deviceList":null,"multiple":true,"name":"logging","type":"enum","value":null},{"deviceList":null,"multiple":false,"name":"actType.2","type":"enum","value":"switchActs"},{"deviceList":null,"multiple":false,"name":"delayAct.2","type":"enum","value":"none"},{"deviceList":null,"multiple":false,"name":"actType.4","type":"enum","value":"switchActs"},{"deviceList":null,"multiple":false,"name":"actType.7","type":"enum","value":"condActs"},{"deviceList":null,"multiple":false,"name":"delayAct.4","type":"enum","value":"none"},{"deviceList":null,"multiple":false,"name":"isVar_29","type":"bool","value":""},{"deviceList":null,"multiple":false,"name":"updateRule","type":"button","value":""},{"deviceList":null,"multiple":false,"name":"hasRule","type":"button","value":""},{"deviceList":null,"multiple":false,"name":"disableL","type":"button","value":""},{"deviceList":null,"multiple":false,"name":"runAction","type":"button","value":""},{"deviceList":null,"multiple":false,"name":"7.0.true","type":"button","value":""},{"deviceList":null,"multiple":false,"name":"rCapab_16","type":"enum","value":""},{"deviceList":null,"multiple":false,"name":"rCapab_17","type":"enum","value":"Mode"},{"deviceList":null,"multiple":false,"name":"randomAct.1","type":"bool","value":""},{"deviceList":null,"multiple":false,"name":"N","type":"button","value":""},{"deviceList":null,"multiple":false,"name":"SHours12","type":"number","value":"0"},{"deviceList":null,"multiple":false,"name":"rCapab_21","type":"enum","value":""},{"deviceList":null,"multiple":false,"name":"2.0.false","type":"button","value":""},{"deviceList":null,"multiple":false,"name":"pointless","type":"button","value":""},{"deviceList":null,"multiple":false,"name":"startVOffset2","type":"number","value":""},{"deviceList":null,"multiple":false,"name":"tstate22","type":"number","value":"75"},{"deviceList":null,"multiple":false,"name":"disable7","type":"button","value":""},{"deviceList":null,"multiple":false,"name":"disable4","type":"button","value":""},{"deviceList":null,"multiple":false,"name":"disable5","type":"button","value":""},{"deviceList":null,"multiple":false,"name":"rCapab_27","type":"enum","value":""},{"deviceList":null,"multiple":false,"name":"disable2","type":"button","value":""},{"deviceList":null,"multiple":false,"name":"rCapab_28","type":"enum","value":"Motion"},{"deviceList":null,"multiple":false,"name":"rCapab_29","type":"enum","value":"Humidity"},{"deviceList":null,"multiple":false,"name":"disable1","type":"button","value":""},{"deviceList":null,"multiple":false,"name":"SMins12","type":"number","value":"5"},{"deviceList":null,"multiple":false,"name":"range_10","type":"decimal","value":""},{"deviceList":null,"multiple":true,"name":"modes13","type":"enum","value":null},{"deviceList":null,"multiple":false,"name":"moreVar","type":"button","value":""},{"deviceList":null,"multiple":true,"name":"modes15","type":"enum","value":"[\\"1\\",\\"2\\",\\"68\\"]"},{"deviceList":null,"multiple":false,"name":"rCapab_32","type":"enum","value":""},{"deviceList":null,"multiple":true,"name":"modes17","type":"enum","value":"[\\"1\\",\\"2\\",\\"68\\"]"},{"deviceList":null,"multiple":false,"name":"cutX","type":"button","value":""},{"deviceList":null,"multiple":false,"name":"ReltDev22","type":"enum","value":">"},{"deviceList":null,"multiple":false,"name":"not17","type":"bool","value":""},{"deviceList":null,"multiple":false,"name":"startVOffset14","type":"number","value":""},{"deviceList":null,"multiple":false,"name":"tCapab2","type":"enum","value":""},{"deviceList":null,"multiple":false,"name":"isCondTrig.12","type":"bool","value":"false"},{"deviceList":null,"multiple":false,"name":"actionDone","type":"button","value":""},{"deviceList":null,"multiple":false,"name":"delayHour.1","type":"number","value":""},{"deviceList":null,"multiple":false,"name":"tCapab9","type":"enum","value":""},{"deviceList":null,"multiple":false,"name":"tstate12","type":"enum","value":"active"},{"deviceList":null,"multiple":false,"name":"trackSwitch.2","type":"bool","value":""},{"deviceList":null,"multiple":false,"name":"tCapab8","type":"enum","value":""},{"deviceList":null,"multiple":false,"name":"trackSwitch.4","type":"bool","value":""},{"deviceList":null,"multiple":false,"name":"useST","type":"bool","value":"true"},{"deviceList":null,"multiple":false,"name":"stopOnST","type":"bool","value":""},{"deviceList":{"368":"Bathroom-TH (m)"},"multiple":true,"name":"rDev_28","type":"capability.motionSensor","value":null},{"deviceList":{"368":"Bathroom-TH (m)"},"multiple":true,"name":"rDev_29","type":"capability.relativeHumidityMeasurement","value":null},{"deviceList":null,"multiple":false,"name":"doneST","type":"button","value":""},{"deviceList":null,"multiple":false,"name":"editPV","type":"button","value":""},{"deviceList":null,"multiple":false,"name":"istVar22","type":"bool","value":""},{"deviceList":null,"multiple":false,"name":"dValues","type":"bool","value":"true"},{"deviceList":null,"multiple":false,"name":"hasAll","type":"button","value":""},{"deviceList":null,"multiple":false,"name":"eraseTime2","type":"button","value":""},{"deviceList":null,"multiple":false,"name":"cancelCapab","type":"button","value":""},{"deviceList":null,"multiple":false,"name":"origLabel","type":"text","value":"Bathroom ExtractorFan (m)"},{"deviceList":null,"multiple":false,"name":"rCapab_11","type":"enum","value":""},{"deviceList":null,"multiple":false,"name":"eraseRule","type":"button","value":""},{"deviceList":null,"multiple":false,"name":"isCondTrig.33","type":"bool","value":""},{"deviceList":null,"multiple":false,"name":"5.0.true","type":"button","value":""},{"deviceList":null,"multiple":false,"name":"onOff.2","type":"bool","value":"false"},{"deviceList":null,"multiple":false,"name":"onOff.4","type":"bool","value":"true"},{"deviceList":null,"multiple":false,"name":"tCapab23","type":"enum","value":""},{"deviceList":null,"multiple":false,"name":"delete","type":"enum","value":""},{"deviceList":null,"multiple":false,"name":"copyL","type":"button","value":""},{"deviceList":null,"multiple":false,"name":"trashAll","type":"button","value":""},{"deviceList":null,"multiple":false,"name":"actionCancel","type":"button","value":""},{"deviceList":null,"multiple":false,"name":"delaySecond.1","type":"decimal","value":""},{"deviceList":null,"multiple":false,"name":"tCapab33","type":"enum","value":""},{"deviceList":null,"multiple":false,"name":"optSwitch.2","type":"bool","value":""},{"deviceList":null,"multiple":false,"name":"evalOnBoot","type":"bool","value":""},{"deviceList":null,"multiple":false,"name":"cancelAct.1","type":"bool","value":""},{"deviceList":null,"multiple":false,"name":"optSwitch.4","type":"bool","value":""},{"deviceList":{"368":"Bathroom-TH (m)"},"multiple":true,"name":"tDev22","type":"capability.relativeHumidityMeasurement","value":null},{"deviceList":null,"multiple":false,"name":"tCapab17","type":"enum","value":""},{"deviceList":null,"multiple":false,"name":"comments","type":"textarea","value":""},{"deviceList":null,"multiple":false,"name":"cancelBtn","type":"button","value":""},{"deviceList":null,"multiple":false,"name":"eraseTime","type":"button","value":""},{"deviceList":null,"multiple":false,"name":"tCapab13","type":"enum","value":""},{"deviceList":null,"multiple":false,"name":"tCapab12","type":"enum","value":"Motion"},{"deviceList":null,"multiple":false,"name":"editST","type":"button","value":""},{"deviceList":null,"multiple":false,"name":"isDev_29","type":"bool","value":"false"},{"deviceList":null,"multiple":false,"name":"doneToken","type":"button","value":""},{"deviceList":null,"multiple":false,"name":"rCapab_3","type":"enum","value":""},{"deviceList":null,"multiple":false,"name":"RelrDev_29","type":"enum","value":"<"},{"deviceList":null,"multiple":false,"name":"cancelST","type":"button","value":""},{"deviceList":null,"multiple":false,"name":"tCapab22","type":"enum","value":"Humidity"},{"deviceList":null,"multiple":true,"name":"deleteToken2","type":"enum","value":null},{"deviceList":null,"multiple":false,"name":"4.0.false","type":"button","value":""},{"deviceList":null,"multiple":false,"name":"editCond","type":"enum","value":"12"},{"deviceList":{"368":"Bathroom-TH (m)"},"multiple":true,"name":"tDev12","type":"capability.motionSensor","value":null},{"deviceList":null,"multiple":false,"name":"stays12","type":"bool","value":"true"}],"subscriptions":[{"handler":"stHandler","name":"mode","type":"LOCATION","typeId":1,"typeName":"eire","filter":"false"},{"handler":"allHandler","name":"humidity","type":"DEVICE","typeId":368,"typeName":"Bathroom-TH (m)","filter":"true"},{"handler":"allHandler","name":"motion","type":"DEVICE","typeId":368,"typeName":"Bathroom-TH (m)","filter":"true"}]}}}```