Sendevent command not instantaneous?

Could do it with states (or even a local variable?)...

Internal states get updated immediately in memory for the instance, so if you set state.armModeX (or whatever) on the line before/after the sendEvent, you can reference that all you want and it would be up to date...

I'm attempting to convert a working ST DTH to a HE Driver. Meaning as few logic and code changes as possible. I posted my functional workaround above that avoids this entire issue without using state.

For the record, the ST driver should not really be doing it that way either, but that is neither here nor there.

Glad you got it working in any case.

1 Like

For the record I am not the author of the original ST DTH.

Understood.

And I certainly understand modifying the minimum necessary to 'get it working'. No judgement being cast by me for that!!! :smile:

1 Like

YESS!!! Thank you @chuck.schwer

it.currentValue(attribute,true) works for me.

I have a loop that will turn off a bunch of switches and then loop to check if they are off and try again.

Until today I had to code something complicated to use the runIn to get the updated values, but now I can just use a regular loop to retry a few times. My method is just to verify things did report back that they were turned off successfully.

It does work but you need to pause in between setting and reading. I had a 1s pause and it would sometimes catch it. I set the pause to 5s and then check again and it catches the new values much more reliably. It just takes time to save it.

1 Like