Set var twice only triggers one follow-on action?

I had some issues with my “how many family members are home” (advanced) flow.
Many times it somehow miscounted although I was quite sure I had done everything to avoid miscounts.
I have a single advanced flow that has multiple triggers points.
Example:

  1. Person X goes away => subtract 1 from numberOfResidentsAtHome
  2. If numberOfResidentsAtHome changed => subtract 1 from numberOfPeopleAthome
    Where it seemed to go wrong was when two people left the house at the same time, then it seemed to miscount (or don’t trigger twice)

I then focused on how and when my variables are set/changed and found the following.


Here the variable TestLogicVar is set twice (at least that is what I think should happen). I would expect it to then also create two separate triggers.

When I change the wait time between one and the other set, it works fine.

Can someone confirm that they experience the same?
If so, would you agree that I may expect the first example to work?

In the first screenprint you are trying to change the same logic-card at the same time.
In other words should n’t the second logic-card be ‘…….2’?

Thanks Wim, though no, this is exactly what I’m trying to do.

I’m trying to show that if you change a (the same) variable twice in a timeframe that’s very close, it doesn’t trigger twice.
If you add a delay of 1 second it does trigger twice.
To me that’s not correct. It should trigger twice as you make 2 changes.

This is the code that started my problem search… I now added 3 delays, all 1 second apart.
Without the delay and if two people left at the same time and somehow both triggered this flow at the same time (?) it only triggered once at time.

No, while you connected them in parallel → it’s supposed to be set at the same time!

Connect them in series, and they will be set one after the other, and there will be 2 separate triggers with two different var values

Simple Log, note the just slightly different timestamps:

Did you only simulate the flow, or does the problem also occur in real life?
Because my wife and I often left the house together and go away together in the same car. Since 2019 it has never happened that the status “Has gone” was set at the exactly same time.

1 Like

Thanks Peter, you showed it works like that.
Partially I agree that having those two set commands are in parallel and suppose to happen at the same time, but still I think of them being two separate actions. Apparently not, so I’ll adjust my flow to make them happen in sequence.

I had it in real life.
We are at home with 3, at time my “PeopleHome” counter was -1 other times it was 4.
So either fired double or not as many times as I would expect.

With a forced wait that is different for each event it seems to solidly stay within the zero to 3 range.