This post has been de-listed
It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.
I'm trying to set the open duration using a variable. I'm getting an error saying that the duration is expecting a float.
Questions:
Is a lamda not allowed in "duration" fields?
Do I need to convert the variable "dr_shade_east_close_duration" to float somehow?
I found this post on github: Cover, open_duration and close_duration, variables instead of just numbers ยท Issue #930 ยท esphome/feature-requests (github.com) The response to the post was:
" you can update them manually at runtime using a lambda and the
.set_open_duration()
and
.set_close_duration()
functions of the time-based cover component
However, the OP responds:
Hi @napieraj , not sure how it is generated but https://esphome.io/components/cover/time_based.html does not seem to document these two lambdas ?
And then @napieraj just closes the issue.
Does anyone know how to accomplish this?
Additionally:
Am I not understanding Github? Every time I look for a solution there, I find that someone has asked the same exact question that I have, but then there are usually a couple of half-hearted or incorrect responses and then someone just decides they've had enough and just "closes" the issue. How is this at all helpful? Am I missing the point? Then google catches them and for every question there's just a bunch of useless Github answers and then maybe one from reddit or homeassistant community that actually solves the problem. What's the point of "closing" useless responses and leaving them for google to find? Am I missing something?
- platform: homeassistant
name: "DR Shade East Close Duration"
id: "dr_shade_east_close_duration"
entity_id: input_number.dr_shade_full_east_close_duration
on_value:
then:
- globals.set:
id: dr_shade_east_close_duration_global
value: !lambda 'return id(dr_shade_east_close_duration).state;'
- sensor.template.publish:
id: "dr_shade_east_close_duration_confirmed"
state: !lambda 'return id(dr_shade_east_close_duration).state;'
- platform: time_based
name: "DR Shade Full East"
id: dr_shade_full_east
assumed_state: false
open_action:
- switch.turn_on: shade_s1
open_duration:
seconds: !lambda return (id(dr_shade_east_open_duration).state);
Post Details
- Posted
- 1 year ago
- Reddit URL
- View post on reddit.com
- External URL
- reddit.com/r/Esphome/com...