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.
Hey there, can someone point me in the right direction? I can't figure out the "wait_until" condition.
I want to push the button, record the start_pulse_count, turn_on the relay, wait until the pulse_counter counts 50 pulses, and then turn_off the relay.
I'm trying to create a water dispenser that dispenses a set amount of water at the push of a button. Okay, I admit it, it's to fill the reservoir on my coffee machine.
# Button
binary_sensor:
- platform: gpio
pin:
number: D7
mode: INPUT_PULLUP
inverted: True
name: "button1"
on_press:
then:
- globals.set:
id: start_pulse_count
value: (id(pulses_counted).state)
- switch.turn_on: relay1
- wait_until:
(id(pulses_counted).state) == (id(start_pulse_count).state) 50
- switch.turn_off: relay1
EDIT: I understand the concept of lamdas. But I'm not clear on when they need to be used. I suspect this may be one of those cases.
EDIT: Full yaml file here: https://pastebin.com/suj3MwN8
Post Details
- Posted
- 2 years ago
- Reddit URL
- View post on reddit.com
- External URL
- reddit.com/r/Esphome/com...