Need help figuring out how to delay a reset on reaction
-
Good afternoon all,
I believe I’m having an issue with my logic for setting my home modes in MSR, partially based upon Phone modes in Home Assistant. Users in my family have the Home Assistant companion app installed on their phone, and it geofences the users, so once they are within my home circle geographically, it sets a Boolean to home mode. If they are out it it’s away. I also have a couple of other modes, which I struggle to activate, and it causes issues when I have guests, or pet sitters that come over that do no have the companion app.I have a guest mode that has to be manually set in Home Assistant, that disables the Away mode automation (based on the companion app statuses), until either a user with the companion app arrives home, or a guest arms the alarm system (away arm).
My issue is that I seem to unable to set the system into Guest mode from Home Assistant, because MSR keeps trying to arm the system. I think that I need to have some sort of a delay for the Reset reaction.
In the rules below, each of the users has a separate reaction that evaluates the state of the iPhone. This rule is a giant OR rule that evaluates the state off all them to decide the mode of the house.
Appologizes for the formatting. I’m away from home and doing this on my iPad, so my screenshots can’t display the full rule.
As you can see in the Rule history, it was rapidly resetting every time I tried to put the house into guest mode around 18:00 yesterday. I was on a plane and my mother-in-law arrived to take care of our pets, and I had to log in on my phone to my server and disable MSR to stop the automation in the house completely.
Any suggestions on how I can handle this flapping?
I have another set of rules for users that don’t have the companion app, but is rather based on the user ID for the alarm system and put the house into Guest mode, but I’ve never been able to get this to work completely. It exhibits the same behavior of trying to arm the system immediately.
The only reliable way for me to set the house into Guest mode is to be in at home mode first, then switch to guest mode. I believe this is all linked to this rule in question.
I appreciate the long read and any advice.
-
Good afternoon all,
I believe I’m having an issue with my logic for setting my home modes in MSR, partially based upon Phone modes in Home Assistant. Users in my family have the Home Assistant companion app installed on their phone, and it geofences the users, so once they are within my home circle geographically, it sets a Boolean to home mode. If they are out it it’s away. I also have a couple of other modes, which I struggle to activate, and it causes issues when I have guests, or pet sitters that come over that do no have the companion app.I have a guest mode that has to be manually set in Home Assistant, that disables the Away mode automation (based on the companion app statuses), until either a user with the companion app arrives home, or a guest arms the alarm system (away arm).
My issue is that I seem to unable to set the system into Guest mode from Home Assistant, because MSR keeps trying to arm the system. I think that I need to have some sort of a delay for the Reset reaction.
In the rules below, each of the users has a separate reaction that evaluates the state of the iPhone. This rule is a giant OR rule that evaluates the state off all them to decide the mode of the house.
Appologizes for the formatting. I’m away from home and doing this on my iPad, so my screenshots can’t display the full rule.
As you can see in the Rule history, it was rapidly resetting every time I tried to put the house into guest mode around 18:00 yesterday. I was on a plane and my mother-in-law arrived to take care of our pets, and I had to log in on my phone to my server and disable MSR to stop the automation in the house completely.
Any suggestions on how I can handle this flapping?
I have another set of rules for users that don’t have the companion app, but is rather based on the user ID for the alarm system and put the house into Guest mode, but I’ve never been able to get this to work completely. It exhibits the same behavior of trying to arm the system immediately.
The only reliable way for me to set the house into Guest mode is to be in at home mode first, then switch to guest mode. I believe this is all linked to this rule in question.
I appreciate the long read and any advice.
@tamorgen Your conditions for each inhabitant are collapsed. What's in those?
I do a TON based on presence so if you can show all your work I can dig in a bit.
Edit: gonna assume all of the other inhabitants are like Tim. Your current rule says "If
Tim=home
ORJen=home
ORmom=home
ORNana=home
ORJoshua = home
ORmode=Guest
then".... nothing. You have nothing indicated for it to do.Set Reaction
is empty.But then you have a
Reset Reaction
which is what will play out when all of the conditions above aren't met, ie no one is homemode=Away
, ie undoing theSet Reaction
. Since you have noSet
theReset
is confused and just flip/flopping around.I think your goal here is to have the house state flip to
away
when no one is home. As such, you should haveSet Reaction
be what mode you want the house mode to be when at least one of those people is home. I don't even know that you need that condition forHouse mode=Guest
. The basic goal here is "no one home, set to away", correct?Now if you want the house to flip to
mode=Away
when no one is home, put that in yourReset Reaction
. That's not how I've done it personally, but it would get you there if I'm understanding your goal. -
@gwp1, yeah, I collapsed them because of how I’m having to work on my iPad.
Each of those collapsed rules, are rule states of other rules, which determine the actual presence of the individual users. They are all identical, except for which device they tracking.
These work nearly flawlessly individually. If a user has the companion app, no issue. It’s when I’m trying to “fool” the system for non users into arming into away mode, shutting everything down, and arming the home alarm system to away, that I’m having issues with, if you follow
-
@gwp1, yeah, I collapsed them because of how I’m having to work on my iPad.
Each of those collapsed rules, are rule states of other rules, which determine the actual presence of the individual users. They are all identical, except for which device they tracking.
These work nearly flawlessly individually. If a user has the companion app, no issue. It’s when I’m trying to “fool” the system for non users into arming into away mode, shutting everything down, and arming the home alarm system to away, that I’m having issues with, if you follow
@tamorgen check the edit to my original post.
EDIT:
SO here's how mine is set up. I don't have
reset
anywhere in mine. I onlySet Reaction
for the various modes.Cracking open my
Away
configIt's similar to yours except I just do a
Set Reaction
Each of my modes is this way.
-
Good afternoon all,
I believe I’m having an issue with my logic for setting my home modes in MSR, partially based upon Phone modes in Home Assistant. Users in my family have the Home Assistant companion app installed on their phone, and it geofences the users, so once they are within my home circle geographically, it sets a Boolean to home mode. If they are out it it’s away. I also have a couple of other modes, which I struggle to activate, and it causes issues when I have guests, or pet sitters that come over that do no have the companion app.I have a guest mode that has to be manually set in Home Assistant, that disables the Away mode automation (based on the companion app statuses), until either a user with the companion app arrives home, or a guest arms the alarm system (away arm).
My issue is that I seem to unable to set the system into Guest mode from Home Assistant, because MSR keeps trying to arm the system. I think that I need to have some sort of a delay for the Reset reaction.
In the rules below, each of the users has a separate reaction that evaluates the state of the iPhone. This rule is a giant OR rule that evaluates the state off all them to decide the mode of the house.
Appologizes for the formatting. I’m away from home and doing this on my iPad, so my screenshots can’t display the full rule.
As you can see in the Rule history, it was rapidly resetting every time I tried to put the house into guest mode around 18:00 yesterday. I was on a plane and my mother-in-law arrived to take care of our pets, and I had to log in on my phone to my server and disable MSR to stop the automation in the house completely.
Any suggestions on how I can handle this flapping?
I have another set of rules for users that don’t have the companion app, but is rather based on the user ID for the alarm system and put the house into Guest mode, but I’ve never been able to get this to work completely. It exhibits the same behavior of trying to arm the system immediately.
The only reliable way for me to set the house into Guest mode is to be in at home mode first, then switch to guest mode. I believe this is all linked to this rule in question.
I appreciate the long read and any advice.
@tamorgen I suspect some other rule is affecting the house mode. At least, that would be the first thing to check.
A review of the logs will tell you that. What you want to look for are entries that say
<Rule:INFO> Phones Home (rule-grp19i3lbdi in xxxxx) evaluated; rule state transition from RESET to SET!
and then look at what's going on after that. You may see another rule being triggered.You can also look for
perform selector.select on Entity#hass>input_select_house_mode with { "value": "Away" }
and work backwards from that to see what is running that action. You will typically find aStarting reaction
orResuming reaction
line shortly before, and this is the reaction that is setting the away mode.