%device% time out

Hello,

In some of my automations, I exploit %device%, local variables, and the timeout feature to ask a question if an action should be performed. I parse the variable to see if it has the word ā€œtimeoutā€ in it. If the device triggers before timeout, then the actions continue. This has worked perfectly for me, but since 2.3.2, timeout will not set in the variable and my rules perform actions they should not.

Here is a screen grab if my rule

I do remember that there was a hic-cup with this feature a few versions back. When that happened I decided to change my testing for the timeout instead to just retesting the condition in my wait statement again.

So bottom line, somebody else will need to answer your original question. But if you log the value of %device% after the timeout you should be able to answer your own guestion of why your if condition is not working.

1 Like

Yeahā€¦ I did thatā€¦ the variable logs nothing when timeout happens. So because my logic says if not ā€œtimeoutā€, IE anything else, it fires the actions.

1 Like

@bertabcd1234

You helped me with this originally. Have you seen this?

No, but it would be easy to test this with a new rule to see if the behavior can be replicated. Maybe later when I'm back at a desktop unless someone else wants to try it first. :slight_smile:

Tested on a new rule. But logs seem to indicate timeout no longer sets the variable to timeout...


Yep, I was able to see this as well. It seems a timeout is not setting %device% to timeout like it used to. Perhaps this was an unintentional side effect/bug introduced when adding new features like "stays" in Wait for Events. I tested Wait for Expression and found the same behavior, however.

Testing for the resulting condition afterwards should still work, assuming the event gets "committed" fast enough (and nothing more happens in the meantime) that a nearly-immediate check will see the new value, though I remember this approach being recommended against in the past for reasons I don't recall (perhaps one or both of these) and the timeout value being the recommendation instead.

This is something for @bravenel to look at (example rule demonstrating the issue in the post above mine), assuming it was not an intentional change.

2 Likes

Thanks! Yes, Iā€™m hoping @bravenel could look at this. I use it in a a few of my rules.

2 Likes

Just circling back. I rolled back to 2.3.1 and the timeout variable set works, so Iā€™m thinking it is 2.3.2. Im going to roll back up eventually, so I hope this can get addressed in a release. @bobbyD @gopher.ny

+1. Still on 2.3.1 and using timeout in my rules also.