Git Product home page Git Product logo

irrigation-v5's Introduction

hacs_badge my_badge

GitHub Workflow Status (with branch) GitHub Workflow Status (with branch) GitHub release (latest by date)

Would you like more language support? Can you help with a translation? Contact me!

Create a PR, contact me using the community link above, or raise and issue on github, tutorial.

V5.4.15 - Beta

  • Add water source monitoring as an attribute of a zone.
  • Stop zone attempting to run when the run time is 0.
  • Fix custom card deployment.
  • Improve treatment of unavailable zone switches.

Irrigation Component V5 drawing

The driver for this project is to provide an easy-to-use interface for the gardener of the house. The goal is that once the initial configuration is done all the features can be modified using the custom lovelace card.

This program is essentially a scheduling tool, one user has used this to schedule the running of his lawn mower, so the use is far broader than I anticipated.

Watering can occur in an ECO mode where a water/wait/repeat cycle is run to minimise run off by letting water soak in using several short watering cycles. Great for pots.

Supports watering by time or volume.

A number of sensor inputs are available to stop or modify the watering based on external inputs.

  • The rain sensor is implemented as a binary_sensor, this allows a sensor to suspend the irrigation. This can be defined at the zone level to allow for covered areas to continue watering while exposed areas are suspended.
  • The water adjustment provides for a factor to be applied to the watering time/volume either increasing or decreasing watering based on external inputs
  • Scheduling can be configured to support regular watering every number of days or it can be configured to only water on specific days of the week. The schedule can also be supplied by a sensor to allow for changing the watering frequecy automatically based on the season or forecast data.
  • The OpenWeatherMap History control provides sensors that may be useful, this provides access to history and forecast weather information to allow you to expose sensors that can be used.

The program issues Home Assistant events so you can undertake other automations if required.

There is also support for a pump or master solenoid, running programs or zones sequentially or concurrently.

The custom card renders the program configuration as a card ans is installed automatically. It exposes in addition to the state of each of the configured helpers:

  • the remaining run time for the program and zone
  • the last run and/or next run details

This tutorial will get a basic setup running.

INSTALLATION

HACS installation

  • Adding the repository using HACS is the simplest approach. From V5.3 a Custom Card deployed with the component, no need to install separately.

Important

  • Make sure that all of the objects you reference i.e. switches, sensors etc are defined or you will get errors when the irrigationprogram is triggered. Check the log for errors.

Config Flow

  • Define the program using the UI. From Setting, Devices & Services choose 'ADD INTEGRATION'. Search for Irrigation Controller Component.
  • Add the integration many times if you want more than one program.
  • Modify programs and zones, add new zones, delete zones

Basic Configuration

You need to define the entities that allow you to control the features you want. I have have moved away from defining the helpers in YAML and create them via the Helpers tab in the Settings, Devices and services paged, I find it easier and there is no need to restart HA when you add new ones. Create the following for a basic setup.

For the Program create these helpers:

  • Input_datetime for the program start time (time only)
  • Input_boolean to support the enabling/disabling of the program
  • Input_select to define the frequency you want the zone to run, you can do this on the program if you want and save a few entities but I have different frequencies on some zones

For each Zone create these helpers:

  • Input_number to provide the duration of the watering cycle

This tutorial will get a basic setup running, have a read of the notes below and try a few of the other features.

Test configuration

testhelpers.yaml provides the helper configuration to support all the objects for three zones. A set of template switches for the zones and pump as well as inputs to emulate rain and flow sensors.

This allow me to test the program without triggering any 'real' solenoids, and will allow you to mimic your configuration in new versions to ensure an operational configuration after coming out your winter hinernation.

Be aware this is a sumulation, variatons in latency or behaviour of indivdual implementations will have an impact.

Debug

Add the following to your logger section configuration.yaml

logger:
    default: warning
    logs:
        custom_components.irrigationprogram: debug

The following services support testing and debugging:

  • irrigationprogram.reset_runtime service will reset the last run details
  • irrigationprogram.run_simulation will list details of the program based on the currently set attributes

Rain Sensor feature

If a rain sensor is defined the zone will be ignored when the value of the sensor is True.

If the irrigation program is run manually the rain sensor value is ignored and all zones will run.

The rain sensor is defined in each zone. You can:

  • Define the same sensor for each zone
  • Have a different sensor for different areas

If the rain sensor (or other sensor) prevents scheduled watering the program will retry the next day.

Time or Volume based watering

Watering is by default time based, that is, will run for the minutes set in the water entity.

You can define a flow sensor on a zone that provides a volume/minute rate. eg litres per minute. Once defined the water attribute will be read as volume eg 15 litres not 15 minutes.

Start time

You can define the start time using two methods.

  • As an input_datetime
    • This supports selecting the start time

image

  • As an input_text
    • This allows you to input multiple start times for the program
    • Time format MUST be hh:mm:00, 24 hour time format with 00 as seconds e.g. 18:55:00
    • Each time MUST be seperated by a ','
    • Use this regex pattern to help ensure the correct time structure (([0-2][0-9]:[0-5][0-9]:00)(?:,|$)){1,10}
    • If no valid time is supplied the start time will be defaulted to 08:00:00

image

Run Days and Run Frequency

Run frequency allows the definition of when the program will run. This can be provided as dropdown helper or a sensor, see OpenWeatherMap History

Frequency can be set on the zone or program. If both are set the zone level frequency is used. If no frequency is provided the program will run every day at the specified start time. Application at the zone level allows different zones to execute at the same time of day but use varying frequencies. for example: Vege Patch every two days and the Lawn once a week.

The values provided can be:

  • numeric, representing how often to run every 2 days for example.
  • days of the week; Mon, Tue etc. These currently only support english abreviations.
  • Off or any unsupported text to stop the zone being run.

For Australians you can select to water on specific days of the week to support water restriction rules.

Defining a Dropdown helper to use with the run_freq attribute, for example:

    options:
      - off
      - 1
      - 2
      - 3
      - Wed, Sat
      - Mon, Wed, Fri
      - Mon, Tue, Wed, Thu, Fri, Sat, Sun

Unscheduled execution of a zone or program

When a program or zone is triggered manually the following rules are applied:

If the Program is disabled it can still be initiated manually to run all enabled zones.

  • If the Program is disabled and the Zone is enabled the zone will run if manually started,
  • If the Program is disabled and the Zone is disabled the zone will not run,

If the Zone is disabled it will not run until it is enabled.

  • the zone is disabled, or
  • the zone frequency is 'Off'

These sensors will be defaulted:

  • Water Adjustment will default to 1
  • Rain sensor will default to off

ECO feature

The ECO feature allows multiple short watering cycles to be configure for a zone in the program to minimise run off and wastage. Setting the optional configuration of the Wait, Repeat attributes of a zone will enable the feature. Perfect for pots and can reduce water used by 50%.

  • wait sets the length of time to wait between watering cycles
  • repeat defines the number of watering cycles to run

Pump or master solenoid

You can optionally define a pump/master soleniod to turn on concurrently with the zone. The pump class then monitors the zones that require it and will remain active during zone transitions. The pump will shut off a few seconds after a zone has completed alowing a smooth transition between zones. The pump is only started and monitored when water in started by the custom control.

Water source monitoring

You can define a binary sensor that monitors the availability of the water source. For example if your well can run low on water this will have the following impact:

  • If a zone is running the zone will be stopped.
  • A zone will not start until the sensor inticated (on) that water is available.

Zone Group

You can optionally configure zones to run concurrently. Create a switch group, group helper. This feature allows you to group switches together to operate as a single switch.

You can use this 'new' switch to define a zone in the program.

Monitor Controller Feature

If you have binary binary sensor that indicates the status of the watering system hardware, you can use this to prevent this system from initiating watering until the system is active.

For example I use an ESPHome implementation to control the hardware it exposes a status sensor, should the controller lose power or connectivity to Wi-Fi the custom control will not initiate the watering. There is also be a visual indication on the custom card of the status of the controller.

Additionaly, zone switches that are not in a known (on, off) state will not be executed, and a warning message will be logged.

Watering Adjuster feature

As an alternative to the rain sensor you can use the watering adjustment feature. With this feature the integrator is responsible to provide a multiplier value using a input_number or sensor component. I imagine that this would be based on weather data or a moisture sensor.

If a program or zone is run manually the adjustment is ignored and executed with the adjuster value of 1.

See the https://github.com/petergridge/openweathermaphistory for a companion custom sensor that may be useful.

Setting water_adjustment attribute allows a factor to be applied to the watering time.

  • If the factor is 0 no watering will occur
  • If the factor is 0.5 watering will run for only half (50%) the configured watering time/volume. Wait and repeat attributes are unaffected.
  • A factor of 1.1 could also be used to apply 110% of the water defined watering.
  • If you want to water in seconds apply a factor of .0167 will be an approximate solution

Interlock

Turn off running programs when a new program is started, this is the default.

Note Change this on all program configurations to get consistent behaviour.

With interlock enabled:

  • If Program 1 and Program 2 have the same start time neither program will run and a warning is logged.
  • If Program 2 starts while Program 1 is running Program 1 will be terminated and Program 2 will run, a warning will be logged.

With interlock disabled:

  • If Program 1 and 2 overlap both programs will continue to run.
  • If a running zone is started by the second program a warning is logged.

Events

The program_turned_on event provides the following:

  • scheduled: false indicates the program was run manually
event_type: irrigation_event
data:
  action: program_turned_on
  device_id: switch.test
  scheduled: true
  program: test

The program_turned_off event provides the following:

  • completed: true indicates the program was not teminated manually
event_type: irrigation_event
data:
  action: program_turned_off
  device_id: switch.test
  completed: true
  program: test

The zone_turned_on event provides this information:

  • scheduled: false indicates the zone was run manually
event_type: irrigation_event
data:
  action: zone_turned_on
  device_id: switch.test
  scheduled: true
  zone: dummy_3
  pump: null
  runtime: 59
  water: 1
  wait: 0
  repeat: 1

The zone_turned_off event provides this information:

  • latency: true indicates that the zone could not be confirmed as off
  • state: the state of the switch when the event was raised
event_type: irrigation_event
data:
  action: zone_turned_off
  device_id: switch.dummy_3
  zone: dummy_3
  latency: false
  state: "off"

The zone_became_unavailable event provides this information:

event_type: irrigation_event
data:
  action: zone_became_unavailable
  device_id: switch.test
  scheduled: false
  zone: dummy_2
  pump: switch.dummy_pump
  runtime: 59
  water: 1
  wait: 0
  repeat: 1

An automation can then use this data to fire on the event you can refine it by adding specific event data.

alias: irrigation_program_starts
description: "do something when the program is initiated on schedule, not manually"
trigger:
  - platform: event
    event_type: irrigation_event
    event_data:
      action: program_turned_on
      scheduled: true
action: ---- Put your action here ----
mode: single

CONFIGURATION

CONFIGURATION VARIABLES

The definition of the YAML configuration:

Attribute Type Mandatory Description
    start_time input_datetime, input_text Required Entity to set the start time of the program. From V5.4 a list of times from an input_text helper will allow the program to run multiple times e.g. 10:00:00, 12:00:00, 14:30:00. Format must be HH24:MM:00
    run_freq input_select Optional Indicate how often to run. If not provided will run every day
    controller_monitor binary_sensor Optional Detect if the irrigation controller is online. Schedule will not execute if offline
    irrigation_on input_boolean Optional Allows the entire program to be suspend, winter mode
    inter_zone_delay input_number Optional Allows provision for a delay, in seconds, between a zone completing and the next one starting.
    zones data for setting up a zone
      - zone switch Required This is the switch that represents the solenoid to be triggered
        water input_number, sensor Required The time to run or volume to supply for this zone
        water_adjustment sensor, input_number Optional A factor, applied to the watering time to decrease or increase the watering time
        wait input_number Optional Wait time,in minutes, of the water/wait/repeat ECO option. The effective irrigation time of a zone is water * repeat. Example : If 5 minutes is define in wait and repeat = 2, the final watering duration will be 10 minutes but the run time will be 15 minutes
        repeat input_number Optional The number of cycles to run water/wait/repeat
        pump switch Optional Define the switch that will turn on the pump or master soleniod
        water_source_active binary_sensor Optional Sensor to monitor if the water source, e.g. well has water
        flow_sensor sensor Optional Provides flow rate per minute. The water value will now be assessed as volume
        rain_sensor binary_sensor Optional True or On will prevent the irrigation starting
        ignore_rain_sensor input_boolean Optional Ignore rain sensor allows a zone to run even if the rain sensor is active
        zone_group input_text Optional Zone Group supports running zones concurrently.
        frequency input_select Optional Indicate how often to run. If not provided will default to the program level value
        enable_zone input_boolean Optional Disabling a zone, prevents it from running in either manual or scheduled executions, adding 'Off' or similar text value to the run_freq helper will have the same result
        interlock input_boolean Optional If set, the default, the program will stop other running programs when triggered

SERVICES

stop_programs:
  description: Stop any running programs and zones.

run_zone:
  description: run a specific zone.
  fields:
    entity_id:
      name: Irrigation Program
      description: The irrigation program to run
      required: true
      selector:
        entity:
            integration: irrigationprogram
    zone:
      name: Zone
      description: Zones to run
      required: true
      selector:
          entity:
            domain: switch
            multiple: true

reset_runtime:
  description: reset the runtime back to none for the program supports testing.
  fields:
    entity_id:
      name: Entity ID
      description: The irrigation program to run
      required: true
      selector:
        entity:
            integration: irrigationprogram

run_simulation:
  description: Simulate running a program, exectution logic is not called, the functions are and results shown in the log.
  fields:
    entity_id:
      name: Entity ID
      description: The irrigation program to test
      required: true
      selector:
        entity:
            integration: irrigationprogram

list_config:
  description: List current configuration to the log.

REVISION HISTORY

V5.4.15

  • Add water source montioring as an attribute of a zone.
  • Stop zone attempting to run when the run time is 0.
  • Fix custom card deployment.
  • Improve treatment of unavailable zone switches.

V5.4.13

  • Stop pump monitoring starting when program is not required to run
  • Add list_configurtion service to support debugging
  • Prevent blank names for a program
  • Correct issue where program update was not recognised unless a restart
  • update HA calls being depricated

V5.4.10

  • Fix issue with pump monitoring
  • Fix issue when no frequency is specified
  • Fix issue when program manual run overlaps with scheduled run of the program
  • add icons.json

V5.4.5

  • BREAKING CHANGE: Remove group functionality.
    • Grouping zones can now be achieved using a switch group helper provided by Home Assistant to present multiple switches as a single switch that can be configured as a zone in this component.
    • There is some loss of functionality, in this new model all switches will have the same parameters, you will no longer be able to have a goup of zones that have different watering times but run concurrently.
    • The helper grouping model is supported already in the current version.
  • Correct numeric frequency problem
  • Fix issue introduced with V2023.11 of HomeAssistant

V5.4.2

  • Handle scenario where zone switch becomes unavailable mid run
    • Add irrigation_event/zone_became_unavailable event see Events
  • Codify the behaviour when a zone or program is disabled see Unscheduled execution of a zone or program
  • Remove warning messages

5.4.0

  • improved handling of offline solenoid switches
  • support multiple start times for a program

5.3.5

  • Custom Card deployed with this component, no need to install separately. Uninstall the old HACS Custom Card.
  • Custom Card updated so each zone setting can be expanded independently.
  • Custom Card updated to add configuration form
  • Fixed issue with WeatherHistory Frequency and water adjustment.
  • Added support for RainBird controller
  • Add scheduled/manual options for program simulation

5.2.10

  • addded support for watering time to be supplied using a sensor

5.2.9

  • Fix issue with rain sensor
  • Fixed issue with next run attribute

5.2.8

  • resolve incorrect next run for numeric frequency where scheduled run did not proceed
  • Add scheduled/manual options for program simulation

5.2.7

  • Add next run time attribute. Custom Card will also need to be updated
  • Fix spelling mistakes in en.json and strings.json
  • Fix stop not working as expected in custom card

5.2.6

  • refine the manual run behavior, zones will run unless explicitly disabled.
  • expand events: program_turned_on, program_turned_off, zone_turned_on, zone_turned_off when a program starts.
  • remove requirement for datetime sensor.

5.2.5

  • remove zone switch monitoring to get around problem with zone switch latency causing the program not to run
  • Add warning when latency exceeds 5 seconds when turning off the switch, the switch was not in an 'off' state after 5 seconds

5.2.4

  • Handle high latency switches

5.2.2

Deprecation notice:

  • yaml configuration support has been depricated
  • Add input via a sensor for frequency.

5.2.1

  • Correct issue #15

5.2.0

  • Groups in config flow
  • Vary Interlock behaviour of programs
  • Expand event data provided
  • Italian translation file
  • Support interactive value changes during program execution
  • Link solenoid switch behaviour (off only) with the custom component
  • Ability to turn off zones instead of the whole program
  • Warnings raised in the log when a program is stopped by another program or service call
  • Additional attributes have been added to the event data for the start of a zone
  • Add a 5 second delay before zone stops when zero flow is indicated by the flow meter
  • Implement hass.config_entries.async_forward_entry_setups required for HA
  • Exclude inactive zones, switch is unavailable, from program runs

5.1.19

  • Fix issue with reloading after a config flow change
  • Add program remaining time attribute
  • Optimise start and stop logic
  • Optimise polling logic

5.1.18

  • Modify HACS deployment to provide download count from GITHUB

5.1.16

  • Correct weekday list to work with legacy model

5.1.15

  • Initial HACS release
  • correct config flow handling on a new install
  • correct initialisation of last run time on new install
  • correct recording of run time against disabled zones
  • confirm non numeric/day values in the frequency helper will disable the zone, e.g. 'Off'
  • allow comma separated text for weekday list, not case sensitive
  • add German translation for config flow

5.1.0

  • Config Flow - configure via UI
  • REMOVED - generated helpers as they are incompatible with config flow

5.0.10

  • Generated helpers based on entity name not friendly name
  • Correct pump issue
  • Requires custom Card 5.0.10

5.0.9

  • Optimise pump class
  • Correct watering adjustment and runtime issues

V5.0.7/8

  • Still fixing water adjustment defect
  • Improve validation

V5.0.6

  • Fix water adjustment defect
  • Modify zone monitoring for pump activation
  • Added configuration option for watering time min, max & step

V5.0.5

  • Fix bugs

V5.0.4

  • Fix bug introduced with reset/uninstall

V5.0.3

  • Create selection list helper for frequency if one is not defined
  • Add config option to reset/uninstall created helpers

5.0.2

  • Update Event model now irrigation_event event with action of 'zone_turned_on'.

5.0.1

  • Implement zone_turned_on event to allow custom triggering of other automations if required
  • Bug fixed where get_last_state is None

5.0.0

  • Essentially the same functionality as version 4
  • Major redevelopment of the configuration
  • Auto create helper entities that do not require intervention. All input_boolean, input_text, input_number, input_datetime are now created automatically if required.
  • When optional functionality requires a helper only the friendly name is required to trigger the creation of the object.
  • Requires Irrigation Custom Card V5.0.0

irrigation-v5's People

Contributors

archipita avatar kwithus avatar petergridge avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

irrigation-v5's Issues

Master pump go off between zone

Hello

First thanks for your work !

I have define 3 zone and i have 1 master pump, same pump is in each zone configuration but when zone 1 is finish pump go off before start again for zone 2 ?
I wanna keep pump on for all the program, perhaps i have miss something in configuration ?

Thanks
Best Regards,

Water switch never turns off

Hello,

After upgrading to version 5.2.0 I've noticed that sometimes the water switch remains ON forever. Happens about 1 out of 10 times.
I've added a few debug prints and saw this:

  • Function async_turn_on in irrigationzone.py is called and turns ON the water switch successfully.
  • No flow sensor is configured.
  • Going into wait-cycle loop: "while watertime > 0: seconds_run += 1"...
  • Then the call to "if self.check_switch_state()" returns TRUE (meaning switch is OFF). Even though the switch was just turned ON 1 sec before.
  • The program exists with "stop = True", but the switch remains ON forever.
  • Even the call to "self.async_turn_off" at the end doesn't turn OFF the water switch.

Maybe there is a race-condition between when the switch is turned ON, and when you test if it's OFF.
There is a 1sec sleep between, maybe it's not enough?

Thank you.

Factor in soil humidity to runtime adjustment?

Hi there, i've got a basic program up and running, along with an entity set up using the "Factor utilising forecast rain and probability of precipitation" from the "openweathermaphistory" integration to supply a value for water adjustment.

My query is less of an issue, more of a question: is there a way to also adjust the runtime based on current soil humidity? I have a soil humidity sensor in the irrigation zone, and i'd love to also shorten the runtime if the soil humidity is too high (i.e. it hasn't rained but it's been super cloudy and wind-less so the soil hasn't lost much water).

I'm not much of a gardener, so i'm really trying to make my whole thing as "hands off" as possible, so i'm looking to basically make a program that takes a default runtime (10 mins?) then factors in current soil moisture percentage, the amount of rain in the last 4 days, and the forcasted rain for the next 2, and adjusts the program accordingly.

Any chance i could get some help accomplishing this? I'd like to eventually expand to having multiple zones based on different plants that are more or less water-demanding, but getting this up and running as a proof of concept would be awesome!

A few questions

Hello,

first, thanks for this great custom component!
I have two questions:

  1. Is it possible to add an mositure sensor to your integration ? I haven't found anything about this yet. This would be very helpful to calculate how much water is needed.
  2. Is the component counting the amount of rain if I provide an rainsensor ? Or will it only skip the irrigation if there were some rain today ?

Thanks!

Water adjustment using moisture sensor

I have set up the integration for watering 5 pots on my balcony.

I'm using drip watering controlled by solenoids connected to an 8x relay connected to an ESP32 and this is working perfectly.

I have MiFlora moisture sensors in the pots, and have set up a watering adjustment sensors based on the readings from these sensors.

This works but I've noticed that when the moisture increases during a watering cycle (and the watering adjustment sensor is changed accordingly) the watering time will dynamically be reduced in the middle of the cycle. This is suboptimal from my way of thinking.

I could probably work around it, but I would like a setup where the cycle time is fixed at start and not adjusted during the cycle. Is this possible?

Rain Sensor Not Expected Behavior

I was waiting for appropriate conditions to test this. I just had some rain conditions come through, but the program did not follow expected behavior. Although the rain sensor was "on" in each zone, the scheduled program was not prevented from running those zones. (The manual program was also not prevented from running, although that is expected behavior).

My rain sensor is a threshold binary sensor. The input is sensor.openweathermap_rain, with the threshold set to trigger an "on" value when openweathermap rainfall is above 0.

Frequency sensor issue

I've made a frequency sensor with the help of the history Integration. This sensor has value: Mon, Tue, Wed, Thu, Fri, Sat, Sun

This sensor I used in either program, single zone or multiple zones, it doesn't work. The Integration doesn't load.

Then I used ["Mon","Tue","Wed","Thu","Fri","Sat","Sun"]
Then the Integration is loaded but the next run shows Off. Not the expected behaviour

Enable_zone not visible in custom card

When enable_zone entity is specified from the integration config, does not create an input_boolean toggle switch in the custom card.

Enable_zone works correctly within the integration. The state of the input_boolean can be changed manually, and the desired action will work correctly to either enable or disable the zone. However, there is no toggle switch added to the custom card to allow changing the state from within the custom card itself.

issue when adding new zone

Investigating why the irrigation fails when a new zone is added.

Work around - restart HA after updating the config using config_flow

run_freq multiplied

Hi, is there any way I get rid of run_freq tab of each zones I declare in config? I have to mention that none any zones has run_freq declared, I left it blank when I set it up; beside this It keep showing up. I also tried to edit switch.py but no success
Screenshot 2023-03-31 at 22 23 36

Program never runs

I am getting the following error message. I have uninstalled/re-installed multiple times without luck. I have multiple programs and each of them use different parameters. They all use a inputnumber for runtime.

Logger: homeassistant
Source: custom_components/irrigationprogram/switch.py:564
Integration: Irrigation controller (documentation, issues)
First occurred: October 20, 2023 at 8:00:00 PM (6 occurrences)
Last logged: 12:40:23 PM

Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/config/custom_components/irrigationprogram/switch.py", line 631, in async_turn_on
zones = await self.build_run_script(False)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/irrigationprogram/switch.py", line 564, in build_run_script
zone.run_time(repeats=zone.repeat_value(),scheduled=self.scheduled)
^^^^^^^^^^^^^
AttributeError: 'IrrigationZone' object has no attribute 'run_time'

ECO Mode with multiple zones question

I would like to have a program that runs at 8:00, 10:00, 12:00, 14:00, 16:00, 18:00, 20:00.
I have 4 zones inside, each zone should run for 5 minutes. Once one finishes, then the next one runs.

Is this config correct in my case? Is there a way I can see the config YAML? Any way I can test and/or simulate it?

image

Question about water_adjustment

Hello.
water_adjustment feature sensor should be defined as "runtime ajustment entity" on the zones configuration right?

Thank you.

Migration error

Thanks a lot for improving this component, very good idea to integrate the card!

After updating to V5.3.3 and V5.3.4 I get this error and the program doesn't run anymore:

Logger: homeassistant.config_entries
Source: custom_components/irrigationprogram/__init__.py:134
Integration: Irrigation controller ([documentation](https://github.com/petergridge/irrigation-v5), [issues](https://github.com/petergridge/irrigation-v5/issues))
First occurred: 8:21:16 PM (1 occurrences)
Last logged: 8:21:16 PM

Error migrating entry Bewässerung for irrigationprogram
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 633, in async_migrate
    result = await component.async_migrate_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/irrigationprogram/__init__.py", line 134, in async_migrate_entry
    new.pop(ATTR_SHOW_CONFIG)
KeyError: 'show_config'

Any idea?

Bug introduced in 5.2 beta 2

Beta two is broken, I cannot start any program or zone, Error at line 252 irrigationzone

Please roll back to version 5.2 beta, this release has a bug with wait repeat cycle but still runs.

Card showing config cog but doesn't open - was ok / then not ok

Hiya,

Had an earlier version of the IrrigationProgram Custom Component card that was showing the config cog but wouldn't open the configuration panel... However I updated the IP Custom Component to V5.4.2 and it seemed to fix it / everything seemed to be working fine (all elements showing)... That is until last week when for no reason (haven't touched the integration since), the config cog on the card isn't working again (won't open the config panel) per this screenshot below. I've uninstalled and setup the integration (V5.4.2) from scratch again, however I get the same issue...

Screenshot 2023-10-22 110754

Screenshot 2023-10-22 111043

It was working fine before, showing start time, enable timer, next run, last run, frequency, duration, etc. - now i don't get anything (even if i reinstall the integration from scratch) and applying the standard card YAML below...

Screenshot 2023-10-22 111731

If it helps any, here's a list of the entities created by the integration for the Back Lawn Program...

Screenshot 2023-10-22 112654

I'm sure i'm just doing something dumb on my end... Let me know if you need any more info.

Kindly.

Move changing attributes, last ran, remaining time to sensors

To fit in with HA's model to move attributes to sensors to reduce the impact on the history I will create sensors for remaining time and last ran attributes.

A change will also need to be made to the custom card to support this. Card changes will be made to support both versions to prevent a breaking change

time_date issue

Good day

I'm experiencing an error when running the program.

When utilising the switch or the 'run' button on the card, the switch fails due to a time_date error.

time_date is defined in the config and shows on the overview page.

On the lovelace card, there is also an oddity next to the 'run' buttons for each zone except for the 1st zone. This shows a static date of 9 January 2023, 2:35:14PM for each, and is not related to the Time input helper value.

Any idea of what I might have done wrong?

thanks

Logger: homeassistant.components.websocket_api.http.connection
Source: util/dt.py:132
Integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 3:53:33 PM (5 occurrences)
Last logged: 4:19:38 PM

[548191012224] not a valid date/time.
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 200, in handle_call_service
await hass.services.async_call(
File "/usr/src/homeassistant/homeassistant/core.py", line 1755, in async_call
task.result()
File "/usr/src/homeassistant/homeassistant/core.py", line 1792, in _execute_service
await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)(
File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 213, in handle_service
await service.entity_service_call(
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 678, in entity_service_call
future.result() # pop exception if have
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 958, in async_request_call
await coro
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 715, in _handle_entity_call
await result
File "/config/custom_components/irrigationprogram/switch.py", line 430, in async_turn_on
if zone.should_run() is False:
File "/config/custom_components/irrigationprogram/irrigationzone.py", line 254, in should_run
- dt_util.as_timestamp(self._last_ran)
File "/usr/src/homeassistant/homeassistant/util/dt.py", line 132, in as_timestamp
raise ValueError("not a valid date/time.")
ValueError: not a valid date/time.

image

Unable to configure in integration entries

Hi, noticed this problem recently. when i go to integration entries and click configure on my already configured setup i get the following error:
Screenshot 2023-11-03 083924

I was able to add entry and do a new configuration as a test, but once its applied and I try to "configure" it i get the same error. The programs still seem to be running fine.

Anyway, I know you're on vacation, no rush. Just wanted to put it out there.

thank you

Naming of Version 5 folder

Hi Peter
Happy New Year
I have an issue with my HA installation and appear to have 2 copies of your repository for Version 5 off the irrigation program. It appears you have changed the name of the GitHub repository and used both "-" and "_" so there have been irrigation-V5 and irrigation _V5.
I get the following error in the HA logs:-

This error originated from a custom integration.

Logger: custom_components.hacs
Source: custom_components/hacs/repositories/base.py:466
Integration: HACS (documentation, issues)
First occurred: 08:03:17 (5 occurrences)
Last logged: 08:36:25

<Integration petergridge/irrigation_V5> GitHub returned 404 for https://api.github.com/repos/petergridge/irrigation_V5

This error originated from a custom integration.

Logger: custom_components.hacs
Source: custom_components/hacs/repositories/base.py:466
Integration: HACS (documentation, issues)
First occurred: 08:03:17 (5 occurrences)
Last logged: 08:36:25

<Integration petergridge/irrigation_V5> GitHub returned 404 for https://api.github.com/repos/petergridge/irrigation_V5

In HACS itself I see 2 repositories but there is no option to remove the one that points to the "_" version. I've looked but can't find where HACS stores the list to manually remove it.

image

Interleave Zone

Hello,

I didn't find any way to interleave zone irrigation, I mean during waiting time of Z1, start Z2, during waiting time of Z2 if waiting time of Z1 is over restart Z1 if not start Z3 and so on.

The purpose is to limit the flow according to pump capacity. Let waiting time for soaking for each zone. Optimise watering time by running another zone when one zone is waiting for soaking.

Regards.

Run time defaults to switch device max

Hi…

been using this for a few years now, has always worked great!

my sprinkler device is Orbit B-hyve (has worked flawlessly with your integration for the last 2 plus years). It appears to have a default run time of 10 mins per zone when activated. This never used to be a problem in the past. I would set the zone runtime via your integration and all was good

with the new configuration, I find the at the switch is using the default runtime of the b-hyve device, so the max I can run a zone is 10 mins regardless ow what my runtimes are set for.

Not sure if this is in your integration or the b-hyve one, so I will start here

your help, and work on this is appreciated as always!

Dave

Error when stop program

When I stop on of my 2 programs, I have the following error

Logger: homeassistant.core
Source: custom_components/irrigationprogram/__init__.py:75
Integration: Irrigation controller ([documentation](https://github.com/petergridge/irrigation-v5), [issues](https://github.com/petergridge/irrigation-v5/issues))
First occurred: 17:52:36 (2 occurrences)
Last logged: 17:55:29

Error executing service: <ServiceCall irrigationprogram.stop_programs (c:01GX6FGNPJTMCX3KSMVVXCDDPC): ignore=Prog2>
Error executing service: <ServiceCall irrigationprogram.stop_programs (c:01GX6FNZ1CDAQC8H6KA55X64R9): ignore=Prog2>
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/core.py", line 1826, in catch_exceptions
    await coro_or_task
  File "/usr/src/homeassistant/homeassistant/core.py", line 1845, in _execute_service
    await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)(
  File "/config/custom_components/irrigationprogram/__init__.py", line 75, in async_stop_programs
    if hass.states.get(device).state == "on":
AttributeError: 'NoneType' object has no attribute 'state'

Visual Issues

Good morning,

I come from a previous version. I have created an irrigation configuration where I have filled in the fields Start time entity, Run freq entity, Enable irrigation entity, show conf entity.
I have created two zones, both filling the same fields, zone switch entity, water runtime entity, rain sensor entity, ignore rain sensor entity.

When I show the data in the card I see that in zone 1 the last ran field does not appear while in zone 2 it does appear. In addition it does not allow to change the name of the zones as formerly it was allowed through the yaml.

Should I delete all the old configuration, or is there something I am not configuring correctly?

Captura de pantalla 2023-01-24 153411

Captura de pantalla 2023-01-24 153321
Captura de pantalla 2023-01-24 153505
Captura de pantalla 2023-01-24 153434

inter_zone_delay does not work

inter_zone_delay seems to do nothing.
With a delay of 5min (or any other value) the program simply stops one zone and goes to the next one. Even the total counter does not consider it.
In the example below I have a delay of 5min and 3 zones (each with 5min also).

image

Program shutting down with no flow

I finally got your program installed - A few minor issues I will give feedback on later when I have more time.

In summary, A very impressive and simple to use system, I think it is going to work perfectly for my application

But I have come across an issue during my initial testing. I had it working well and then decided to add zone enable switches. as well as a intra zone delay for the pump. The issues only turned up after that. (but just be aware, I only tested it once before that so my experience is very limited

Now when I try to run a zone manually, It appears to turn on solinod and then turn off solinod before the pump has even turned on , or at least not enough time to get water to the flow meter so it can register. I have attached what logs and information that I have. I will try and recreate under full logs tomorrow morning.

I am based in Perth, so if it is unclear, I have no issues going thru on the phone or direct chat if easier.

Well done on a great looking program

2023-02-03 06:05:10.797 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration irrigationprogram which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2023-02-03 06:05:14.430 ERROR (MainThread) [custom_components.irrigationprogram.switch] Sensor.time not defined check your configuration
2023-02-03 06:05:50.727 WARNING (MainThread) [custom_components.irrigationprogram.irrigationzone] No flow detected, turning off solenoid to allow program to complete
2023-02-03 06:06:25.775 WARNING (MainThread) [custom_components.irrigationprogram.irrigationzone] No flow detected, turning off solenoid to allow program to complete
2023-02-03 06:06:38.579 WARNING (MainThread) [custom_components.irrigationprogram.irrigationzone] No flow detected, turning off solenoid to allow program to complete
2023-02-04 00:40:05.629 WARNING (MainThread) [custom_components.irrigationprogram.irrigationzone] No flow detected, turning off solenoid to allow program to complete
2023-02-04 00:41:19.192 WARNING (MainThread) [custom_components.irrigationprogram.irrigationzone] No flow detected, turning off solenoid to allow program to complete
2023-02-04 00:43:41.234 WARNING (MainThread) [custom_components.irrigationprogram.irrigationzone] No flow detected, turning off solenoid to allow program to complete
2023-02-04 00:55:56.215 WARNING (MainThread) [custom_components.irrigationprogram.irrigationzone] No flow detected, turning off solenoid to allow program to complete
2023-02-04 00:56:14.691 WARNING (MainThread) [custom_components.irrigationprogram.irrigationzone] No flow detected, turning off solenoid to allow program to complete

image

Problem with irrigation Frequency / Openweather Map / Unit Type

Dear petergridge,

thank you very much for your effort, your irrigation automation seems to satisfy my needs to a large extent.
two small problems / questions have and I and maybe you have an answer to them:

  1. if I create a sensor as specified in the documentation via the Openweathermap History as a template and want to return numbers for the irrigation frequency, then I always get a value e.g. 2.0 instead of 2 or 4.0 instead of 4. But your Irrigation can not handle this, so that the irrigation remains inactive.

Example:
{% set avgtemp = (forecast1max + forecast2max + forecast3max)/3 -%}
{% if avgtemp < 10 -%}
Off
{% elif avgtemp < 20 -%}
4
{% else -%}
2
{% endif -%}

  1. if I use the above example with strings:

{% set avgtemp = (forecast1max + forecast2max + forecast3max)/3 -%}
{% if avgtemp < 10 -%}
Off
{% elif avgtemp < 20 -%}
Mon, Fri
{% else -%}
Mon, Thu, Sat
{% endif -%}

Then there is always the newline character at the end (\n). It only works if I make the query without spaces:

{% set avgtemp = (forecast1max + forecast2max + forecast3max)/3 -%}
{% if avgtemp < 10 -%}
Off
{% elif avgtemp < 20 -%}
Mon, Fri{% else -%}
Mon, Thu, Sat{% endif -%}

Maybe you have an idea.

Many greetings

Robert

Irrigation_event (action: program_turned_on) is not call when no zone active or rain sensor is true

event program_turned_on is not fired when in the program no zones are ok to rain (disabled or rain).
In my example I have 5 zones (4 disabled and 1 enable but this last one have the rain sensor to true)

event_type: irrigation_event
data:
  action: program_turned_on

I think rain sensor must be called each time program is call even if zones turn off or rain sensor set.
The question should be asked for zone turned_on event... ???

In my case I have to compute the rain sensor state before each irrigation programs launch..
Compute past rain and daily rain forecast.

config flow error

Super useful integration...I have one issue however: It is not possible for me to edit a program created in config flow. The error

Config flow could not be loaded: {"message":"Handler does not support user"}

is returned when hitting the 'configuration' button on the integration page.

I can delete and recreate a new program without issue, it is just not possible to edit. I'm not sure if this relates to my setup somehow or is a bug.

Running Irrigation version 5.4.2 and HA
Core
2023.11.2
Supervisor
2023.11.3
Operating System
11.1
Frontend
20231030.2

Support for Master pump

Good day,

My current irrigation setup has a master selonoid that needs to be turned on before I can activate any of the zone selonoids. This is is done to avoid having the zone selonoids under continuous pressure and increase their life span.

For e.g. to activate zone 1, I need to enable two switches in home assistant ( Master pump switch

  • zone 1 pump switch). Similarly to activate zone 2 I should enable both master pump and zone 2 switches and so on

Is there a way to support this setup in the irrigation component?
Thanks

Latency issue?

I'm not sure if its related to this but if I manually run a zone the delay to on state and countdown is huge around 17sec. I thought it has something to do with my old switch but now I have new one and still have this issue.
When I run the full program manually, the switch starts instantly.

Originally posted by @maxoss in #22 (comment)

Question about starting zones one after the other

Dear Petergridge,

I hope this message finds you well. I'm currently facing a situation where I have 12 valves but insufficient water pressure to open all of them simultaneously. Because of this, I'm interested in initiating the zones individually, without having to input a specific time for each zone. Ideally, I would like to designate a start time for the first zone or program, and considering that each zone has a designated run time, have them operate consecutively. To achieve this, it seems necessary to group the zones together. However, based on my understanding, grouping the zones currently results in simultaneous operation, which isn't what I'm aiming for.

Could you kindly confirm if this functionality is available, or would I need to create a separate program for each zone? The latter approach tends to get confusing with multiple start times, and any adjustments to the programs could potentially lead to overlapping. Do you have any suggestions or ideas to address this challenge?

Thank you for your assistance.

Best regards,
Robert

Amount of rain from weatherstation => skip program

Hello @petergridge ,

this is not a bug, it's more a question or feature request. I want to skip the irrigation program when in the last 48h the amount of rain exceeds a specific value (let's say 15mm).

I have already a custom sensor which calculates the amount of rain of the last 48hrs.
I thought about having a helper binary sensor which i then use for the rain sensor instead of the rain sensor itself.
image

I'm relative new on HA, how can i define a helper from type template binary sensor which is "true" when the amount of rain sensor is > 15mm ? Or is there any other option in your integration to skip rain when the rain in 48hrs value exceeds 15mm

image

Implement hass.config_entries.async_forward_entry_setups

ntegrations need to be refactored to replace calls to hass.config_entries.async_setup_platforms with hass.config_entries.async_forward_entry_setups and/or await all hass.config_entries.async_forward_entry_setup to ensure that Home Assistant does not inadvertently reload the integration while entities and platforms are still being set up.

hass.config_entries.async_setup_platforms is scheduled to be removed in 2022.12.

Disabled status for toggles after a HA restart

Hi @petergridge ,
first of all, thank you so much for this great component! I really appreciate it! 🙏
I have a problem regarding the binary_sensor's status recovered after a HA restart. In other words, both binary_sensors (program config and program relay config) created by the integration through the input_boolean "enable configuration" and "enable program", are initialized to the False value after a restart...even if the related input_booleans are True.

I have attached some screenshots if they could help you to understand better:

Screenshot 2023-10-11 at 10 45 01 Screenshot 2023-10-11 at 10 44 53 Screenshot 2023-10-11 at 10 46 00 Screenshot 2023-10-11 at 17 04 15 Screenshot 2023-10-11 at 17 20 53

So, after a HA restart, I've to re-enable the four toggles (two for each program).
Please if you could help me.
Thanks a lot,
Fabio

Next run unavailable

Hi,

Since the new version when I restart HA all next run are 'Unavailable'
Any ideas ?
Thx

Problem for compute next running programm time when rainy sensor is true

Hi
Last version of irrigation V5 !

I'm making test for next summer ;-)
I have just one rainny sensor (for all my zone) wich is true when I don't want irrigation.
If Y have a planned next running to 20:00:00 (or 8h00 PM),

  • At 8h00 PM the programm is launched but all zones doesn't start (if rainsy sensor is true). OK at this stage
    The problem is after that, the "next cycle" displays the the time of last canceled cycle (cause of rainy sensor) instead of next compute running cycle time...
    Strange because we have in "next cycle" : a past time instead of future time ;-)

For me, the process should be when rainy sensor is true :

  • last cycle of the zone must be unchanged
  • next cycle of the zone must be the date of the next compute cycle , maybe tomorrow if frequency is on 1 day

I think it is a small bug ;-)

What is yours opinions ?

Incorrect frequency calculations

Hi,

The frequency calculation doesn't seem to work properly with integer values. See screenshot attached. It correctly picks up that it ran yesterday, but wants to run again today regardless of integer. Selecting a specific day value is ok.

I can send any other details if they're useful. It displayed ok right after watering, but looking at it the next day shows this.

Home assistant has been restarted since the watering ran, not sure if that is a factor. I can try to check if that is related.

Thanks,
Philip

Screenshot_20231020_135508_Home Assistant
Screenshot_20231020_135736_Home Assistant
Screenshot_20231020_135743_Home Assistant

A zone does not turn on if it has "Pump switch entity"

A zone does not turn on if it has "Pump switch entity".

If the zone has entity pump in the settings, watering the zone will not turn on. The watering time is then displayed but there is no countdown.

If I manually turn on the pump before starting the program, the integration turns it off.

Helper creation in 5.2alpha

Hi,
Just planning on setting up irrigation v5, On paper it looks perfect for my application. With the changes to the structure I am finding it hard to determine what i have to create in Yaml and what i have to create in the UI and what helpers that i need to generate and in the upcoming releases are these done automatically. Is the latest alfa release fully UI based... If it is happy to do some new user beta testing. I dont want to invest hours into yaml only to have you release a new update

Program config not visible

Dear Peter,

I've noticed one small thing in the latest version (5.3.5). The program configuration is not displayed within the irrigation card, so, for example, it's no longer possible to define the program start time through the Irrigation Card. Only the zones are displayed and can be expanded individually. The zones work as expected!

grafik

Program don't start at the time

Hi
I'm testing irrigation v5
When I want to check program, I change the start time to 1 or 2 minutes after now and the program don't start.
The program starts correctly when I click on RUN.

What is the procedure for the changing time. Do I need to restart HA ?

Thanks for your help

Just a question about time based watering

Hi, first of all, great job with this component: I used to have a bunch of automations to enable and disable irrigation each day of the week, and I had to deduplicate them in order to have a double irrigation slot in a day. Now I'm able to schedule the irrigation without any hassle!

My question is: as I have a little balcony and not a big garden, is it possible to set the time based watering with seconds and not minutes? Or maybe to have a switch that permits you to choose between one and the other magnitude?

Thank you.

Custom card is not visible

Let me start by declaring that I am by no means an advanced user when it comes to HA, so it is entirely possible that what I am describing below is somehow the result of my lack of understanding and/or knowledge.

I tried installing the custom card component from HACS, as described here, however it does not show up in the options available when I am trying to add it to my dashboard.

The entry is visible under Studio Code Server. Am I missing something here?

Home Assistant 2023.7.2
Supervisor 2023.07.1
Operating System 10.3
Frontend 20230705.1 - latest

Card showing config cog but doesn't open

Hi,

When I add the card to a dashboard, the configuration option doesn't open the configuration panel any more. It opens details as per this screenshot.

It used to work fine. I've switched to the included card from the separate HACS one and it didn't make a difference.

Screenshot_20231014_205534_Home Assistant
Screenshot_20231014_205538_Home Assistant

Watering Adjuster feature not working

Hi, i created a number helper for watering adjustment 0 -2 increase 0,1.
My Problem is, it isn't working. My guess is the increase is seperated with a comma not an dot.
But this setting comes through my home assistant language settings.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.