Coming soon - Get a detailed view of why an account is flagged as spam!
view details

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.

2
wait_until condition... my coffee maker is full.
Post Body

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

Author
Account Strength
100%
Account Age
12 years
Verified Email
Yes
Verified Flair
No
Total Karma
8,763
Link Karma
533
Comment Karma
8,185
Profile updated: 6 days ago
Posts updated: 2 months ago

Subreddit

Post Details

We try to extract some basic information from the post title. This is not always successful or accurate, please use your best judgement and compare these values to the post title and body for confirmation.
Posted
2 years ago