MTry / homebridge-smart-irrigation

Turn any electrical irrigation valve into a smart-valve.. or run your pumps on a smart schedule based on your climate! This homebridge plugin exposes a multi-zone irrigation sprinkler dummy control system to Apple's HomeKit. Although a dummy, it brings smarts of an evapotranspiration based climate and plant adaptive irrigation controller with the use of OpenWeatherMap API. The plugin can optionally email you, and/or send you push notifications through Pushover or Pushcut, with the watering schedule it has calculated, or when a watering run is completed, along with the next 7-day weather forecast. Added option to expose system controls to Homekit allowing a user to enable/disable irrigation, rechecks, push and email notifications from within the Home App. Associated WaterLevel Characteristic shows the % of watering cycle remaining.
MIT License
78 stars 3 forks source link

[FEATURE REQUEST] A scheduling 2 times of watering per day #16

Closed Aekung closed 3 years ago

Aekung commented 3 years ago

Is your feature request related to a problem? Please describe.

First of all, thank you very much for this awesome plugin! It serves the purpose very well! However, I'm in a tropical area and it's required to water the plant 2 times a day. The the current function, the plugin only calculate the watering schedule in the morning of each day and decide whether to water the plant or not for the whole day. Will it be possible if it could calculate the watering 2 times a day both in the morning and in the evening so that it could actually help automating the watering schedule in tropical area.

Moreover, the rain factor is too tricky for the tropical area like in my country. Someday, the rain could be only the morning and then it's dam hot for the whole day and never rain again. When this occurs, the plugin would skip the watering for the whole day and it could lead to the dehydration of the plants since the weather is super hot after few hours of raining. If the plugin can calculate the rain factor 2 times a day, once in the morning and start again after 2 - 3 pm, I think it could prevent the dehydration problem from happening.

Describe the solution you'd like Plugin could calculate the watering schedule 2 times a day, once in a morning and again around 2 - 3pm. to see if it's gonna rain in the evening of the day. If not, and the watering schedule is not done in the morning, then the plugin could kick in and schedule the watering in the evening instead.

Additional context Not sure if it's too complicated in term of scripting but if it could work this way, this plugin would be perfect! Anyway, I'm already thankful of what you have done and cheer you up all the way.

Thank you.

Aekung commented 3 years ago

Also, are there anyway I could set the watering time? Right now, it's set to water at 5:38am, which is too early. Are there any possibility that I can set it to sometimes later like 8:00am?

Thank you in advance.

MTry commented 3 years ago

Thanks for your feedback.. at the outset it will take a significant work to make it water 2 times a day as the current logic would require a total overhaul. However, here are some of my thoughts based on your use case..

To answer your second query first - it is indeed possible to water around 8:00AM or even later in the evening if that is what you prefer! Change the 'sunriseOffset to a negative value - for example if you want the watering to get done by 2 hours after sunrise, you can use a value of '-120'! As a matter of fact the value of sunriseOffset can be -1440 to +1440 so theoretically you could choose to finish watering even 12 hours after sunrise in the evening while doing a recalculation 15 minutes prior to the watering run! If you dig deeper in the linked resources in Readme, you will notice that it is often advised to water early on in the morning as it allows the leaves to dry up during the day and also reduces the chances of mildew/fungus which can be an issue specially in tropical regions - something that will not happen when irrigation takes place in the evening. What we need is water to soak down to the roots rather than runoff - and this is best achieved when you water a little - wait and water a little more so that it gets a chance to percolate in the soil rather than runoff - you can achieve this by increasing the number of cycles upto 5 so all your zones are watered a little in each cycles replenishing the water requirement in 5 shots so to say. Remember - the moisture loss at the surface of the soil is a factor - but the amount percolated down to the roots is even more relevant. The heat after a rain is something a plant can deal with if its native to the region - and no amount of irrigation will solve the issue as such if the plant can't fundamentally take the sunshine it is exposed to.

Rainfactor - how I use it - turn it on for any zone exposed to direct rain so it can factor the amount of rain in calculations and turn it off for any zone not exposed - as this will in any case take into account the higher humidity and ETo when calculating the water requirement.

Estimations based weather are after all estimations - I do reduce the number of watering runs per week during monsoons as the same principles used during hot summers running over 40 degree centigrade do go a little overboard.

Aekung commented 3 years ago

Wow! Thank you very much for a very clear and concise explanation and the use case example. It helps me better fine tuning the schedule and etc. Very much appreciated.

I now set the Cycle per zone for 3 cycles with the Sunrise offset of -120 and the max time of 30 minutes in all zone.

I'm not really sure about the Rain Threshold though. The scale of 0 - 100 is in percentage of raining? In this case, if I set to 70, does it mean the watering will be skipped if the chance of raining is over 70%?

Again, thank you very much in advance.

MTry commented 3 years ago

Rain threshold is in mm - so you can set it at a level of rainfall in mm above which you do not want the irrigation to be carried out.

MTry commented 3 years ago

..to add to the above explanation, it does not look at the possibility of rain rather it takes into account the predicted precipitation amount.

Aekung commented 3 years ago

Got it now. Thank you very much. Sorry that I overlook the unit of measurement for Rain Threshold.

Thank you very much for your fast response.