Garden Watering Automation

 


                                     Automation Note: Manually Triggered Actions & Counters


 

Your Wattmon web interface now has the option of creating counter-based and manually triggered actions. This note will explain how to use both to automate watering your garden.

 

Creating Global Variables

 To create the variable that will act as the counter, go to Control Panel > Package Manager. A page like in Fig. 1 should appear. In the Downloaded Package List section, there should be an ID called VariableWidget. Click on Action > Configure.

 

Fig. 1: Package Manager

 

 Here, you can enter a name for the global variable that will act as a counter. For the garden watering example, the counter is named “sprinkler” as seen in Fig. 2. Be sure to keep all letters of the global variable name lowercase and do not include any spaces; underscores will work. Click on Apply Changes.

 

Fig. 2: Widget Configuration

 

 

Creating Actions

 

Once the counter variable is created, you can set up the actions to trigger the watering based on the newly created counter. Go to Control Panel > Actions. The first action will be to turn on the sprinkler when the counter is greater than 0. Under the Actions Settings section give the action a name, here it is named “Switch on sprinkler (counter),” choose “All of the below conditions match,” and set the status as “Always Enabled.”

 

 Under the Action Trigger Condtion(s) section, you will specify the triggering conditions as the counter being greater than 0 and the relay output for the gardening system being off. In this example, the role that turns on and off the watering system is Relay Output 1, however, yours may be a different relay output.

 

 The first condition is set as “Global Variable” for Value Type, “sprinkler” for Value 1, “Is Greater than” for Comparison, “Fixed Value” for Value 2, and “0” for Value 2 Type. The second condition is set as “Device Variable,” “Relay Output 1,” “Is Equal To,” “Fixed Value,” and “0.” This is saying that when the sprinkler (counter) is greater than 1 and when the relay output 1 is turned off, the action will be triggered.

 

 In the Actions to Execute section, you will need to specify that the relay output 1 will be switched on. Set the Actions as “Switch On,” and Variable as “Relay Output 1.” Refer to Fig. 3 for clarification.

 

Fig. 3: Switch on Sprinkler (counter-based)

 

 The second action will be to turn off the sprinkler based on the counter. This will turn off the relay output when the counter reaches 0. In the Action Settings section, give the action a name, “Switch off sprinkler (counter),” choose “All of the below conditions match,” and set the status as “Always Enabled.”

 

In the Action Trigger Condition(s) section, specify that the action will take place when the counter is equal to 0 and the relay output is on. The first condition is set as “Global Variable” for Value Type, “sprinkler” for Value 1, “Is Equal To” for Comparison, “Fixed Value” for Value 2, and “0” for Value 2 Type. The second condition is set as “Device Variable,” “Relay Output 1,” “Is Equal To,” “Fixed Value,” and “1.”

 

In the Actions to Execute section, you will need to specify that the relay output 1 will be switched off. Set the Actions as “Switch Off,” and Variable as “Relay Output 1.” Refer to Fig. 4 for clarification.

 

 

Fig. 4: Switch Off Sprinkler (Counter-Based)

 

The third action will decrease the counter value when it is on. This will act as a timer to when certain actions will take place that are triggered by the counter being equal to 0. In the Action Settings section, give the action a name, “Counter decrease,” specify when it is active, “Any of the below conditions match,” enter “1” into the box for Delay (secs) before trigger, and choose “Execute at a fixed interval (seconds).” This is saying that when the counter is greater than 0, it will decrease by one every second.

 

In the Action Trigger Condition(s) section, set “Global Variable” for Value Type, “sprinkler” for Value 1, “Is Greater than” for Comparison, “Fixed Value” for Value 2, and “0” for Value 2 Type. This is specifying that the action will be triggered when counter value is greater than 0.

 

In the Actions to Execute section, choose “Add to Global Variable” for the Action, “sprinkler” for the Variable, and “-1” for the Value. Refer to Figure 5 for clarification.

 

Fig. 5: Counter Decrease

 

 The next two actions will be manually triggered actions meaning that you can cause them to happen from your dashboard.

 

The fourth action will be to add a set amount of time to the counter. In the Actions Setting section, give the action a name, “Add to Sprinkler Time,” specify when it is active, “Any of the below conditions match,” and choose “Maunally triggered” for the Status. In the Actions to Execute section, choose “Add to Global Variable” for the Action, “sprinkler” for the Variable, and a number, in seconds, for the counter to count down from for the Value. Here, the action is adding five minutes to the counter time every time the add-to-counter-button on the dashboard is clicked – showing 300 seconds for the Value. Refer to Fig. 6 for clarification.

 

Fig. 6: Add To Counter

 

The last action will be to set the counter to 0. This will be another manually triggered action that can be accessed from the dashboard. This will allow you to turn off your relay if you do not want it to be on for the full specified time the counter is set on.

 

In the Actions Setting section, give the action a name, “Sprinkler Time to 0,” specify when it is active, “Any of the below conditions match,” and choose “Maunally triggered” for the Status. In the Actions to Execute section, choose “Set Global Variable” for the Action, “sprinkler” for the Variable, and a number “0” for the Value. Refer to Fig. 7 for clarification.

 

Fig. 7: Counter to 0

 

Now, you will be able to automate when your garden sprinkler turns on and off from the dashboard. The counter allows you to see how much time is left in the watering cycle. You will also be able to manually add a set amount of time to the counter if you wish to water for a longer period of time, or you can manually turn off the watering if you wish to not have the watering lasting for the usual amount of time. In Fig. 8 below, you can see what the actions' layout will look like, Control section, and the sprinkler counter, Variables section.

 

 

Fig. 8 Dashboard