Skip to content

Irrigation Strategy

Paolo Grasso edited this page Jul 25, 2020 · 1 revision

General info

This strategy behaves similar to the generic control strategies. The differences are:

  • Hours appended in the hour timetable are the same as they are on the catalog, not anticipated.
  • The get_results() function is replaced by the method irr() of the Actuator class.
  • The presence of Actuator, DelayedIrrigation and MQTT publisher classes.

Actuator

A class containing the method irr() which check on dynamic catalog all modifications about the current irrigation time. Then it acts in different ways depending if the irrigation has been delayed or anticipated.

  • No delay: It publish, with the help of the MQTT publisher class, a message with irrigation parameters.
  • Positive delay (posticipated irrigation): Create an instance of the DelayedIrrigation class which in turn creates a thread with a timer corresponding to the amount of delay. When the countdown finishes, it publish the MQTT message with irrigation parameters.
  • Negative delay (anticipated irrigation):
    1. It publishes the MQTT message with the irrigation parameters
    2. It POSTs on catalog the new (anticipated) irrigation hour which will be active from the following day.

Additional note

There is the possibility when an irrigation MQTT message is not published, this happens during rainy days as the duration of irrigation would be changed to a negative number. In this case the strategy simply does not publish.

Clone this wiki locally