[SOLVED] 'not in' being ignored latest-22240-3b3254d6
-
I can confirm that @toggledbits assessment was correct. Closing this up but I'd really like to chat with either @toggledbits or @therealdb about implementation of reaction groups with constraints.
-
@toggledbits said in 'not in' being ignored latest-22240-3b3254d6:
I don't think a lot of people are using reaction groups with constraints yet
I am and I like it a lot, since you’ll end up with less rule sets and it’s definitely easier to thinker. I’m also using groups with constraints in global reactions.
@therealdb even I have one!
C
-
@alan_f I’ve centralized all my rules in MSR. How are you reliably determining presence?
Btw, @toggledbits , I’m Away and it flipped back to ‘Day’.
I’ll see what the logs look like when I get home.
@gwp1 I was away from the forum for a few days, but to answer your question, I use the Hubitat app for Android on my phone and my wife's phone to determine presence. Every once in a while they break it with an update and I can use the Google assistant presence instead. I prefer Hubitat because you can set a geofence and I have them set up not to consider us away when walking the dogs in the neighborhood, but to have us away when we're at my parent's house just outside our usual walking route. Google doesn't give me that level of control over what's considered home or away.
-
@gwp1 I was away from the forum for a few days, but to answer your question, I use the Hubitat app for Android on my phone and my wife's phone to determine presence. Every once in a while they break it with an update and I can use the Google assistant presence instead. I prefer Hubitat because you can set a geofence and I have them set up not to consider us away when walking the dogs in the neighborhood, but to have us away when we're at my parent's house just outside our usual walking route. Google doesn't give me that level of control over what's considered home or away.
-
@gwp1 Changes in 22240 were really limited, and not related to Engine work at all. I think it's more likely you had a race condition between conflicting rules, and the upgrade changed the timing of the race. That can be complicated by the performance of the hub (i.e. variances in how fast it responds to requests), etc. Keep in mind that when you have a reaction start another reaction, they both run at the same time; the starter doesn't wait for the started to finish. And further, there's no guaranteed order to which resumes if both delay to the same instant in time. Unlike Reactor for Vera, which was pretty single-threaded because of the way the Lua API worked there, MSR is very asynchronous and concurrent.
One structure that can help concentrate logic into more viewable/manageable blocks is something like this:
Here, the only rule condition is that the Mode changes. The set reaction has groups with constraints for each possible mode, and the actions in that group only run if the current mode matches the constraint. But it keeps everything in one place. I don't think a lot of people are using reaction groups with constraints yet, and I'm not saying it's the right answer for you, but it's something to keep in mind.
@toggledbits @toggledbits took your advice above and tried something new with my Living Room blinds and TV watching. The issues are:
-
If watching TV during the daylight hours, light from the windows on either side of the fireplace-mounted TV tend to wash it out a bit, esp during night scenes.
-
If watching TV at night, the neighbors have a pair of floodlights on their patio that, when in use, don't stream into my windows but do sit there in your field of view as these two white orbs. Very distracting.
My "try something new" solution is this:
(I've stricken the
Mode
Constraint from the above - it's redundant and too restrictive - what if I run out to the store real quick and the house flips toAway
?There is no
Reset Reaction
for Evenings because why? Just leave them closed as most likely the next stop is sleepy-time when they'll be closed anyway.Your thoughts?
-
-
Looks good to me!
-
Looks good to me!
@toggledbits After I saw this post I tested the daytime version and it behaved as intended. Half the battle down, we'll test the other half this evening. Thanks for the guidance here, it's a different approach but I can def see places where it's useful.
-
T toggledbits locked this topic on