ESPHome Sprinkler YAML

I’ve been fairly successful in writing code to control four irrigation control valves. From within HA I’m able to control a lawn sprinkler and initiate automatic advance on three garden sprinklers. Sliders to adjust the time multiplier are present in HA. What I cannot figure out is how to get the “on duration” to show up in HA as an adjustable field. My code is below. Would you mind having a look and advising how it must be changed to accomplish what I’m after?

esphome:
    name: irrigation-ctrl-south
    platform: esp8266
    board: d1_mini
    comment: Four Valve Irrigation Control - South Side
    project:
        name: "Robert.Four Valve Irrigation Control - South_Side"
        version: "1.0.0"
  
# WiFi connection, replace these with values for your WiFi.
wifi:
    ssid: !secret wifi_ssid
    password: !secret wifi_password

# Enable logging
logger:
  
# Enable over-the-air updates.
ota:
    password: !secret ota_password

# Enable Web server.
web_server:
    port: 80

# Sync time with Home Assistant.
time:
  - platform: homeassistant
    id: homeassistant_time

# Text sensors with general information.
text_sensor:
  # Expose ESPHome version as sensor.
  - platform: version
    name: irrigation_south ESPHome Version
  # Expose WiFi information as sensors.
  - platform: wifi_info
    ip_address:
      name: irrigation_ctrl_south IP
    ssid:
      name: irrigation_ctrl_south SSID
    bssid:
      name: irrigation_ctrl_south BSSID

# Enable On-Board Status LED.
status_led:
  pin:
    # Pin D4
    number: GPIO2
    inverted: true

sensor:
  # Uptime sensor.
  - platform: uptime
    name: irrigation_ctrl_south Uptime

  # WiFi Signal sensor.
  - platform: wifi_signal
    name: irrigation_ctrl_south WiFi Signal
    update_interval: 60s

# Enable Home Assistant API - Lawn Sprinklers
api:
  encryption:
    key: "NrqRy0rxGHnQKpRlierCyVlUaN6Nhi8tqy3FI29ODb0="
  services:
    - service: set_multiplier
      variables:
        multiplier: float
      then:
        - sprinkler.set_multiplier:
            id: garden_sprinkler_ctrl
            multiplier: !lambda 'return multiplier;'
    - service: start_full_cycle
      then:
        - sprinkler.start_full_cycle: garden_sprinkler_ctrl
    - service: start_single_valve
      variables:
        valve: int
      then:
        - sprinkler.start_single_valve:
            id: garden_sprinkler_ctrl
            valve_number: !lambda 'return valve;'
    - service: next_valve
      then:
        - sprinkler.next_valve: garden_sprinkler_ctrl
    - service: previous_valve
      then:
        - sprinkler.previous_valve: garden_sprinkler_ctrl
    - service: shutdown
      then:
        - sprinkler.shutdown: garden_sprinkler_ctrl

# Set multiplier via number - Garden Sprinklers
number:
  - platform: template
    id: lawn_sprinkler_ctrl_multiplier
    name: "Lawn Sprinkler Controller Multiplier"
    min_value: 0.1
    max_value: 10.0
    step: 0.1
    lambda: "return id(lawn_sprinkler_ctrl).multiplier();"
    set_action:
      - sprinkler.set_multiplier:
          id: lawn_sprinkler_ctrl
          multiplier: !lambda 'return x;'
  - platform: template
    id: garden_sprinkler_ctrl_multiplier
    name: "Garden Sprinkler Controller Multiplier"
    min_value: 0.1
    max_value: 10.0
    step: 0.1
    lambda: "return id(garden_sprinkler_ctrl).multiplier();"
    set_action:
      - sprinkler.set_multiplier:
          id: garden_sprinkler_ctrl
          multiplier: !lambda 'return x;'

sprinkler:
  - id: lawn_sprinkler_ctrl
    valves:
      - valve_switch: "Front Lawn"
        run_duration: 20s
        valve_switch_id: lawn_sprinkler_valve_sw0
  - id: garden_sprinkler_ctrl
    main_switch: "Garden Sprinklers"
    auto_advance_switch: "Garden Sprinklers Auto Advance"
    valve_open_delay: 5s
    valves:
      - valve_switch: "Front Garden"
        enable_switch: "Enable Front Garden"
        run_duration: 20s
        valve_switch_id: garden_sprinkler_valve_sw0
      - valve_switch: "South Garden"
        enable_switch: "Enable South Garden"
        run_duration: 20s
        valve_switch_id: garden_sprinkler_valve_sw1
      - valve_switch: "Rear Garden"
        enable_switch: "Enable Rear Garden"
        run_duration: 20s
        valve_switch_id: garden_sprinkler_valve_sw2

switch:
# Exposed switches.
# Switch to restart the irrigation_ctrl_south ESP8286.   
  - platform: restart
    name: "irrigation_ctrl_south Restart"
# Hidden switches.
# Switch to control sprinkler valve relays
  - platform: gpio
    name: Relay Board Pin IN1
    internal: true # Prevents GPIO switch NAME from showing up in Home Assistant
    id: lawn_sprinkler_valve_sw0
    pin: 12    # D6
  - platform: gpio
    name: Relay Board Pin IN2
    internal: true # Prevents GPIO switch NAME from showing up in Home Assistant
    id: garden_sprinkler_valve_sw0
    pin: 13    # D7
  - platform: gpio
    name: Relay Board Pin IN3
    internal: true # Prevents GPIO switch NAME from showing up in Home Assistant
    id: garden_sprinkler_valve_sw1
    pin: 14    # D5
  - platform: gpio
    name: Relay Board Pin IN4
    internal: true # Prevents GPIO switch NAME from showing up in Home Assistant
    id: garden_sprinkler_valve_sw2
    pin: 15    # D8

With thanks

Hi @rcblackwell - good to see you here!
I had the same question. @kbx81 helped me out with his example config including a Nextion Display - what is absolutely amazing!

The relevant part is to create a number for each duration of the valves. Here is a part of my config. You can find the complete code I am playing with here.

number:
  - platform: template
    id: sprinkler_ctrlr_duration_v_1
    name: "Sprinkler Controller Duration of Valve 1"
    min_value: 1
    max_value: 300
    step: 1
    lambda: "return id(lawn_sprinkler_ctrlr).valve_run_duration(0);"
    set_action:
      - sprinkler.set_valve_run_duration:
          id: lawn_sprinkler_ctrlr
          valve_number: 0
          run_duration: !lambda 'return x;'
  - platform: template
    id: sprinkler_ctrlr_duration_v_2
    name: "Sprinkler Controller Duration of Valve 2"
    min_value: 1
    max_value: 300
    step: 1
    lambda: "return id(lawn_sprinkler_ctrlr).valve_run_duration(1);"
    set_action:
      - sprinkler.set_valve_run_duration:
          id: lawn_sprinkler_ctrlr
          valve_number: 1
          run_duration: !lambda 'return x;'
  - platform: template
    id: sprinkler_ctrlr_duration_v_3
    name: "Sprinkler Controller Duration of Valve 3"
    min_value: 1
    max_value: 300
    step: 1
    lambda: "return id(lawn_sprinkler_ctrlr).valve_run_duration(2);"
    set_action:
      - sprinkler.set_valve_run_duration:
          id: lawn_sprinkler_ctrlr
          valve_number: 2
          run_duration: !lambda 'return x;'
  - platform: template
    id: sprinkler_ctrlr_duration_v_4
    name: "Sprinkler Controller Duration of Valve 4"
    min_value: 1
    max_value: 300
    step: 1
    lambda: "return id(lawn_sprinkler_ctrlr).valve_run_duration(3);"
    set_action:
      - sprinkler.set_valve_run_duration:
          id: lawn_sprinkler_ctrlr
          valve_number: 3
          run_duration: !lambda 'return x;'
  - platform: template
    id: sprinkler_ctrlr_duration_v_5
    name: "Sprinkler Controller Duration of Valve 5"
    min_value: 1
    max_value: 300
    step: 1
    lambda: "return id(lawn_sprinkler_ctrlr).valve_run_duration(4);"
    set_action:
      - sprinkler.set_valve_run_duration:
          id: lawn_sprinkler_ctrlr
          valve_number: 4
          run_duration: !lambda 'return x;'
  - platform: template
    id: sprinkler_ctrlr_repeat_cycles
    name: "Sprinkler Repeat Cycles"
    min_value: 0
    max_value: 300
    step: 1
    mode: box
    lambda: "return id(lawn_sprinkler_ctrlr).repeat();"
    set_action:
      - sprinkler.set_repeat:
          id: lawn_sprinkler_ctrlr
          repeat: !lambda 'return x;'

Here is my a screenshot of my sandbox dashboard. I really like that new feature of ESPHome!

Do you know how to display the remaining time a.) in total and b.) for each sprinkler in Home Assistant?

1 Like

Hi @SmartLiving.Rocks , Thank you for sharing your code and that of @kbx81. I think the code snippet provide will help me create what’s missing from my code; adjustable run_duration.

I don’t know how to display time remaining or total time. These would be great additions to my own program. If i figure out how to add this as a feature, I’ll let you know.

Regards,

I have an example of how you’d get the time remaining here. I have this in an included header file, but you can use this in a display lambda, etc. just the same. It is also possible to get the total run duration for any given zone using the valve_run_duration() or valve_run_duration_adjusted() functions. :slight_smile:

1 Like

Can you give us an example in a display yaml ?
I tried figuring out how to add this to my LCD display but failed during compile, I suspect I don’t understand how to get at the value from an internal register in ESPhome (error reports that ‘valve_run_duration_adjusted’ was not declared in this scope). The code for displaying the value of Zone 1 state does work.

Here is what I tried.

# 16x2 LCD config
display:
  - platform: lcd_pcf8574
    dimensions: 16x2
    address: 0x27
    lambda: |-
      // Print the zone switch status of valve x
      it.printf(0, 0, "Zone1: %s", id(zone_valve_sw1).state ? "ON" : "OFF");
      //Print the time duration for valve x
      it.printf(0, 1, "Duration: %3f", id(valve_run_duration_adjusted(1)).state);

Yes, of course, happy to. :grinning_face_with_smiling_eyes:
See examples I have here

The key part that I think you are looking for is id(sprinkler_ctrlr).valve_run_duration_adjusted(0). You’re on the right track, just your syntax/parameters were a little off. :slight_smile:

Thanks Keith.
I fumbled my way ahead with the lambdas.

These two lines work with the LCD fine now with better syntax.

it.printf(0, 1, "Duration: %3.1d", id(esp32_sprinkler_ctrlr).valve_run_duration_adjusted(1) / 60);

and runtime remaining countdown

      it.printf(0, 1, "Remaining: %3.1d", id(esp32_sprinkler_ctrlr).time_remaining().value_or(0) / 60);

Having some odd issues with first zone running the default 900s runtime regardless of what I set in the HA frontend. Will check all my syntax.

Edit: Found my issue with first zone not running the right runtime. I had not taken into account that my first zone (Zone 1) is actually internally referenced as valve 0. So in lambdas I need to use 0-7 instead of 1-8.

Is there a way to pass this information to HA!

This seems to do it, but displays whole minutes only in HA. I’d like to have this displayed as minute with one decimal (easier to see the last minute that way), if anyone knows how to do that let me know :slight_smile:

sensor:
  - platform: template
    name: "ESP Irrigation Time Remaining Sensor"
    unit_of_measurement: 'Mins'
    lambda: "return id(esp32_sprinkler_ctrlr).time_remaining().value_or(0) / 60;"
    update_interval: 5s 

@mr.sneezy, Thanks for this.

I tried adding a decimal setting, no luck.

  - platform: template
    name: Time Remaining
    id: time_remaining
    unit_of_measurement: Min
    icon: mdi:progress-clock
    accuracy_decimals: 2
    lambda: |-
      return id($devicename).time_remaining().value_or(0)/60;
    update_interval: 5s

I’d like to see the display updated every second, with minutes and seconds displayed. So far I’ve been unable to figure that one out.

I did notice that setting the update_interval to 1s causes the template to spew out data every second. Should be okay when a sprinkler is running but I don’t think constantly updating HA when no sprinkler is running is appropriate. Any ideas as to how this can be configured to send updates only when a valve is open?

I’ve opened a new topic to discuss this issue. Please refer to Expose ESPHome Sprinkler Component Timer to HA

HI,

did you make any progress with your project? can you share your Lovelace card?

Hey, thanks for asking. But I am not sure how I can help you. My Lovelace is just standard buttons - nothing special. I get some inspiration here:

Lately I was thinking to do a Kickstarter or any other fundraising for a professional sprinkler control including pump and cistern control, water level sensor, freshwater pump (to fill up the cistern before sprinkler starts) and of curse some BT flower Sensors to kick right into the Bluetooth trend:

with a nice FOSS label

Thank you
I’m wondering how you configured the actions associated with the buttons

image

e.g. Previous, you probably configured something like

show_name: true
show_icon: true
type: button
tap_action:
  action: call-service
  service: esphome.sprinkler_previous_valve
  data: {}
  target: {}
icon: mdi:skip-previous

Here is the Lovelace

type: vertical-stack
cards:
  - type: entities
    entities:
      - entity: number.sprinkler_controller_duration
        icon: mdi:sprinkler
      - entity: number.sprinkler_controller_duration_of_valve_1
        name: Valve 1
        icon: mdi:sprinkler
      - entity: number.sprinkler_controller_duration_of_valve_2
        name: Valve 2
        icon: mdi:sprinkler
      - entity: number.sprinkler_controller_duration_of_valve_3
        name: Valve 3
        icon: mdi:sprinkler
      - entity: number.sprinkler_controller_duration_of_valve_4
        name: Valve 4
        icon: mdi:sprinkler
      - entity: number.sprinkler_controller_duration_of_valve_5
        name: Valve 5
        icon: mdi:sprinkler
      - entity: number.sprinkler_repeat_cycles
        icon: mdi:sprinkler
    title: Bewässerungs Bereich Lawn
    show_header_toggle: false
  - type: horizontal-stack
    cards:
      - show_name: true
        show_icon: true
        type: button
        tap_action:
          action: toggle
        entity: switch.lawn_sprinklers
        name: Main Lawn
        icon: mdi:sprinkler
      - type: button
        tap_action:
          action: toggle
        entity: switch.front_lawn
        icon: mdi:sprinkler
      - type: button
        tap_action:
          action: toggle
        entity: switch.side_lawn
        icon: mdi:sprinkler
      - type: button
        tap_action:
          action: toggle
        entity: switch.back_lawn
        icon: mdi:sprinkler
      - type: button
        tap_action:
          action: toggle
        entity: switch.front_garden
        icon: mdi:sprinkler
      - type: button
        tap_action:
          action: toggle
        entity: switch.back_garden
        icon: mdi:sprinkler
  - type: horizontal-stack
    cards:
      - show_name: true
        show_icon: true
        type: button
        tap_action:
          action: call-service
          service: esphome.bewaesserung_resume
          data: {}
          target: {}
        icon: mdi:play
        name: Start
      - show_name: true
        show_icon: true
        type: button
        tap_action:
          action: call-service
          service: esphome.bewaesserung_pause
          data: {}
          target: {}
        icon: mdi:pause-box-outline
        name: Pause
      - show_name: true
        show_icon: true
        type: button
        tap_action:
          action: call-service
          service: esphome.bewaesserung_previous_valve
          data: {}
          target: {}
        icon: mdi:skip-previous
        name: Previous
      - show_name: true
        show_icon: true
        type: button
        tap_action:
          action: call-service
          service: esphome.bewaesserung_next_valve
          data: {}
          target: {}
        entity: ''
        icon: mdi:skip-next
        name: Next
      - show_name: true
        show_icon: true
        type: button
        tap_action:
          action: call-service
          service: esphome.bewaesserung_shutdown
          data: {}
          target: {}
        icon: mdi:stop
        name: Stop
        show_state: true
      - show_name: true
        show_icon: true
        type: button
        name: Reverse
        tap_action:
          action: toggle
        entity: switch.lawn_sprinklers_reverse
        icon: mdi:keyboard-tab-reverse
  - type: horizontal-stack
    cards:
      - show_name: true
        show_icon: true
        type: button
        tap_action:
          action: call-service
          service: esphome.bewaesserung_start_full_cycle
          data: {}
          target: {}
        icon: mdi:refresh-auto
        name: Full Circle
      - show_name: true
        show_icon: true
        type: button
        tap_action:
          action: call-service
          service: esphome.bewaesserung_repeat_2
          data: {}
          target: {}
        entity: ''
        icon: mdi:numeric-2-circle-outline
        name: Repeat 2
      - show_name: true
        show_icon: true
        type: button
        tap_action:
          action: call-service
          service: esphome.bewaesserung_set_multiplier
          data: {}
          target: {}
        icon: mdi:numeric-3-box-outline
        name: Repeat 3
        show_state: true

Here is the esp

esphome:
  name: bewaesserung

esp32:
  board: esp32dev
  framework:
    type: arduino

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: "6zeG5VCmbWhBpYATSekLlTWG4qSR79dXoBTz0vnM4Ck="
  services:
    - service: set_multiplier
      variables:
        multiplier: float
      then:
        - sprinkler.set_multiplier:
            id: lawn_sprinkler_ctrlr
            multiplier: !lambda 'return multiplier;'
    - service: start_full_cycle
      then:
        - sprinkler.start_full_cycle: lawn_sprinkler_ctrlr
    - service: start_single_valve
      variables:
        valve: int
      then:
        - sprinkler.start_single_valve:
            id: lawn_sprinkler_ctrlr
            valve_number: !lambda 'return valve;'
    - service: next_valve
      then:
        - sprinkler.next_valve: lawn_sprinkler_ctrlr
    - service: previous_valve
      then:
        - sprinkler.previous_valve: lawn_sprinkler_ctrlr
    - service: shutdown
      then:
        - sprinkler.shutdown: lawn_sprinkler_ctrlr
    - service: pause
      then:
        - sprinkler.pause: lawn_sprinkler_ctrlr
    - service: resume
      then:
        - sprinkler.resume: lawn_sprinkler_ctrlr
    - service: resume_or_full_cycle
      then:
        - sprinkler.resume_or_start_full_cycle: lawn_sprinkler_ctrlr
    - service: repeat_2
      then:
        - sprinkler.set_repeat:
            id: lawn_sprinkler_ctrlr
            repeat: 2  # would run three cycles
    - service: repeat_3
      then:
        - sprinkler.set_repeat:
            id: lawn_sprinkler_ctrlr
            repeat: 3  # would run three cycles
        
ota:
  password: "f5cf86541b6ec5a6d35c1234ff987fba"

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Bewaesserung Fallback Hotspot"
    password: "Yv1223458mKU"

captive_portal:

sprinkler:
  - id: lawn_sprinkler_ctrlr
    main_switch: "Lawn Sprinklers"
    auto_advance_switch: "Lawn Sprinklers Auto Advance"
    reverse_switch: "Lawn Sprinklers Reverse"
    valve_overlap: 1s
    valves:
      - valve_switch: "Front Lawn"
        enable_switch: "Enable Front Lawn"
        pump_switch_id: sprinkler_pump_sw0
        run_duration: 3s
        valve_switch_id: lawn_sprinkler_valve_sw0
      - valve_switch: "Side Lawn"
        enable_switch: "Enable Side Lawn"
        pump_switch_id: sprinkler_pump_sw0
        run_duration: 3s
        valve_switch_id: lawn_sprinkler_valve_sw1
      - valve_switch: "Back Lawn"
        enable_switch: "Enable Back Lawn"
        pump_switch_id: sprinkler_pump_sw1
        run_duration: 3s
        valve_switch_id: lawn_sprinkler_valve_sw2
      - valve_switch: "Front Garden"
        enable_switch: "Enable Front Garden"
        pump_switch_id: sprinkler_pump_sw0
        run_duration: 9s
        valve_switch_id: garden_sprinkler_valve_sw0
      - valve_switch: "Back Garden"
        enable_switch: "Enable Back Garden"
        pump_switch_id: sprinkler_pump_sw1
        run_duration: 9s
        valve_switch_id: garden_sprinkler_valve_sw1

switch:
  - platform: gpio
    id: sprinkler_pump_sw0
    pin: 12
  - platform: gpio
    id: sprinkler_pump_sw1
    pin: 13
  - platform: gpio
    id: lawn_sprinkler_valve_sw0
    pin: 0
  - platform: gpio
    id: lawn_sprinkler_valve_sw1
    pin: 2
  - platform: gpio
    id: lawn_sprinkler_valve_sw2
    pin: 4
  - platform: gpio
    id: garden_sprinkler_valve_sw0
    pin: 14
  - platform: gpio
    id: garden_sprinkler_valve_sw1
    pin: 15
    
# Example configuration to set multiplier via number
number:
  - platform: template
    id: sprinkler_ctrlr_multiplier
    name: "Sprinkler Controller Multiplier"
    min_value: 0.1
    max_value: 10.0
    step: 0.1
    lambda: "return id(lawn_sprinkler_ctrlr).multiplier();"
    set_action:
      - sprinkler.set_multiplier:
          id: lawn_sprinkler_ctrlr
          multiplier: !lambda 'return x;'
          

  - platform: template
    id: sprinkler_ctrlr_duration
    name: "Sprinkler Controller Duration"
    min_value: 1
    max_value: 500
    step: 1
    lambda: "return id(lawn_sprinkler_ctrlr).valve_run_duration(0);"
#    lambda: "return id(lawn_sprinkler_ctrlr).duration(0);"
    set_action:
      - sprinkler.set_valve_run_duration:
          id: lawn_sprinkler_ctrlr
          valve_number: 0
          run_duration: !lambda 'return x;'

  - platform: template
    id: sprinkler_ctrlr_duration_v_1
    name: "Sprinkler Controller Duration of Valve 1"
    min_value: 1
    max_value: 300
    step: 1
    lambda: "return id(lawn_sprinkler_ctrlr).valve_run_duration(0);"
    set_action:
      - sprinkler.set_valve_run_duration:
          id: lawn_sprinkler_ctrlr
          valve_number: 0
          run_duration: !lambda 'return x;'
  - platform: template
    id: sprinkler_ctrlr_duration_v_2
    name: "Sprinkler Controller Duration of Valve 2"
    min_value: 1
    max_value: 300
    step: 1
    lambda: "return id(lawn_sprinkler_ctrlr).valve_run_duration(1);"
    set_action:
      - sprinkler.set_valve_run_duration:
          id: lawn_sprinkler_ctrlr
          valve_number: 1
          run_duration: !lambda 'return x;'
  - platform: template
    id: sprinkler_ctrlr_duration_v_3
    name: "Sprinkler Controller Duration of Valve 3"
    min_value: 1
    max_value: 300
    step: 1
    lambda: "return id(lawn_sprinkler_ctrlr).valve_run_duration(2);"
    set_action:
      - sprinkler.set_valve_run_duration:
          id: lawn_sprinkler_ctrlr
          valve_number: 2
          run_duration: !lambda 'return x;'
  - platform: template
    id: sprinkler_ctrlr_duration_v_4
    name: "Sprinkler Controller Duration of Valve 4"
    min_value: 1
    max_value: 300
    step: 1
    lambda: "return id(lawn_sprinkler_ctrlr).valve_run_duration(3);"
    set_action:
      - sprinkler.set_valve_run_duration:
          id: lawn_sprinkler_ctrlr
          valve_number: 3
          run_duration: !lambda 'return x;'
  - platform: template
    id: sprinkler_ctrlr_duration_v_5
    name: "Sprinkler Controller Duration of Valve 5"
    min_value: 1
    max_value: 300
    step: 1
    lambda: "return id(lawn_sprinkler_ctrlr).valve_run_duration(4);"
    set_action:
      - sprinkler.set_valve_run_duration:
          id: lawn_sprinkler_ctrlr
          valve_number: 4
          run_duration: !lambda 'return x;'
  - platform: template
    id: sprinkler_ctrlr_repeat_cycles
    name: "Sprinkler Repeat Cycles"
    min_value: 0
    max_value: 300
    step: 1
    mode: box
    lambda: "return id(lawn_sprinkler_ctrlr).repeat();"
    set_action:
      - sprinkler.set_repeat:
          id: lawn_sprinkler_ctrlr
          repeat: !lambda 'return x;'

Happy automating :partying_face:

1 Like

Thank you for sharing, I manage to cover the 80% of configuration.
I’m still wondering how you managed the Single and Intensive options

image

if you want, I shared my config here DIY 8 station irrigation based on ESPhome on KC868-A8 relay board - Share your Projects! - Home Assistant Community (home-assistant.io)

Single

The two buttons are a brainstorming result. I have figured out that if you need a “Single” valve you just have to trigger/toggle the valve and it runs for the set time and also opens the master valve. So actually it i s obsolete.

Intensive+

I worked together with a professional gardening company and we made a nice garden with different plant for a customer. Here I have learned that the “young plants” need more water in the seeding phases on as well as more often.

Like a Washing Machine Program

So, my idea is to make different “programs” for the different phases of a plant/ flower. A washing machine has programs for different types of clothe that mixes soap, powder, softener and impregnate liquid in the right amount at the correct temperature. And so the watering system should also have different programs that coordinate water, ph regulator and nutrition for the different phases. Now I have a dropdown helper with the following options:

  • Sprout
  • Seedling
  • Vegetative
  • Budding
  • Flowering
  • Ripening

Combine it with flower sensor

Of curse, we all want to have a fully automated system, therefore we need some data of the flower e.g. using a sensor like this one GitHub - rbaron/b-parasite: 🌱💧 A Bluetooth Low Energy (BLE) soil moisture sensor. - also including weather forecast and
With that data, the above-mentioned “programs” will be adjusted accordingly +/- water/nutrition/ph-regulator etc.

Where are the plants

Nowadays, it becomes more and more popular to grow your own food, herbs, etc. indoor. That would also mean that you can combine the different programs adjusting the lights (more blue, more green etc.)

Thank you so much for taking the time to share your idea

For those of you who are typically used to minutes for irrigation systems as opposed to seconds, here are some sample equivalent configurations for relevant esphome sprinkler entries.

api:
  services: 
    - service: set_valve_run_duration
      variables:
        valve: int
        duration: int
      then:
        - sprinkler.set_valve_run_duration:
            id: sprinkler_controller
            valve_number: !lambda 'return valve;'
            run_duration: !lambda 'return duration * 60;
number:
  - platform: template
    id: sprinkler_controller_zone1_run_duration
    name: "Zone 1 Front Yard Run Duration"
    icon: mdi:timer-play-outline
    min_value: 0.5
    max_value: 15.0
    step: 0.5
    lambda: "return id(sprinkler_controller).valve_run_duration(0) / 60;"
    set_action:
      - sprinkler.set_valve_run_duration:
          id: sprinkler_controller
          valve_number: 0
          run_duration: !lambda |-
            return x * 60;

Thank you. works great :slight_smile:

just one typo in the yaml
missing tick at the end of:

 run_duration: !lambda 'return duration * 60;'