esphome / esphome/feature-requests

Make servo duration options templatable

Open
#2,861 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
450
Forks
29
PR merge metrics
No merged PRs in 30d

Description

**Describe the problem you have/What new integration you would like**

Currently, config options for the Servo component that require a duration, such as `transition_length` and `auto_detach_time`, are not templatable. This means that I can't do something like:

```
transition_length:
seconds: !lambda return id(some_number_component_to_control_transition_length).state;
```

Other components such as the Light component have the same config options as templatable.

**Please describe your use case for this integration and alternatives you've tried:**

I'd like to change the transition length on-the-fly in Home Assistant without having to recompile ESPHome.

There's an alternative listed in this closed issue: https://github.com/esphome/feature-requests/issues/2273

However, this is a workaround that results in the values being reset if the unit is ever power-cycled. Since `set_action` is not run on boot, this means that the config option will show one value while the servo's config options are set to another, resulting in unexpected behavior.

**Additional context**

Contributor guide

No contributing guide indexed for this repository

Research direction

The request concerns ESPHome's Servo component, specifically the transition_length and auto_detach_time options. Start by locating that component's duration-option handling and compare it with the Light component; done means those options accept templated values and remain consistent after a power cycle.

Written by the indexing model from the issue text.

Assessment

Domain
embedded-iot
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.