Smart Irrigation - save water by precisely watering your lawn/garden

that could work - have not tried it. have you tried adding the component twice? does that work?

No this needs to be enabled in the integration i think. if you add it again it gives a warning this integration can be added once.

ah ok, let me check! Created an issue here: https://github.com/jeroenterheerdt/HAsmartirrigation/issues/4

Hi all, thanks for all the feedback! I have expanded the documentation to include explanation on how this works as well as examples. The following examples are in the current documentation:
- Example 1: one valve, potentially daily irrigation
- Example 2: one valve, irrigation depending on work day sensor
- Example 3: two valves, irrigation depending on work day sensor
- Example 4: one valve, with extra check on today’s forecast to avoid over-irrigation

Please keep the feedback coming!

Just wanted to share my implementation :slight_smile: maybe will it inspire others to make their own fancy use case of this great component.

Key points:

  • I added % adjustment on general level + on zone level … zones are not equal to each other so instead of adding several integrations IMHO it is better to simply tune duration where needed
  • I added max irrigation duration … just in case :slight_smile: I would not want to irrigate for 2 h is something would went wrong in calculations :slight_smile:
  • wanted to have a possibility to force irrigation even if Smart Irrigation component says “not needed” and also possibility to force stop sequence of the script.
  • added few scripts, timer, UI switches and other fancy things to have usable UI
  • automation is done in my node-red as I have all my automation there.

all done without touching component itself.

In HA frontend it looks like this:
Main screen:
image

icons are active and opening new cards e.g. zone settings look like this:
image

RainBird switches:
image

Stats:
image

Node-red part is very simple but yet highly usable thanks to “bigtimer node” :

PS:
Today we had a rainy day, that is why both hourly and daily adjusted run times are “0” :slight_smile:

jeroenterheerdt thanks again for your great work.

5 Likes

I’m trying to remove this integration (for now) but can’t.
Can you advise me what to do? Thanks

Fuller details are here

EDIT: Yes I can following the advice on the other thread but it has been suggested that you might be able to stop it happening for others.

wow, looks great, thanks for sharing! Any thing in here that we can generalize to embed in the component? What would you have loved to have in the component right away that you now have had to build yourself?

hi @klogg - thanks for checking in. I cannot do anything here, it is just a effect of how HA works. Any way, more interesting to me is why you chose to remove this component? Was anything missing / broken? What would you need to make this useful for you?

actually I would not change anything in the component itself :slight_smile: SI component only do calculations and this is perfectly fine as this approach gives us full flexibility on how to implement automation. If you would hard code some functionality, entire irrigation system would have to work as you designed which might not fit to everyone’s needs :slight_smile: With current approach everyone can tune final functionality as likes so that’s the best option for me.
ok … maybe one thing you may consider … please add attribute with minutes instead of seconds for run time. I got it via template sensor but could be done directly in the component sensors.

Anyway if you would want to hard code things, I would say that those are my “must have” itms:

  • option to define maximum irrigation duration … just in case if calcs goes wrong
  • option to define % adjustment per zone to tune irrigation time if zones are not equal
  • force mode - option to force next irrigation run with given duration, ignore standard calcs

As an improvement … seems sensor’s values are not persistent and every HA restart reset them to 0. Don’t know if that’s just my case or general issue or maybe “by design” :slight_smile: but you could add 2 services:

  • smart_irrigation.do_calcs_hourly_adjusted_run_time
  • smart_irrigation.do_calcs_daily_adjusted_run_time
    so again we could have a room for manipulation :slight_smile:
2 Likes

@jeroenterheerdt
No, nothing missing I think it is very cool what you have put together.

The reason I’m not using it for now is that I am just finishing off a project of my own for irrigation. It comes at it from a different perspective to yours in that it attempts to provide the whole package. It does include some rudimentary weather adjustments built in, which are based on some purely intuitive back of the envelope calculations and entirely non-scientific!

As such I think it wouldn’t be hard for me to build your calculations into my system and I definitely plan to revisit it later. There are few people using my system and I think they’d be pleased if I swapped in a ‘proper’ integration for my ‘bespoke’ one.

TLDR: Great work and I for one appreciate the approach you have taken to keep it separate from any actual irrigation logic.

1 Like

interesting … I noticed just now:

image

same “unavailable” state for hourly and daily sensors …

without touching anything few minutes later back again to normal:

image

errors captured in HA log:

2020-05-26 22:00:54 ERROR (MainThread) [custom_components.smart_irrigation.OWMClient] Failed to get OWM URL {"cod":"500","message":"Internal error: 500001"}
2020-05-26 22:00:54 ERROR (MainThread) [custom_components.smart_irrigation.OWMClient] Cannot talk to OWM API, check API key.
2020-05-26 22:00:54 ERROR (MainThread) [custom_components.smart_irrigation] Error fetching smart_irrigation data: 
2020-05-26 23:11:47 ERROR (MainThread) [custom_components.smart_irrigation.OWMClient] Failed to get OWM URL <html>
<head><title>504 Gateway Time-out</title></head>
<body>
<center><h1>504 Gateway Time-out</h1></center>
<hr><center>openresty</center>
</body>
</html>

2020-05-26 23:11:47 ERROR (MainThread) [custom_components.smart_irrigation] Error fetching smart_irrigation data: 'JSONDecodeError' object has no attribute 'strerror'

interesting :slight_smile:

@posixx happy to let you know you can now add this component multiple times.

Thanks for all your suggestions!

I have created these issues so I can track them:

can you elaborate a little bit more on this? not sure I understand.

also, the value for bucket should stay between HA reboots, is it not the case for you?

1 Like

happy to hear it!

openresty? I think Open Weather Map must have had an outage for a couple of seconds, because that is a return message from them…

ok, I went ahead and implemented the following:
-runtime in minutes
-maximum duration
-extra services.

force mode is still pending, need a bit more work for this.

2 Likes

thx for adding my “minutes” in attributes, pls add the same to the base index sensor :slight_smile: i will be able to get rid of few template sensors :frowning:

Re % adjustment … I think first of all you would have to add support for zones :slight_smile: but anyway this is what I currently implemented in my system -> as 2 layers of adjustments:

  1. generic adjustment … if I decide that "daily"run time is too short or too long I can adjust it by multiplying sensor result by some % defined. e.g. 10 min * 50% = 5 min applied for my irrigation

  2. second level is adjustment per zone. idea the same … if one zone is bigger than other one or have a different water flow I can adjust it by some %. e.g. 5 min * 100% for zone1 = 5 min but 5 min * 150% for zone2 = 7,5 min.

Of course at all adjustment levels I take into account general adjustment and general maximum irrigation time… full example :slight_smile:

  • daily run time = 10 min
  • general adj. = 50%
  • zone1 adj = 100%
  • zone2 adj. = 150%
  • max irrigation time = 6 min

calcs looks like that (done in sensor template):
zone1 duration = 10 min * 50% * 100% = 5 min
zone2 duration = 10 min * 50% * 150% = 7,5 min but set to 6 min as this is the max defined.

1 Like

Multiple zones is possible with the new version: you can add the intergration multiple times to HA; one for each zone. It will have some redundant config / fetch settings but it will do fine.

could you please verify service smart_irrigation.calculate_hourly_adjusted_run_time
seems doesn’t work as I tried to push my value into sensor and call service. didn’t changed back state of the sensor.

the other one “smart_irrigation.calculate_daily_adjusted_run_time” seems to works fine … i could push my value and service changed back to previous state.

bucket survives HA restart :slight_smile: but sensor’s state/value not. so if “daily” sensor is being set at 23:00 we should not restart HA after that time as we will loose sensor state and irrigation will not gonna happen. solution can be to call newly added service just before irrigation starts but it complicate things IMO