esphome / feature-requests

ESPHome Feature Request Tracker
https://esphome.io/
408 stars 26 forks source link

Allow more flexible time calculation for time based cover #1829

Open markus-seidl opened 2 years ago

markus-seidl commented 2 years ago

Describe the problem you have/What new integration you would like Covers (Rolladen) in Germany need some time to open, they have a special pre-open state where the blinds move away from each other to let a little bit of light through. Only after that the blinds start to open. With that the 50% position will never be at the halfway point of the window.

Please describe your use case for this integration and alternatives you've tried: I initially wanted to implement the Tasmota way of calculating the position via time, Tasmota has additional calibration points (like a halfway point). For this to be implemented an additional component needs to be created.

I thought it might be much easier if the time calculation could be accessible via a lambda to be modified from the template itself.

Additional context

pistifonok commented 1 year ago

Hi, i also have some problems with my Time Based Covers. My motors are have some delay between the switching and the actual movement (half a sec or so) and when i stop them many times it screws up the timing.

I did some resource and i think this part should to be edited in the esphome/components/time_based/time_based_cover.cpp and an extra configuration option like CONF_COVER_START_DELAY would do the trick.

this->current_operation = dir;

  const uint32_t now = millis();
  this->start_dir_time_ = now + cover_start_delay;
  this->last_recompute_time_ = now;

But im not sure and these suggestions are not tested :)

Best Regards Pistifonok