home-assistant-custom-components-cover-time-based icon indicating copy to clipboard operation
home-assistant-custom-components-cover-time-based copied to clipboard

Add time for each action

Open Guigui37 opened this issue 3 years ago • 1 comments

When closing or opening the cover, it took around 1 second here for the cover to move, between powering the motor, and the cover to move. Would it be possible to set this time in configuration, and add this time for each movement ? Without this, the cover gets desync and stops before full open or close.

Guigui37 avatar Nov 07 '21 10:11 Guigui37

I would like to (a) bump this issue as one which I also have, and (b) offer an analysis both on the issue of fixing this and on what seems to be a related issue.

AFAICT, all the time-determination functionality is farmed out to the TravelCalculator class provided by a completely different integration, XKNX. There are two problems with this:

  • The TravelCalculator class does not have any sort of start-delay or end-delay configuration, making the issue presented here insurmountable without either changing the XKNX code (which would be jurisdictionally complicated, as it has different maintainers who might not see the limitations of this integration as something they need concern themselves with) or working around its limitations (which would be sufficiently involved that it would make more sense to drop the dependency entirely; see below).
  • There is no evidence that the XKNX developers ever meant for TravelCalculator to be utilized by anything other than their own code; it's not, as it were, part of the "public-facing" interface of their integration. This means that at any time they might refactor their code to modify or eliminate the TravelCalculator class, whereupon this integration will mysteriously stop working.

I'd strongly recommend either cloning travelcalculator.py outright into this repository or (if intellectual-property limitations would prevent that) creating a from-scratch clone for its functionality. That would render this repository less fragile (i.e. less dependent on the design decisions of a completely independent group of maintainers), and also add the ability to pass, for instance, optional delay parameters to it. It's a simple enough piece of code: 169 lines with no exotic dependencies.

The cloning itself is a very simple process but obviously would not solve the actual issue. With regard to modifying the code, I would be happy to offer my own efforts in revising --- your time is valuable, of course.

dwildstr avatar Feb 13 '23 15:02 dwildstr