Hi Benny-
Welcome to community and thanks for posting! Sorry to hear that things aren’t working as expected.
There’s a better rule design that can be used here. Instead of querying the smart hub for the current state, you can directly use the triggered event in the comparison using a Context Variable for the Event Value. That way the rule is directly comparing against the same event value that triggered the rule rather than trying to query the smart home hub where there could be discrepancies (old values if the new value hasn’t persisted yet, or fast changing new values already reported)
Once the comparison against the triggering event value is fixed, it would be interesting to see the logs for the State Stays nested condition.
It is possible that you’re experiencing a similar issue with the weird timestamp reporting with certain drivers. That issue is specific to State Stays comparisons though as the
Explanation of State Stays and the Trigger Issue (tap to expand)
The workaround that I deployed in December is for incorrect timestamps reported within State Stays within the Trigger of a rule. It basically snapshots event values as they come across so it can locally cache its own interpretation of when the state changed rather than having to query the smart hub (SmartThings) to ask for the current state so it can use the reported value + timestamp to determine if the value changed or not (eg. if it’s the same timestamp and value as the original event, then it didn’t change).
For State Stays within a condition, the rule engine must query the hub to ask for the current state (value+timestamp) and then it compares if that timestamp is older than the duration you are interested in.
The approach you used with using a shorter State Stays duration compared to your delay is a good approach as with distributed systems there’s a possibility for slight time skew and such.