openmotics / home-assistant

OpenMotics Home Assistant integration Beta
GNU Affero General Public License v3.0
15 stars 9 forks source link

UI lag when changing state #17

Open tmds opened 2 years ago

tmds commented 2 years ago

When I do things like toggle a light/outlet or change brightness, the UI doesn't reflect that state immediately, but it takes several seconds.

This creates a visible lag between what happens in the house, and what is shown in the UI.

It also causes a usability lag, because it's for example not possible to turn a lamp back off until home assistant knows it was turned on.

Would it be possible to immediately reflect the requested state?

cc @woutercoppens

woutercoppens commented 1 year ago

We're aware that there might be a lag between the action and the UI. The reason is that we poll every 30 seconds the state. The solution is to use websockets, but I'm currently lacking time to implement them.

tmds commented 1 year ago

Could you change so the state is applied immediately when the request is made? For example, if the request is to turn on the light, set the state to 'on'.

In case the request failed (which is unlikely), the state will be corrected by the polling.

kneirinck commented 1 year ago

I've been annoyed by this as well and wanted to fix this. https://github.com/openmotics/home-assistant/pull/18 should do the trick. If anyone could try it out with a cloud connection and see if it also works?