Watering Methods

Used to change the watering state of a Skydrop controller.

Table of Contents #

GET /controllers/{controller_id}/water.state #

Retrieve the watering state of the given controller.

Query Fields

  1. controller-id (string) - The public id for the controller

Example Request

$.ajax({
    type: 'GET',
    url: '[api url]/controllers/{controller-id}/water.state',
    contentType: "application/json"
});

Response

  1. success (boolean) - The state of the call
  2. zone_states (array) - An array of all zones and their states

POST /controllers/{controller_id}/water.all #

Start watering all zones, starting with the first zone.

Query Fields

  1. controller-id (string) - The public id for the controller

Example Request

$.ajax({
    type: 'POST',
    url: '[api url]/controllers/{controller-id}/water.all',
    contentType: "application/json"
});

Response

  1. success (boolean) - The success of the call

POST /controllers/{controller_id}/zones/{zone_num}/water.zone #

Start watering a single zone.

Query Fields

  1. controller-id (string) - The public id for the controller
  2. zone_num (string) - The zone number

Example Request

$.ajax({
    type: 'POST',
    url: '[api url]/controllers/{controller-id}/water.zone/{zone_num}',
    contentType: "application/json"
});

Response

  1. success (boolean) - The success of the call

POST /controllers/{controller_id}/water.stop #

Tells the given controller to stop watering

Query Fields

  1. controller-id (string) - The public id for the controller

Example Request

$.ajax({
    type: 'POST',
    url: '[api url]/controllers/{controller-id}/water.stop',
});

Response

  1. success (boolean) - The success of the call

GET /controllers/{controller_id}/last.next.water #

Gets the controllers next and last Smart watering schedule

Query Fields

  1. controller-id (string) - The public id for the controller

Example Request

$.ajax({
    type: 'GET',
    url: '[api url]/controllers/{controller-id}/last.next.water',
});

Response

  1. smart_watering (array) - The previous and scheduled smart waterings for each zone
smart_watering: [
    {
        last_watering: "string" or false if never been watered,
        next_watering: "string",
        zone_id: int
    }
]

GET /controllers/{controller_id}/{start_day}/week.watering.history #

Gets the controllers watering statistics for the specified week

Query Fields

  1. controller-id (string) - The public id for the controller
  2. start_day (string) - The first day of the desired week in MM-DD-YYYY format

Example Request

$.ajax({
    type: 'GET',
    url: '[api url]/controllers/{controller-id}/{start_day}/week.watering.history',
});

Response

  1. object - The controller's watering statistics for the week specified
{
    start_date: string,
    end_date: string,
    zones: array,
    total_gallons: int,
    total_liters: double,
    times_watered: int
}

GET /controllers/{controller_id}/watering.forecast #

Gets the forecast watering for the next week

Query Fields

  1. controller-id (string) - The public id for the controller

Example Request

$.ajax({
    type: 'GET',
    url: '[api url]/controllers/{controller-id}/watering.forecast',
});

Response

  1. array - Each day's expected watering forecast for the coming week
[
    {
        date_time: date,
        prec: double, // day precipitation
        icon: string, // icon indicating general weather condition for the day
        temp: int, // high temperature
        temp_low: int, // low temperature
        sprinkled: double, // forecast inches of watering
        date_abr: string, // day of week abbreviation
        date_day: string, // numeric day of month 
        zones: array // array of zones to be watered
    }
]