My Garden Irrigation

Sorry for the delay and for being so brief here (I’m not being rude, just short of time) but try changing all the plus signs (+) to tildes (~)

- condition: template
        value_template: >
            {% if is_state('input_boolean.cycle' ~ cycle ~ '_use_weather_adjustment', 'on') %}
              {% set n = states('input_number.adjusted_cycle' ~ cycle ~ '_zone' ~ zone ~ '_duration')  | int %}
            {% else %}
              {% set n = states('input_number.cycle' ~ cycle ~ '_zone' ~ zone ~ '_duration')  | int %}
            {% endif %}
            {{ n != 0 }}
1 Like

Hi klogg.
No problem, I know you are busy.
I already tried that when I saw that post, but it didn’t work :frowning_face:

Anyway, I’ll try again, just to be sure I didn’t do a mistake last time…

It looks like nothing changed:

Wait!!!
I tried to change “+” to “~” in few more places and something moved!!!
So I did it in all files (obviously only in concatenations) and it worked!!!
I just have a little problrm with cycle name missing in telegram notification, but I’ll look into it, that should be easy.

Thank you klogg, without your reply I wouldn’t have tried again this replacement. :wink:

1 Like

Hello Klogg. I still haven’t found a solution to make the programmed cycles work, it just skips to next schedule cycle. Nothing in the logs, is there some trigger i can test?

Ok, a little bit clearer.
You have 6 shellies with tasmota for your valves.
How do you control your pump?
e.g. i have a hager esn224 to activate my pump. basically it’s a relay dpdt with a 24vac coil, when it feels current on the coil, activate the 220vac for the pump.
i have attached a 24vac transformer to one relay, when one valves start, i activate the pump(transformer) relay that activates the pump.

Hello, i have 2 sonoff 4ch pro r3 with tasmota to control the valves, and want to use a shelly 1pm to control the pump, and to now the consumer of the pump.

ok, you have to work a little bit in ha config, you have to group every valve switch with the pump relay.
Have a look at groups or even better template switch

I am about to merge a pull request from @davewatson91 which brings together all the changes made/suggested several months ago by @Athan (and possibly others?) to allow up to 16 zones.

It is literally just to allow additional zones, it doesn’t add or change any logic so it should have no effect on the way the package currently works.

Please report back here or open a GitHub issue if you experience any problems and likewise feel free to confirm you are using it with no issues.

Thanks again to @davewatson91 and @Athan and apologies if I forgot anyone else who had an input.

4 Likes

Great news @klogg and again an excellent work !

1 Like

Hi @klogg is there a way to use Weatherbit.io and this custom-component for weather sensors and forecast?
Unfortunately there I don’t own a Tempest station and the nearest station is 400km away from my house…

Hello. I just found why in my case it was skipping schedules, it was the “Ignore schedules if it is raining” that was on, just turn it to off and the schedules work. I haven’t configure the rain sensor and even with the “Adjust for rainfall” set to off it didn’t start. To prevent this maybe the “Ignore schedules if it is raining” should only work with real value (raining true or false) and if it is not configured the status should be unknown and skip this.
Regards

Can you provide me with the automation part and lovelace config*?

I have moved on from this code to something simpler I wrote myself.

I’ll check it but I don’t think I can help you out unfortunately :frowning:

This look great and is exactly what I want to do. Can you share you Esphome code? I am also look at adding a nextron lcd screen so I can control it at the box.

EDIT: Sorry, this request wasn’t aimed at me but I’ll leave it here in case it is useful!


By all means…

#==================
#=== Substitutions
#==================
substitutions:
  device_name: esphome_irrigation_controller
  friendly_name: ESPHome Irrigation Controller
#==================

# Board
esphome:
  name: ${device_name}
  platform: ESP32
  board: mhetesp32devkit

# WiFi
wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password
  fast_connect: True

  ap:
    ssid: IrrigationHotspot
    password: some.random.password!

# Fallback portal 
captive_portal:

# Enable logging
logger:

# Enable Home Assistant API
api:

# Enable Over-The-Air updates
ota:

# # Enable Web server.
# web_server:
#   port: 80

    
#=== Sensors
sensor:
  #=== Uptime
  - platform: uptime
    name: ${friendly_name} Uptime

  #=== WiFi Signal
  - platform: wifi_signal
    name: ${friendly_name} WiFi Signal
    update_interval: 60s

  #=== Failsafe time
  - platform: homeassistant
    id: failsafe_time
    name: ${friendly_name} Failsafe Time
    entity_id: input_number.irrigation_failsafe_time_in_seconds


#=== Switches
switch:
  #=== Zone Relay 1
  - platform: gpio
    pin: 
      number: 21
      inverted: True
    name: Garden Irrigation Relay Zone1
    id: relay1
    restore_mode : ALWAYS_OFF
    interlock: &interlock_group [relay1, relay2, relay3, relay4, relay5, relay6, relay7, relay8]
    on_turn_on:
      - script.execute: failsafe
    on_turn_off:
      - script.stop: failsafe

  #=== Zone Relay 2
  - platform: gpio
    name: Garden Irrigation Relay Zone2
    id: relay2
    pin: 
      number: 22
      inverted: True
    restore_mode : ALWAYS_OFF
    interlock: *interlock_group
    on_turn_on:
      - script.execute: failsafe
    on_turn_off:
      - script.stop: failsafe
      
  #=== Zone Relay 3
  - platform: gpio
    name: Garden Irrigation Relay Zone3
    id: relay3
    pin: 
      number: 23
      inverted: True
    restore_mode : ALWAYS_OFF
    interlock: *interlock_group
    on_turn_on:
      - script.execute: failsafe
    on_turn_off:
      - script.stop: failsafe
      
  #=== Zone Relay 4
  - platform: gpio
    name: Garden Irrigation Relay Zone4
    id: relay4
    pin: 
      number: 14
      inverted: True
    restore_mode : ALWAYS_OFF
    interlock: *interlock_group
    on_turn_on:
      - script.execute: failsafe
    on_turn_off:
      - script.stop: failsafe

  #=== Zone Relay 5
  - platform: gpio
    name: Garden Irrigation Relay Zone5
    id: relay5
    pin: 
      number: 25
      inverted: True
    restore_mode : ALWAYS_OFF
    interlock: *interlock_group
    on_turn_on:
      - script.execute: failsafe
    on_turn_off:
      - script.stop: failsafe

  #=== Zone Relay 6
  - platform: gpio
    name: Garden Irrigation Relay Zone6
    id: relay6
    pin: 
      number: 26
      inverted: True
    restore_mode : ALWAYS_OFF
    interlock: *interlock_group
    on_turn_on:
      - script.execute: failsafe
    on_turn_off:
      - script.stop: failsafe

  #=== Zone Relay 7
  - platform: gpio
    name: Garden Irrigation Relay Zone7
    id: relay7
    pin: 
      number: 27
      inverted: True
    restore_mode : ALWAYS_OFF
    interlock: *interlock_group
    on_turn_on:
      - script.execute: failsafe
    on_turn_off:
      - script.stop: failsafe

  #=== Zone Relay 8
  - platform: gpio
    name: Garden Irrigation Relay Zone8
    id: relay8
    pin: 
      number: 18
      inverted: True
    restore_mode : ALWAYS_OFF
    interlock: *interlock_group
    on_turn_on:
      - script.execute: failsafe
    on_turn_off:
      - script.stop: failsafe

  #=== Reboot
  - platform: restart
    name: ${friendly_name} Reboot
    id: reboot


#=== Scripts
script:

  #=== Set failsafe time converted to milliseconds
  - id: failsafe
    then:
      - delay: !lambda |-
          return id(failsafe_time).state * 1000;
      - switch.turn_off: relay1
      - switch.turn_off: relay2
      - switch.turn_off: relay3
      - switch.turn_off: relay4
      - switch.turn_off: relay5
      - switch.turn_off: relay6
      - switch.turn_off: relay7
      - switch.turn_off: relay8

Thanks! I am planning on using your github irrigation project once I get the hardware working.
This will save me a lot of time. What IO expander are you using? I have the 8574 io expander but it is not being detected. I have tried addresses 0x21 and 0x20 with no luck.

Hi there…

i have 8 Zones and 1 Main Relay. How can i add this Main relay to open before zone 1 starts and close after the last zone?

Thanks in advance

Edit: Solved:
garden_irrigation_triggered_cycle_start.yaml:
#=== Run all the zones in turn
- service: switch.turn_on
target:
entity_id: switch.yourswitch


#=== CYCLE END PROCESSING
- service: switch.turn_off
target:
entity_id: switch.yourswitch

1 Like

Also:
Is it possible to add a language page where all the Labels can be defined? To change them to german :wink:

1 Like

Why is here always 0 Minutes?