I am having no luck with the logic and interface for rule machine, i am attemoting to achieve the following:
Play text to speech on sonos device 1 if
motion sensor 1 is active
and
motion sensor 2 and 3 have been inactive for at least 15 mins
and
weather wind speed is =<10
how to do this in the not so logic rule machine interface?
Hmmm... A couple of things may help with this:
- A screenshot of your existing rule
- An explanation of the rule you are trying to construct, separate to the triggers and actions configured in RM
If I was to take a guess at what you want/need it would be:
Required Expression:
Motion Sensor 2 and 3 have been inactive for >= 15 minutes
Wind Speed <= 10
Trigger:
Motion Sensor 1 becomes active
Actions:
Play Text To Speech on Sonos Device 1
In situations like this it is still useful to talk through what you want, you'd be surprised what it can reveal.
That sounds logic but not so easy in the non logic interface. When I add the motion sensor 2 and 3 inactive there is not option to choose the 15mins period (see screenshot)
Good point, my bad...
You will need to split this into two rules...
One to detect the inactivity and trigger a switch / button, and a second that checks for this.
Seems a bit lacking in a rules engine if I can’t do a couple and with a time value and need to add a virtual switch?
I could make an educated guess / explanation.... Well, why not.... This is definitely subject to any correction by... well Bruce...
A "Required Expression" is a logical check that the rule keeps tabs on as to whether it can trigger or not. Once the expression becomes true, the rule can be triggered. This (and I'm probably going to be wrong in some way by saying this) does not include time-based conditions, e.g. this is true for X minutes.
Triggers, by contrast, are event driven. Motion becomes active, a switch turns on, etc. Once the event happens, the ability to introduce a time-based element can be achieved (I expect) by waiting X minutes until the rule is triggered, unless other events or criteria are met that cause the X minutes part to become null and void.
I can't make a consistent or coherent explanation beyond this for why this is the way it is, nor am I an expert.... If you want to drill into it some more, I would suggest a new topic, hopefully with more knowledgeable people than me contributing.
What if you select multiple sensors for the inactive period, does it let you stipulate the inactive period still?
Using that logic I should be able to create a required expression with multiple sensor and specify they should be inactive for 15 mins before the trigger can be active aged but I can not seem to do this.
Rigpappa (developer from Vera ) had the most easiest and powerful rules engine (Reactor) in Vera, worth taking a look at his work and easy to use logic
That's what I was meaning by Required Expressions do not include time-based options. But I am likely out of my depth and should leave this discussion for others, and likely another topic than this... In particular when comparing RM to other platforms, that is definitely a conversation outside of the OP's question.
I have about 15 similar rule requirements that use different sensor combinations, does this mean I will need 15 seperate virtual switch’s ?
Feels like it needs a separate conversation... Hopefully it doesn't mean you need these options for your circumstances, but it will need more analysis to find out.
Yes. Just use an "or" in the condition
Yeah, a new topic... or use and OR statement... ![]()
Might you be able to show a screenshot with the correct statement please?
So far i have the below rule but it shows as all conditions are "unused" i assume that i have missed linking or something ?
Having conditions in the Manage Conditions section does not mean they take effect. You need to include them in a conditional action or something similar for them to be used. What are you wanting them to do within the rule? Limit when it runs?
Then you will need to include a conditional action at the beginning of the Actions section that uses the conditions, which will limit when the TTS message is played.




