ESPHome Sprinkler ctrl

Hi,

Newbie here :slight_smile:

I have a esp32 installed with esphome sprinkler controller and I have a question.

If the esp32 restarts or loses wifi connection, the irrigation stops. Is there a way to restart the irrigation automatically when it restarts or reconnects ?

a simple automation that checks to see if its stopped without completing the cycle and maybe even use wifi disconnected or a debug sensor that uses the restart reason as another condition.

I dont recall but, it does restore the point in the cycle where it stopped right? like if a power failure happened with 5min left on zone3 and zone4,5,6 are still in the que. It still shows 5min left on zone3 and the remaining que?

I’m using an esp32 to control 6 sprinkler circuits, but most of the automation/logic is in Node Red. For the esp code I’m using restore_mode: ALWAYS_OFF because I don’t want the water to run after a power outage. I’d rather underwater than let it run forever. I do have a pulse counter on the water line and have automation the shuts the whole house valve off if water is running longer than an hour continuously. I’ll get a notification when the power is restored and can then look at the watering data to know if I should manually water to make up any difference.

switch:
  - platform: gpio
    pin: GPIO16
    name: "Front Plants Valve"
    id: front_plants_valve
    restore_mode: ALWAYS_OFF
    interlock: &interlock_group [front_plants_valve, back_plants_valve, rear_lawn_valve, fruit_trees_valve, upper_garden_valve, lower_garden_valve]
    interlock_wait_time: 5s
    on_turn_on:
        then:
          - delay: 600s
          - switch.turn_off: front_plants_valve

ya, i do something similar for my drip hoses in my beds. 5 solenoids/valves, pulse counter, main valve/shutoff.

Why use NR for the automations? Arent the solenoids/valves in esphome as well as the sprinkler controller being there? Splitting it up like that just increases the odds for problems.

You can use
on_boot:
to do automation you want.

Also, if your irrigation is done with switch, the state can be saved in flash and restore state after restart

I was using Node Red for 99% of my automations long before I started using any ESP devices. I haven’t had any issues with it. I’m using the Smart Irrigation integration to control the amounts of watering based on evapotranspiration rates, and Node Red picks up the start event from that to initiate the opening and duration of the esp switches (valves). The Node Red integration is powerful and integrates seamlessly into HA and I recommend it to anyone over using yaml.

I have tried to use on_boot without luck.

what is the correct code for it to auto start after boot or reconnect wifi?

esphome:

  on_boot:
    priority: -100
    then:
      - your automation here

I don’t know what your “auto start” is in practice…

I need it to restart from where it stopped when connection was lost.

in a sense of state or also time?

Just state. time is not relevant for now.

Like I wrote

You don’t need on_boot for that

But it might become relevant in certain situations. Depends how shut off is coded in…

what do I need then?

I don’t know what you have…

I have the standard code from esphome “sprinkler controller”