peribeir / homeassistant-rademacher

This custom integration provides access to Rademacher Devices connected to a HomePilot (or Start2Smart) bridge.
GNU General Public License v3.0
58 stars 11 forks source link

State update of cover current_position with delay #17

Closed emufan closed 2 years ago

emufan commented 2 years ago

Is it works as designed/implemented/technical possible (e.g. only polling each x seconds possible and no pushing/subscription to changed values if happeing)), that there is a long lag, for updating the current_position of e.g. RolloTron Basis DuoFern 1200-UW

If I press up or down and then stop (on a position between open and closed), it takes very long time to update current_position and so I have to wait the same long time to be able to press the same direction again.

peribeir commented 2 years ago

Hi AFAIK, there's no way to subscribe to updates, so polling is the only way. I'm sticking to the default of 30 seconds, in order not to overload de hub with requests. When buttons are pressed, it's triggering an update of the state. The problem is that the hub doesn't report the correct value immediately. Maybe if I wait for a second after the button is pushed, it will get the correct value. I'll do some tests to check if it works.

emufan commented 2 years ago

Ah. o.k. Understood. In general, I don't care about the delay. But in these cases, if I would e.g. close only some % to block the sun, stopped to early or late and want to adjust again, this is happening, because the button is then still disabled.

Maybe if I wait for a second after the button is pushed, it will get the correct value.

This would be great. If HA knows, that it is something between 1 and 99, both buttons are enabled and working, The sooner the UI have this state (regardless if it is then 5, 10, 11 or whatever%), the better.

peribeir commented 2 years ago

I ended up decreasing the poll interval to 10 seconds. Also when you press the buttons, an update is triggered after 5 seconds. That's the best compromise I could find, I expect not to add too much resource usage. I'll release a new version so you could test. I'll keep testing on my side too.