So, I built two rules in rule machine:
-
The first rule will arm my Blink cameras if both my wife and I leave our geofence (represented by the presence switches which are switched on/off using Alexa geofencing)
-
The second rule will disarm my Blink cameras if EITHER my wife or I enter the geofence. I've included a screenshot below. This rule is the one that seems to have an issue.
Here is what happened. The wife is at her office and her presence switch is correctly set to OFF. I am at home and mine is set to ON. I left at lunch to run an errand and the first rule above ran and correctly armed the cameras. When I came home, my presence was set to on but the cameras were NOT disarmed. When I run the actions manually, it does correctly disarm the cameras.
Is there anything wrong with my rule or was this just a glitch?
I think the problem is using the same condition for the trigger and predicate. The condition will not trigger until one of the presence sensors is on. That is also the trigger, so technically at the moment your presence sensor went on the predicate was false, it might work but it seems problematic.
You might be right. I think I'll just go ahead and do it in webcore since it will take me about 5 seconds.
Says who?
As noted above the required expression must be true at the moment of triggering, otherwise the trigger event does not matter. It's not inherently wrong to use the same device in both a trigger and a required expression; in fact, that's one of the use cases it was created for (capturing a specifc state change involving the same device/condition without having to track and compare the previous value in your actions, for example). But if that isn't your use, it does deserve scrutiny. I also suspect that's what's happening here.
In your case, according to what you described you want, it seems like you could just trigger on either of the presence sensors becoming present--no need for a requred expression at all.
1 Like
The logic isn't the issue - it's figuring out how to put it in Rule Machine because the UI, frankly, is terrible. I think I figured it out and will test tomorrow when the wife leaves for work.
I guess I was going with the assumption above that you had/wanted two rules, and in that case, I would use a "Presence Switch 1, Presence Switch 2 any arrives" trigger rather than a "changed" trigger for this rule. Then you don't need conditionals in your actions to figure things out--you can just turn the other switch off.
But...if you want it all in one rule (sometimes an unhealthy obsession people have, but in your case I'd say it makes total sense), you can actually do it exactly how you have it above. Now you don't need to worry about the first rule (which I don't think we've seen, so just going by your description here), as this one would do both. To be fully syntactically correct, I'd just add an END-IF
as your last "action," but since you don't have anything after it, RM will infer it just fine.
In other words, I'd say you have it figured out now and can ignore most of what I wrote above.