I had a working yaml based irrigation system, it worked but it was not easy to set up. So I bit the bullet and decided to educate myself in the arcane art of custom components.
I am now up to version 5 with config flow and a custom card and the component and related custom card are available on HACS.
Please visit the GITHUB repository for full details
All the inputs of the new platforms are Home Assistant entities for example the start time is provided via a input_datetime entity. The information is used to define a template internally that is evaluated to trigger the irrigate action according to the inputs provided.
Watering can occur in an Eco mode where a water/wait/repeat cycle is run to minimise run off by letting water soak as a by using several short watering cycles.
The rain sensor is implemented as a binary_sensor, this allows a practically any combination of sensors to suspend the irrigation. Additionally being implemented as a switch you can start a program or zone based manually or using an automation. There is also the ability to ignore the rain sensor at the program or zone level so sheltered areas can be watered even if the rain sensor has been activated.
Hi Peter, are you still maintaining this? It blows me away you havenât gotten way more traction with this considering that irrigation control is consistently a top thread in the HA forumsâŚ
Thanks for the feedback Iâm still using it. And your the first person to make contact so I havenât had any changes for a while. Itâs been very stable for my purposes.
I find it easier to maintain than loads of yaml.
Iâm using esphome for the esp8266 and it works a treat.
You will also need to define the zones referenced to relate the zone to a switch entity you have already set up in HA. This is where you set up the default watering for each zone so you donât have to set it in each program.
I just want to say thank you this great project. Itâs been 3 days so far and the the component is working as intended. My sprinklers kicked on at the exact time. Te configuration was very simple.
this is how mine look.
Thanks for your work on this, Iâve used some of it, and had to change some stuff as I have a slightly different setup. But itâs been really useful.
Hi
Not sure if this is still maintained, but set it up and get this in the logs
Logger: homeassistant.setup
Source: custom_components/irrigation/init.py:213
First occurred: 14:51:25 (1 occurrences)
Last logged: 14:51:25
Error during setup of component irrigation
Traceback (most recent call last):
File â/usr/src/homeassistant/homeassistant/setup.pyâ, line 213, in _async_setup_component
result = await task
File â/config/custom_components/irrigation/init.pyâ, line 213, in async_setup
template_entity_ids = template.extract_entities()
AttributeError: âTemplateâ object has no attribute âextract_entitiesâ
Peter
Thank for this I will give it a go.
Currently I have esphome onfigured with the automations on the esp. I then activate the the solenoids by a service call so that the logic runs on the esp. That way if the esp looses connection to the server or on the case of a power failure, the solenoids will close.
I still have not figured out how to have a running timer on home assistant to display the remaining time.
In my new repository I have the yaml I use for ESPHOME. I have a max runtime setting that limits the time a solenoid can run as a catchall should the esp loose connection to HA.
let me know how you go with the new rep, no one else has picked this version up that I know of.
I see that now. I will do I need to reconfigure my esphome devices.
By the way when I first loaded I am getting a device not found for the program entity is this correct
Hi, Check your switches in the zones definition are correct for example: zones: - zone: switch.pot_plants - zone: switch.front_lawn
these switches need to be defined and are typically those exposed by your ESPâs
I have updated my sample code to fix this if you copied my examples.
It was more the switch.morning that I was concerned about switch.morning, that is a entity not found. The I am concerned that the irrigation program component did not run correctly?
The zone switches will be updated once I expose and connect the Esp
Logger: homeassistant.components.switch
Source: custom_components/irrigationprogram/switch.py:192
Integration: Switch (documentation, issues)
First occurred: 9:24:49 (3 occurrences)
Last logged: 9:24:49
Error adding entities for domain switch with platform irrigationprogram
Error while setting up irrigationprogram platform for switch
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 315, in async_add_entities
await asyncio.gather(*tasks)
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 506, in _async_add_entity
await entity.add_to_platform_finish()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 530, in add_to_platform_finish
await self.async_added_to_hass()
File "/config/custom_components/irrigationprogram/switch.py", line 192, in async_added_to_hass
self._last_run = state.attributes.get('last_ran')
AttributeError: 'NoneType' object has no attribute 'attributes'
I have updated the irrigationprogram, switch.py. Can you copy it and try again. Thanks for working through this. This is the first time this has been installed from scratch from the github repository.