Mask the delay it takes an entity to update

I’m toying with the ttlock integration here:-

which works fine.
However, when sending commands, llke adding a passcode or setting a lock mode, it appears to send the command very quickly, and a second or two later, the lock has been updated. However, the entities in HA seem to take a long time to update. This might not be fixable as the delay might be on the ttlock server side.

So… I was thinking, how can I mask this problem. I know the entity has actually been updated (almost instantly), its just HA doesn’t know about it yet. I was thinking of maybe using an input boolean as I simply need to know whether the command has been done, or not done, and by changing the state of the boolean, just run an automation to do the ‘work’. I then track the state of the boolean on my dashboard, not the state of the entity itself.

Any other/better way ?

It might be worth trying a call to homeassistant.update_entity to see if that causes it to update. The website says it uses a webhook to update, so you’d expect it to be fast, but I see there’s an outstanding issue where people are saying manually unlocking does not reflect in HA, which would suggest the webhook isn’t working properly.

Further investigations…

Manual unlocking with the physical key, does not update HA, because the lock state is still infact locked, so thats fine.

Unlocking via fingerprint / passcodes etc do seem to update HA, and the webhook call made by ttlock servers are pretty fast.

Locking/Unlocking via HA is also pretty fast, both in the time it takes to unlock the lock, and the recorded state change.

However, setting passage mode in HA seems slow, unless you force an entity refresh, so I’ve basically taken to just doing this.

And on a final note about passage mode, if you set this in the ttlock app, and not via HA, then HA never gets updated.

So it seems to be a mix of things that are fast, slow, and not at all…