Let's work on creating a, almost, simpified irrigation controller configuration

I don’t have time to really analyze this right now and make suggestions (hopefully tomorrow).

A couple quick scan comments though:

  • Consider applying one of the Alarm Clock examples to trigger the irrigation run rather than a static cron trigger so you can change the start/stop time from the sitemap

  • You should probably hold on to the references to the Timers you create to turn on the zones so you can check whether they are running and/or cancel them later. Also, see this posting for an example of how to create a relay where the shutting off of one zone starts up the next zone instead of creating all the Timers all at once. This couple provide a bit more control.

  • I think you can get the predicted precipitation from Wunderground at a minimum. You would probably have to use an HTTP pull and XSLT transform to extract it but it would be nice to include both rain that has already fallen and rain predicted to fall, not just the weather conditions. You could have a 100% chance of rain tomorrow but a prediction of only .01" total in which case you might want to irrigate anyway. The Rachio (my current solution which I’m VERY happy with) does something like this. If the amount of rain today plus the amount predicted before tomorrow is above a certain amount it doesn’t water. I can post an example of how I get today’s precipitation in inches this way if desired for an example.

  • Why the cron trigger on “Disable irrigation if any rain?” Why not just run once a little before or immediately before the irrigation is scheduled to start. We really only care if we need to skip it at that time.

  • rainThreshold should be an Item you can adjust from the sitemap. Some user may want to water more in the heat of a dry summer and less in the cooler/wetter spring and fall.

  • It is a little cleaner to put your Icon sates into a Set and then just test to see if rainToday and rainTomorrow are in the list:

val Set<String> rainConditions = newImmutableSet("chanceflurries", "chancerain", ...)

...

    // in rule
    var boolean rainForcast = rainConditions.contains(Weather_Today_Icon.state.toString) || rainConditions.contains(Weather_Tomorrow_Icon.state.toString)

    if (rain > ...
    else if (rainForecast) {
        logMessage = "Rain is forecast - irrigation disabled!"
    }
  • Outsource your logMessage to a separate Item and Rule so you can centralize how you implement your notifications. See this posting for an example.
1 Like