FORMAT: X-1A HOST: https://device.ip:8080/api/4/ # RainMachine RainMachine API version 4.5 for accesing [RainMachine](http://www.rainmachine.com) devices. Document revision 1.7. ### Compatible devices - 1st generation RainMachine: `hwVer: 1.0` partial support where noted - [RainMachine Mini 8](http://www.rainmachine.com/products/rainmachine-mini-8.html): `hwVer: 2.0` full support - [RainMachine Touch HD](http://www.rainmachine.com/products/rainmachine-touch-hd-12.html): `hwVer: 3.0` full support - [RainMachine Pro](http://www.rainmachine.com/products/rainmachine-pro.html): `hwVer: 5.0` full support For the [RainMachine Mini 8](http://www.rainmachine.com/products/rainmachine-mini-8.html), [RainMachine Touch HD](http://www.rainmachine.com/products/rainmachine-touch-hd-12.html) and [RainMachine Pro](http://www.rainmachine.com/products/rainmachine-pro.html) the RESTful interface is accessible via HTTPS on port **8080**. HTTP access is only allowed from localhost and it's bound to port 18080 With version *> 4.0.927* a HTTP access is allowed on port **8081**. A typical URL when accessing the machine directly should look like this: **https://device.ip:8080/api/4/** When accessing the device though *RainMachine Remote Access* service the URL should look like this: **https://my.rainmachine.com/** *For 1st generation RainMachine the RESTful interface is accessible via HTTPS on port 443 or via HTTP on port 80.* ### Allowed HTTPS requests - `POST` - Creates or updates a resource - `GET` - Retrieves a resource or list of resources ### Typical Server Responses - 200 `OK` - The request was successful - 400 `Bad Request` - The request could not be understood or was missing required parameters. - 401 `Unauthorized` - Authentication failed or user does not have permissions for the requested operation. - 404 `Not Found` - Resource was not found. - 405 `Method Not Allowed` - Requested method is not supported for the specified resource. - 460 `Cannot Change Password` - Cannot change password - 501 `Exception Occured` - Exception occured while processing the call - 540 `Database Error` - Error saving data to database - 541 `Provision Failed` - Cannot provision unit ### Typical Server Responses Message Bodies These are contained in the responses as response body. - `Success` : `{ "statusCode": 0, "message": "OK" }` - `ExceptionOccurred` : `{ "statusCode": 1, "message": "Exception occurred !" }` - `NotAuthenticated` : `{ "statusCode": 2, "message": "Not Authenticated !" }` - `InvalidRequest` : `{ "statusCode": 3, "message": "Invalid request !" }` - `NotImplemented` : `{ "statusCode": 4, "message": "Not implemented yet !" }` - `NotFound` : `{ "statusCode": 5, "message": "Not found !" }` - `DBError` : `{ "statusCode": 6, "message": "DB Error !" }` - `ProvisionFailed` : `{ "statusCode": 7, "message": "Cannot provision unit" }` - `PasswordNotChanged` : `{ "statusCode": 8, "message": "Cannot change password" }` - `ProgramValidationFailed` : `{ "statusCode": 9, "message": "Invalid program constraints"}` - `ServiceUnavailable` : `{ "statusCode": 10, "message": "Service unavailable, data not ready, retry later."}` - `WrongParserFormat` : `{ "statusCode": 11, "message": "Wrong parser format, cannot be loaded."}` ### Measurement units RainMachine uses International System of Units (metric). All parameters sent by API are expected to be in metric system. - `mm` being used for length, precipitation quantity (mm/m^2) - `m` is used for area (m^2), wind speed (m/s) - `celsius` is used for everything related to temperatures - `seconds` is used for durations unless specifically noted otherwise ### Authentication After authenticating [described below](#post-auth-login), additional API calls must contain the returned `access_token` as a URL parameter. Example: `GET /api/4/program?access_token=YOUR_ACCESS_TOKEN` ### Changes from API 4.0 to API 4.1 - **NEW** - `POST /dev/import/sshkey` Allow user to upload its own ssh key for login into RainMachine Touch HD. - **NEW** - `POST /parser/{id}/delete` Delete an existing user (custom uploaded) parser. - **NEW** - `POST /restrictions/hourly/{id}` Modify the specified hourly restriction. - **NEW** - `GET /restrictions/currently` Get a summary of currently active restrictions on device. - **NEW** - `POST /dev/beta` Subscribe to the beta channel for software updates - **NEW** - `POST /dev/trigger` Send a trigger to the notification server - **MODIFICATION** - `GET /watering/log` Added *userDuration* field - **MODIFICATION** - `GET /zone` Added *active* field - **MODIFICATION** - `GET /diag` Added internetStatus, uptimeSeconds, cloudstatus fields - **MODIFICATION** - `GET /watering/available` Added possibility to specify start date and days - **MODIFICATION** - `GET /watering/past` Added possibility to specify start date and days - **MODIFICATION** - `GET /dailystats` Return an error code if simulation is still being run - **MODIFICATION** - `GET /parser` Added lastKnownError, isRunning fields ### Changes from API 4.1 to API 4.2 - **NEW** - `POST /dev/parser/{id}/defaults` Reset parser parameters to default values - **NEW** - `GET /auth/totp` Generates a timebased one time password for guest/support access with 1 day valability - **MODIFICATION** - `GET and POST /program` Added *(optional)* startTimeParams that are used to set program start time at sunrise or sunset +/- a specified offset in minutes. - **MODIFICATION** - `GET /parser` Added description, hasForecast, hasHistorical fields for extra information about a parser. - **MODIFICATION** - `GET /program` Added simulationExpired to let clients know that a new simulation is being run for the program ### Changes from API 4.2 to API 4.3 - **NEW** - `POST /zone/simulate` Calculate values of Base Watering Time and Field Capacity with the specified zone parameters - **NEW** - `GET /provision/doy` Show the local stored EvapoTranspiratio values used when no weather is available - **MODIFICATION** - Added more values for water log flag: zwfRainSensorSoftware = 8 zwfRestrictionMonth = 9 zwfRestrictionRainDelay = 10 - **MODIFICATION** - 'GET /watering/queue' - Added *remaining* for zone timers including master valve, soak and delay events. - **MODIFICATION** - `GET /dailystats/details` Added *wateringFlag* field that list the day restrictions if they exists - **MODIFICATION** - `GET /zone/*/properties` Added *referenceTime* and *currentFieldCapacity* fields which represent calculated values from zone properties. - **MODIFICATION** - `GET /zone/*/properties` Added *area* and *flowrate* fields for galons/liters calculations. - **MODIFICATION** - `GET /programs/*` Added *userPercentage* field (float) which represent the user increase or decrease of the referenceTime for the zone. - **MODIFICATION** - `GET /programs/*` *futureField1* field now holds the QPF restriction for the program (to be renamed). ### Changes from API 4.3 to API 4.4 - **MODIFICATION** - `/provision` - Added *uiUnitsMetric* (boolean) as a way to save on device the measurement units set by different clients - **MODIFICATION** - `/provision` - Added *useBonjourService* to enable/disable the use of Bonjour discovery of RainMachine services (on by default) - **MODIFICATION** - `/provision` - Added *rainSensorSnoozeDuration* to configure how the snooze should be scheduled after rain was detected. Values: -1: Until midnight today 0: No snooze added it will stop watering only for the period that rain sensor detects rain >0: Number of seconds to snooze - **MODIFICATION** - `/provision` - Added *rainSensorRainStart* which holds the timestamp of the last recorded rain start. A *null* value means that rain was never detected. - **MODIFICATION** - `/zone/properties` - Added more soil types: **SandyClay(8), SiltLoam (9), Silt(10)** - **MODIFICATION** - `/zone/properties` - Added *minRuntime* which holds per zone minimum watering time in seconds. - **MODIFICATION** - `/program` - Added *minRuntimeCoef* in *wateringTimes* object. Each zone from *wateringTimes* can have this coefficient which changes the zone *minWatering* setting. This allows programs to have different minimum watering times than the ones set in zone properties. - **MODIFICATION** - `/program` - Added *order* in *wateringTimes* object and it's used to specify the order in which the zones in this program will start watering. By default *order* is the same with zone *id* (meaning zone 1 will start first and then zone 2). With *order* parameter it's possible to set *order: 2* for zone 1 and *order: 1* for zone 2 to reverse their starting order. When watering RainMachine will sort zones by *order* value (if multiple zones have same order they will be schedule one after another). The API client should set this order correctly for all zones involved in a program. - **MODIFICATION** - `/program` - Added *startDate* which holds the start date of a program. The format is *YYYY-MM-DD*. - **MODIFICATION** - `/program` - Added *endDate* which holds the end date of a program run. The format is *YYYY-MM-DD*. This is uses to have programs valid in certain months, for example programs that run from May till August. - **MODIFICATION** - `/program` - Added *yearlyRecurring* which specifies if the program should repeat or not in the next years. - **MODIFICATION** - `/program` - The *freq_modified* field is now parsed and contains the integer percentage for adaptive frequency. - **MODIFICATION** - `/machine/time` - Added *timestamp* and *timezone* fields to return the local time as unix timestamp and local timezone - **NEW** - `POST /watering/available` - This allows setting current Available Water value per program per zone. ### Changes from API 4.4 to API 4.5 - **MODIFICATION** - `/provision` - Added *automaticUpdates* (boolean) to enable or disable automatic updates. - **NEW** - `POST /watering/pauseall` - Pause all active watering for the specified duration. Calling this with duration set to 0 will unpause. - **MODIFICATION** - Added `RotorsHigh` as a sprinkler head type (release .931) ### Changes from API 4.5 to API 4.6 - **MODIFICATION** - `/provision` - Added *useFlowSensor* (boolean), *flowSensorClicksPerCubicMeter* (integer) to setup flow sensor and *lastLeakDetected* for the timestamp of last detection. - **MODIFICATION** - `/provision` - Added *carryOverInRestriction* to control if water deficit in a restriction should be carried to next water cycle. - **MODIFICATION** - `/provision/reset` - Added *reboot* (boolean) default true to reboot device after provision reset. - **MODIFICATION** - `/restrictions/currently` - Added *lastLeakDetected* as above. - **MODIFICATION** - `/watering/log/details` - Added *flowclicks* (integer) to read flow sensor clicks per zone or cycle - **NEW** - `POST /parser/data/` - Allow injecting Weather Data directly into RainMachine from a Weather Station or another source like weewx or cumulus mx. ### Changes from API 4.6 to API 4.6.1 - **NEW** - `GET /provision/wifi/ap` - This call will return the state of WIFI Access Point. Only usable on RainMachine Pro 8/16 - **NEW** - `GET /watering/flowmeter` - This call will return the flow meter values (initial, watering and leak clicks) - **NEW** - `POST /watering/flowmeter` - Ingest flow meter date from an external service # Group API versions ## GET /apiVer Returns the software, hardware and api level versions. *Available on 1st gen.* + Response 200 (application/json) { "apiVer": "4.3.0", "hwVer": 2, "swVer": "4.0.840" } # Group Authentication Authenticating with the device it's possible though our *remote access service* or *directly* with the device. The *direct* method can be used if you can access the device with a real IP, either on local LAN or though router forwarding. The *remote access service* provided by RainMachine is provided by https://my.rainmachine.com host and can be accessed from any location with internet access. ## Group Authenticate using https://my.rainmachine.com The following calls in the section should be prepended with **https://my.rainmachine.com/** as the URL. After authentication the rest of the API calls should use the **https://my.rainmachine.com/s/sprinklerID/api/4/** or the device url obtained from from the response of **/devices/get-sprinklers** call bellow as URL with `?access_token=` appended. ### POST /login/auth Authenticate with the RainMachine associated with an account. This call should be the first call performed when accessing the device remotelly as it will return an `access_token` that should be used on next call by appending it to the url ` ?access_token= ` If `errorType` field from the returned JSON is 0 the authentication is successful and the returned `access_token` and `sprinklerId` can be used for RainMachine API calls. If `errorType` returned is -1 then another call to **/devices/get-sprinklers** should be performed with the returned `access_token` included in URL. Other values for `errorType` are: - 0 - success the retuned token can be used to call API on RainMachine - -1 - the user has multiple sprinklers use the **/devices/get-sprinklers** call below to retrieve the list - 1 - the email has not been validated - 2 - no devices are connected to the cloud - 3 - the password provided is wrong - 4 - internal server error + Request (application/json) { "user": { "email": "{{EMAIL_ACCOUNT}}", "pwd": "{{PASSWORD}}", "remember": true } } + Response 200 (application/json) { access_token: 'string', errorType: 0, sprinklerId: 'string' } ### POST /devices/get-sprinklers Retrieve the list of RainMachine devices associated with the accound. To authenticate with a certain RainMachine the **/devices/login-sprinkler** call should be used. + Request (application/json) { "user": { "email": "{{EMAIL_ACCOUNT}}", "pwd": "{{PASSWORD}}", "remember": true } } + Response 200 (application/json) { "sprinklers": [ { "sprinklerId": "avs6hrm", "mac": "A8:30:38:21:6B:14", "name": "RainMachine 1" }, { "sprinklerId": "Xu3jrahd", "mac": "10:FD:CD:1B:35:05", "name": "RainMachine 2" } ] } ### POST /devices/login-sprinkler Authenticate with a RainMachine when knowning its *sprinklerId*. `errorType` is either 0 for *success* or 3 for *invalid credentials* To retrieve a list of RainMachine devices and their *sprinklerId* use the **/devices/get-sprinklers** API call (see below) After this call is successful the new `access_token` should be used for further API calls to the device by using either the *sprinklerUrl* obtained in the **/devices/get-sprinklers** call or by constructing a new URL in the form: ` https://my.rainmachine.com/s/" + sprinklerId + "/api/4" `. + Request (application/json) { "sprinklerId": "{{SPRINKLERID}}", "pwd": "{{PASSWORD}}" } + Response 200 (application/json) { "access_token": "68d56b3e368758ac6f8d6a848e831c1f92cd27e2fe44c21bc76db653", "errorType": 0, "sprinklerId": "{{SPRINKLERID}}" } ## Group Authenticate directly with device These calls can be used directly with the device by using the device standard URL: **https://device.ip:8080/api/4/** ### POST /auth/login Request auth with the device response will include a token to be used on subsequent calls *Available on 1st gen. Response: "access_token", "statusCode", "expires_in".* + Request (application/json) { "pwd": "{{PASSWORD}}", "remember": 1 } + Response 200 (application/json) { "access_token": "fb127e22a7cd1294df47cce8acb4cd88c87eb27236b0a3be7dfd1f82", "checksum": "14245b630a7affb06f7dad6004da60c0f928545e34f7e9c3dcf81ec747937bba06a1665ff61a6923fe12e8e4cc1057c89f25735f778c9b87", "expiration": "Mon, 09 Dec 2019 06:43:17 GMT", "statusCode": 0 } ### POST /auth/change Request a password change *Partial support on 1st gen: "newPass", "oldPass". Response: "statusCode", "message".* + Request { newPass: "newPass", oldPass: "oldPass" } + Response 200 (application/json) { "access_token": "13d45261540dc77f4cd130eaca2ce8ca7d42aa674dea76a9e2d24cd7", "checksum": "266ce876ab8df7f8e0d6e503a820eab39c60d1dd4a9b9f8ffcfdd746b0cf1c28868aa13dad57b4a7d1e07b0a5b8a602095dce7e291983415", "expiration": "Mon, 09 Dec 2019 06:50:03 GMT", "statusCode": 0 } ### POST /auth/check Request a password check. *Available on 1st gen. Response: "statusCode", "message".* + Request { "pwd": "password" } + Response 200 (application/json) { "statusCode": 0 } ### GET /auth/totp Generates a 6 characters Time-based One-time Password that can be used in subsequent auth calls for a limited duration guest login (1 day) + Response 200 (application/json) { "totp": 123456 } # Group Provision Device provision related functions ## /provision ### GET Get device settings #### System | Variable | Type | Description | | ------------------------------|------------|--------------------- | | `httpEnabled` | *boolean* | If the HTTP server is enabled | | `programSingleSchedule` | *boolean* | Allows multiple runs of same program in the same day (eg: rescheduled to another hour) | | `mixerHistorySize` | *integer* | The number of days mixer will save in it's history | | `programZonesShowInactive` | *boolean* | List program inactive zones in queries | | `standaloneMode` | *boolean* | If the device is configured but left in Access Point mode (no internet weather) | | `masterValveAfter` | *integer* | Seconds for which the master valve will open after each zone | | `apiVersion` | *string* | Version of software API | | `selfTest` | *boolean* | Reserved | | `defaultZoneWateringDuration` | *integer* | Default seconds that a zone will be watered when started manually | | `maxLEDBrightness` | *integer* | Maximum brightness for the front panel leds (0 - 255) | | `simulatorHistorySize` | *integer* | How many days to keep simulated data in database (default 0) | | `masterValveBefore` | *integer* | Seconds for which the master valve will open before each zone | | `touchProgramToRun` | *integer* | Which program can be run from touch interface on Mini 8 (id of program) | | `useRainSensor` | *boolean* | Set to true if you have a rain sensor connected. Will stop watering if rain is detected| | `wizardHasRun` | *boolean* | Indicates if the wizard from a mobile device has been run | | `waterLogHistorySize` | *integer* | How many days to keep watering information in database (default 365) | | `netName` | *string* | Device Name | | `touchSleepTimeout` | *integer* | After how many seconds of inactivity to close the leds on Mini 8 | | `touchAdvanced` | *boolean* | Activate touch panel advanced usage that allows queueing of zones on Mini 8 | | `hardwareVersion` | *integer* | Hardware version of the device (same as hwVer from /apiVer call) | | `touchLongPressTimeout` | *integer* | After how many seconds a long touch will register automatically on Mini 8 | | `parserDataSizeInDays` | *integer* | How many days of forecast parsers should get | | `programListShowInactive` | *boolean* | List inactive programs in queries | | `parserHistorySize` | *integer* | How many past days the parsers will keep in database | | `minLEDBrightness` | *integer* | Minimum brightness for the front panel leds | | `minWateringDurationThreshold`| *integer* | If calculated watering duration in seconds is lower that this the zone won't be started| | `localValveCount` | *integer* | Number of valves this device has available | | `touchAPSeconds` | *integer* | Delay after which the user won't be alloed to login when device is in setup mode | | `useCommandLineArguments` | *boolean* | If the application was started with extra arguments | | `databasePath` | *string* | File system path to the databases | | `touchCyclePrograms` | *string* | If the local touch interface on Mini 8 should also allow program start besides zones | | `zoneListShowInactive` | *boolean* | List inactive zones in queries | | `zoneDuration` | *int array*| Default list of zone durations for manual running | | `useCorrectionForPast` | *boolean* | If watering algorithm should also consider past weather data | | `useMasterValve` | *boolean* | If a Master Valve is connected to Valve 1 | | `maxWateringCoef` | *float* | How much over-watering is allowed. Should be > 1 (100%). 1.2 means 120%. Default: 2 (200%) | | `rainSensorSnoozeDuration` | *integer* | configures how the snooze should be scheduled after rain was detected. **Values:** **-1**: Until midnight today, **0**: No snooze added it will stop watering only for the period that rain sensor detects rain, **>0**: Number of seconds to snooze.| | `rainSensorRainStart` | *integer* | Timestamp of last rain event. *null* means rain was never detected | | `useBonjourService` | *integer* | Enables or disables the Apple Bonjour discovery service | | `carryOverInRestriction` | *boolean* | Enables or disables water deficit being carried over to next watering cycle | #### Location | Variable | Type | Description | | ------------------------------|------------|--------------------------------------------------------------------------------------- | | `stationID` | *integer* | The closest weather station ID | | `elevation` | *float* | Terrain elevation in meters | | `doyDownloaded` | *boolean* | If et0 data for each day of year has been downloaded for this location | | `zip` | *integer* | Location ZIP ( **obsolete** ) | | `windSensitivity` | *float* | Sensitivity to wind speed (as percentage in float) | | `krs` | *float* | Adjustment coefficient used in ET0 ASCE formula | | `state` | *string* | Location state | | `stationSource` | *string* | Where the weather station list comes from, station list or grid list | | `et0Average` | *float* | The average ET0 value for this location | | `latitude` | *float* | Location latitude | | `windElevation` | *integer* | The elevation at which wind is measured for this location used in ET0 ASCE formula | | `stationName` | *string* | Weather station name | | `wsDays` | *integer* | For how many days the water savings are taken in account | | `stationDownloaded` | *boolean* | If nearby weather stations had been downloaded | | `address` | *string* | Location address | | `rainSensitivity` | *float* | How much precipitation influences ET0 formula, as percentage represented in float | | `timezone` | *string* | Timezone description | | `longitude` | *float* | Location longitude | | `name` | *string* | Location name | + Response 200 (application/json) { "system": { "httpEnabled": true, "rainSensorSnoozeDuration": 0, "programSingleSchedule": false, "mixerHistorySize": 365, "programZonesShowInactive": false, "standaloneMode": false, "masterValveAfter": 0, "apiVersion": "4.3.0", "selfTest": false, "defaultZoneWateringDuration": 300, "maxLEDBrightness": 80, "simulatorHistorySize": 0, "masterValveBefore": 0, "touchProgramToRun": null, "useRainSensor": false, "wizardHasRun": true, "waterLogHistorySize": 365, "netName": "RainMachine Demo", "touchSleepTimeout": 10, "touchAdvanced": false, "useBonjourService": true, "hardwareVersion": 2, "touchLongPressTimeout": 3, "parserDataSizeInDays": 6, "programListShowInactive": true, "parserHistorySize": 365, "minLEDBrightness": 0, "minWateringDurationThreshold": 0, "localValveCount": 8, "touchAuthAPSeconds": 60, "useCommandLineArguments": false, "databasePath": "/rainmachine-app/DB/Default", "touchCyclePrograms": true, "zoneListShowInactive": true, "rainSensorRainStart": null, "zoneDuration": [ 300, 300, 300, 300, 300, 300, 300, 300 ], "useCorrectionForPast": false, "useMasterValve": false, "maxWateringCoef": 2 }, "location": { "stationID": 9234, "elevation": 106.87275695799999, "doyDownloaded": true, "zip": null, "windSensitivity": 0.5, "krs": 0.19, "state": "Default", "stationSource": "station", "et0Average": 6, "latitude": 37.662431199999994, "windElevation": 2, "stationName": "European Southern Observatory", "wsDays": 2, "stationDownloaded": true, "address": "Default", "rainSensitivity": 0.8, "timezone": "America/Los_Angeles", "longitude": -121.87467890000001, "name": "Proxima B, Proxima Centauri, Centaurus" } } ### POST Sets device provision settings. See above for parameter explanation. Settings can be sent in full list, multiple keys/values or just one key/value. + Request (application/json) { "system": { "httpEnabled": true, "programSingleSchedule": false, "mixerHistorySize": 365, "programZonesShowInactive": false, "standaloneMode": false, "masterValveAfter": 0, "apiVersion": "4.0.0", "selfTest": false, "defaultZoneWateringDuration": 300, "maxLEDBrightness": 80, "simulatorHistorySize": 0, "masterValveBefore": 0, "touchProgramToRun": null, "useRainSensor": false, "wizardHasRun": true, "waterLogHistorySize": 365, "netName": "RainMachine", "touchSleepTimeout": 10, "touchAdvanced": false, "hardwareVersion": 2, "touchLongPressTimeout": 3, "parserDataSizeInDays": 6, "programListShowInactive": true, "parserHistorySize": 365, "minLEDBrightness": 0, "minWateringDurationThreshold": 0, "localValveCount": 8, "touchAuthAPSeconds": 60, "useCommandLineArguments": false, "databasePath": "/rainmachine-app/DB/Default", "touchCyclePrograms": true, "zoneListShowInactive": true, "zoneDuration": [ 300, 300, 300, 300, 300, 300, 300, 300 ], "useCorrectionForPast": false, "useMasterValve": false, "maxWateringCoef": 2 }, "location": { "stationID": 9234, "elevation": 106.87275695799999, "doyDownloaded": true, "zip": null, "windSensitivity": 0.5, "krs": 0.19, "state": "Default", "stationSource": "station", "et0Average": 6, "latitude": 37.662431199999994, "windElevation": 2, "stationName": "European Southern Observatory", "wsDays": 2, "stationDownloaded": true, "address": "Default", "rainSensitivity": 0.8, "timezone": "America/Los_Angeles", "longitude": -121.87467890000001, "name": "Proxima B, Proxima Centauri, Centaurus" } } + Response 200 (application/json) { "statusCode": 0 } ## /provision/name ### GET Returns device name (shortcut to provision.system.netName) + Response 200 (application/json) {"name": "RainMachine Demo"} ## POST Sets device name *Available on 1st gen. Response: "statusCode", "message".* + Response 200 (application/json) { "statusCode": 0 } ## GET /provision/wifi Returns current WIFI configuration + Response 200 (application/json) { "interface": "wlan0", "macAddress": "18:c8:e7:81:a2:6e", "ipAddress": "192.168.12.126", "hasClientLink": true, "mode": "managed" } ## GET /provision/wifi/scan Returns Access Points in range with RainMachine. This won't work on RainMachine HD-12/16 as WIFI is handled by local interface + Response 200 (application/json) { "scanResults": [ { "SSID": "LinuxConsulting", "isEncrypted": true, "signal": "-52", "isWEP": false, "BSS": "00:23:69:F9:55:D1", "isWPA": false, "isWPA2": true, "channel": "3" }, { "SSID": "RainMachine", "isEncrypted": false, "signal": "-41", "isWEP": false, "BSS": "1A:C8:E7:81:9A:B8", "isWPA": false, "isWPA2": false, "channel": "11" } ] } ## POST /provision/wifi/settings Sets the Access Point to which RainMachine will connect to and network settings such as ip, netmask, gateway unless networkType is set as dhcp. This won't work on RainMachine HD-12/16 as WIFI is handled by local interface + Response 200 (application/json) { "statusCode": 0 } ## GET /provision/wifi/ap Returns the status of the WIFI Access Point (only usable on RainMachine Pro). If the AP is hidden and does not allow connections the hidden key will be true. If AP is visible and allows connections hidden will be false and encryption will be "none". ssid key contains the name of the automatically generated name for the RainMachine AP. + Response 200 (application/json) { "encryption": "psk2" "hidden": true, "ssid": "RainMachine-00d399" } ## GET /provision/cloud Returns Remote Access status + Response 200 (application/json) { "enabled": true, "email": "demo@labs.rainmachine.com", "pendingEmail": "" } ## GET /provision/doy Returns locally stored (on device) seasonal data for the setup location + Response 200 (application/json) [ 0.95999999999999996, 0.96999999999999997, 0.96999999999999997, 0.97999999999999998, 0.98999999999999999, 0.98999999999999999, 0.98999999999999999, 1.0, 1.01, 1.02, 1.02, 1.03, 1.04, 1.05, 1.0600000000000001, 1.0700000000000001, 1.0800000000000001, 1.1000000000000001, 1.1100000000000001, 1.1200000000000001, 1.1299999999999999, 1.1499999999999999, 1.1599999999999999, 1.1799999999999999, 1.1899999999999999, 1.21, 1.22, 1.24, 1.26, 1.27, 1.29, 1.3100000000000001, 1.3300000000000001, 1.3500000000000001, 1.3600000000000001, 1.3899999999999999, 1.4099999999999999, 1.4199999999999999, 1.45, 1.47, 1.49, 1.51, 1.53, 1.55, 1.5800000000000001, 1.5900000000000001, 1.6200000000000001, 1.6399999999999999, 1.6599999999999999, 1.6799999999999999, 1.6899999999999999, 1.72, 1.74, 1.76, 1.78, 1.8, 1.8200000000000001, 1.8400000000000001, 1.8600000000000001, 1.8799999999999999, 1.8899999999999999, 1.9199999999999999, 1.9399999999999999, 1.96, 1.97, 2.0, 2.0099999999999998, 2.0299999999999998, 2.0499999999999998, 2.0699999999999998, 2.0899999999999999, 2.1099999999999999, 2.1299999999999999, 2.1400000000000001, 2.1699999999999999, 2.1899999999999999, 2.21, 2.2200000000000002, 2.25, 2.27, 2.2799999999999998, 2.3100000000000001, 2.3300000000000001, 2.3500000000000001, 2.3799999999999999, 2.3900000000000001, 2.4199999999999999, 2.4300000000000002, 2.46, 2.48, 2.5099999999999998, 2.5299999999999998, 2.5600000000000001, 2.5600000000000001, 2.5899999999999999, 2.6099999999999999, 2.6400000000000001, 2.6499999999999999, 2.6800000000000002, 2.71, 2.71, 2.7400000000000002, 2.7599999999999998, 2.7799999999999998, 2.79, 2.8100000000000001, 2.8300000000000001, 2.8599999999999999, 2.8599999999999999, 2.8900000000000001, 2.8999999999999999, 2.9100000000000001, 2.9300000000000002, 2.9300000000000002, 2.9500000000000002, 2.9700000000000002, 2.98, 2.98, 3.0, 3.0099999999999998, 3.0099999999999998, 3.02, 3.04, 3.04, 3.0499999999999998, 3.0600000000000001, 3.0699999999999998, 3.0699999999999998, 3.0800000000000001, 3.1000000000000001, 3.1000000000000001, 3.1099999999999999, 3.1200000000000001, 3.1200000000000001, 3.1299999999999999, 3.1400000000000001, 3.1400000000000001, 3.1600000000000001, 3.1600000000000001, 3.1699999999999999, 3.2000000000000002, 3.1899999999999999, 3.21, 3.23, 3.2200000000000002, 3.2400000000000002, 3.2599999999999998, 3.27, 3.2799999999999998, 3.2999999999999998, 3.3100000000000001, 3.3300000000000001, 3.3300000000000001, 3.3399999999999999, 3.3599999999999999, 3.3700000000000001, 3.3900000000000001, 3.3900000000000001, 3.4100000000000001, 3.4199999999999999, 3.4399999999999999, 3.4300000000000002, 3.4500000000000002, 3.46, 3.48, 3.4700000000000002, 3.48, 3.4900000000000002, 3.4900000000000002, 3.5, 3.5, 3.4900000000000002, 3.5, 3.4900000000000002, 3.4900000000000002, 3.48, 3.48, 3.48, 3.46, 3.46, 3.4500000000000002, 3.4500000000000002, 3.4199999999999999, 3.4100000000000001, 3.4100000000000001, 3.3900000000000001, 3.3700000000000001, 3.3599999999999999, 3.3399999999999999, 3.3300000000000001, 3.3199999999999998, 3.2999999999999998, 3.2799999999999998, 3.27, 3.25, 3.2400000000000002, 3.23, 3.21, 3.1899999999999999, 3.1800000000000002, 3.1600000000000001, 3.1600000000000001, 3.1499999999999999, 3.1299999999999999, 3.1200000000000001, 3.1200000000000001, 3.1099999999999999, 3.1000000000000001, 3.0800000000000001, 3.0899999999999999, 3.0800000000000001, 3.0800000000000001, 3.0699999999999998, 3.0800000000000001, 3.0699999999999998, 3.0800000000000001, 3.0699999999999998, 3.0600000000000001, 3.0699999999999998, 3.0699999999999998, 3.0600000000000001, 3.0699999999999998, 3.0699999999999998, 3.0699999999999998, 3.0800000000000001, 3.0800000000000001, 3.0899999999999999, 3.0899999999999999, 3.0800000000000001, 3.0800000000000001, 3.0800000000000001, 3.0800000000000001, 3.1000000000000001, 3.0899999999999999, 3.0899999999999999, 3.0899999999999999, 3.0800000000000001, 3.0800000000000001, 3.0800000000000001, 3.0800000000000001, 3.0600000000000001, 3.0600000000000001, 3.0499999999999998, 3.0499999999999998, 3.0299999999999998, 3.0299999999999998, 3.02, 3.0, 3.0, 2.98, 2.9700000000000002, 2.96, 2.9500000000000002, 2.9399999999999999, 2.9199999999999999, 2.8999999999999999, 2.8900000000000001, 2.8700000000000001, 2.8599999999999999, 2.8399999999999999, 2.8199999999999998, 2.8100000000000001, 2.79, 2.77, 2.75, 2.7400000000000002, 2.7200000000000002, 2.6899999999999999, 2.6800000000000002, 2.6600000000000001, 2.6400000000000001, 2.6200000000000001, 2.5899999999999999, 2.5699999999999998, 2.5499999999999998, 2.5299999999999998, 2.5, 2.48, 2.4700000000000002, 2.4399999999999999, 2.4199999999999999, 2.3900000000000001, 2.3700000000000001, 2.3500000000000001, 2.3199999999999998, 2.2999999999999998, 2.27, 2.25, 2.2200000000000002, 2.2000000000000002, 2.1699999999999999, 2.1299999999999999, 2.1099999999999999, 2.0899999999999999, 2.0600000000000001, 2.0299999999999998, 2.0, 1.98, 1.95, 1.9199999999999999, 1.8899999999999999, 1.8600000000000001, 1.8300000000000001, 1.8, 1.77, 1.74, 1.71, 1.6799999999999999, 1.6599999999999999, 1.6200000000000001, 1.6000000000000001, 1.5700000000000001, 1.55, 1.52, 1.49, 1.46, 1.4399999999999999, 1.4099999999999999, 1.3899999999999999, 1.3600000000000001, 1.3500000000000001, 1.3200000000000001, 1.3, 1.28, 1.26, 1.24, 1.22, 1.2, 1.1899999999999999, 1.1599999999999999, 1.1499999999999999, 1.1399999999999999, 1.1200000000000001, 1.1100000000000001, 1.0900000000000001, 1.0800000000000001, 1.0700000000000001, 1.0600000000000001, 1.05, 1.03, 1.03, 1.02, 1.01, 1.0, 0.98999999999999999, 0.98999999999999999, 0.97999999999999998, 0.96999999999999997, 0.96999999999999997, 0.96999999999999997, 0.95999999999999996, 0.95999999999999996, 0.95999999999999996, 0.95999999999999996, 0.95999999999999996, 0.94999999999999996, 0.95999999999999996, 0.94999999999999996, 0.95999999999999996, 0.94999999999999996, 0.94999999999999996, 0.95999999999999996, 0.95999999999999996, 0.95999999999999996, 0.95999999999999996 ] ## /provision/homekit ### POST (Requires API 4.6.1) (Internal) For HD12/16 and Pro devices initialise token provisioning (not used) + Response 200 (application/json) { "statusCode": 0 } ## GET (Requires API 4.6.1) (Internal) For HD12/16 and Pro devices returns token provisioning status + Response 200 (application/json) { "tokenProvisioned": true } ## POST /provision/homekit/pair (Requires API 4.6.1) (Internal) For HD12/16 and Pro devices enter pairing mode (send an empty POST body). See also the /machine/pinqr on how to display/read a QR code. + Response 200 (application/json) { "statusCode": 0 } ## POST /provision/homekit/remove (Requires API 4.6.1) (Internal) For HD12/16 and Pro devices remove all active pairings (send an empty POST body) + Response 200 (application/json) { "statusCode": 0 } # Group Programs Watering Programs, each program can contain several Zones and rules that control the irrigation ## /program ### GET Get all watering programs defined on device *Partial support on 1st gen: "uid", "name", "active", "startTime", "cycles", "soak", "cs_on", "delay", "delay_on", "status", "frequency", "ignoreInternetWeather", "futureField1", "freq_modified", "nextRun", "wateringTimes".* | Variable | Type | Description | | ------------------------------|---------------------|--------------------------------------------------------------------------------------- | | `uid` | *integer* | Program unique ID. Automatically generated when a new program is created | | `name` | *string* | Program Name | | `active` | *boolean* | If program is not active it won't be started | | `startTime` | *string* | Program start time in HH:MM format | | `cycles` | *integer* | The number of cycles that the duration of each zone will be split into | | `soak` | *integer* | How many seconds to wait before starting next cycle for same zone | | `cs_on` | *boolean* | If cycle and soak settings are enabled or not for this program | | `delay` | *integer* | The delay between starting next zone (to build water pressure) | | `delay_on` | *boolean* | If the delay between zones is enabled or not | | `status` | *integer* | Watering status: 0 - not running, 1 - running, 2 - queued | | `frequency` | *object* | Frequency of this program (see below) | | `coef` | *float* | unused | | `ignoreInternetWeather` | *boolean* | If program should ignore all weather dataa | | `futureField1` | *integer* | Hold the forecasted rain amount which will restrict program watering (this overwrites RainMachine algorithm decision) | | `freq_modified` | *integer* | Used to hold the percentage (0-100) that will trigger a watering skip, when the watering percentage is below this number | | `useWaterSense` | *boolean* | WaterSense algorithm that automatically determines the time to be watered for each zone | | `nextRun` | *string* | Next scheduled run in YYYY-MM-DD format | | `wateringTimes` | *array of objects* | List of zones and their watering times for this program | | `startTimeParams` | *object* | Used to set program start time at sunrise/sunset. Start hour, minute is automatically computed every time the program starts (see below) | | `simulationExpired` | *boolean* | True if simulation data for that program has expired and a new one is being run | **frequency** Object keys | Type | Description | | ------------------------------|---------------------|-------------------------------------------------------------- | | `type` | *integer* | Daily: 0, Every N days: 1, Weekday: 2, Odd/Even day: 4 | | `param` | *integer* | Odd days: 1, Even days: 0, EveryNFormat: days, Weekday: "SSFTWTM0" | |**startTimeParams** Object keys | Type | Description | | ------------------------------|---------------------|-------------------------------------------------------------- | | `type` | *integer* | Normal start time: 0, Sunrise: 1, Sunset: 2 | | `offsetMinutes` | *integer* | Minutes after/before sunrise/sunset | | `offsetSign` | *integer* | -1 offsetMinutes are before selected type, 1 means after | + Response 200 (application/json) { "programs": [ { "uid": 32, "name": "Afternoon two days", "active": true, "startTime": "16:00", "cycles": 0, "soak": 0, "cs_on": false, "delay": 0, "delay_on": false, "status": 0, "startTimeParams": { "offsetSign": 0, "type": 0, "offsetMinutes": 0 }, "frequency": { "type": 1, "param": "2" }, "coef": 0.0, "ignoreInternetWeather": false, "futureField1": 0, "freq_modified": 0, "useWaterSense": false, "nextRun": "2016-11-17", "simulationExpired": false, "wateringTimes": [ { "id": 1, "order": 1, "name": "Lawn Front", "duration": 0, "active": false, "minRuntimeCoef": 1, "userPercentage": 1.0 }, { "id": 2, "order": 2, "name": "Flowers on the back of the house", "duration": 0, "active": false, "minRuntimeCoef": 1, "userPercentage": 1.0 }, { "id": 3, "order": 3, "name": "Bushes and trees on the shade", "duration": 0, "active": true, "minRuntimeCoef": 1, "userPercentage": 1.0 }, { "id": 4, "order": 4, "name": "Trees and bushes test", "duration": 0, "active": false, "minRuntimeCoef": 1, "userPercentage": 1.0 }, { "id": 5, "order": 5, "name": "Lawn green front side of the porch", "duration": 0, "active": false, "minRuntimeCoef": 1, "userPercentage": 1.0 }, { "id": 6, "order": 6, "name": "Citrus trees ", "duration": 0, "active": false, "minRuntimeCoef": 1, "userPercentage": 1.0 }, { "id": 7, "order": 7, "name": "Grass on the right side of the house", "duration": 0, "active": false, "minRuntimeCoef": 1, "userPercentage": 1.0 }, { "id": 8, "order": 8, "name": "Back yard beautiful lawn area", "duration": 0, "active": false, "minRuntimeCoef": 1, "userPercentage": 1.0 } ] } ] } ### POST Create a new Program (program id will be automatically generated) *Available on 1st gen. Response: "statusCode", "message".* + Request (application/json) { "name": "New Program", "active": true, "startTime": "16:00", "cycles": 0, "soak": 0, "cs_on": false, "delay": 0, "delay_on": false, "status": 0, "startTimeParams": { "offsetSign": 0, "type": 0, "offsetMinutes": 0 }, "frequency": { "type": 1, "param": "2" }, "coef": 0.0, "ignoreInternetWeather": false, "futureField1": 0, "freq_modified": 0, "useWaterSense": false, "nextRun": "2016-11-17", "simulationExpired": false, "wateringTimes": [ { "id": 1, "name": "Lawn Front", "duration": 0, "active": false, "userPercentage": 1.0 }, { "id": 2, "name": "Flowers on the back of the house", "duration": 0, "active": false, "userPercentage": 1.0 }, ] } + Response 200 (application/json) { "statusCode": 0 } ## GET /program/nextrun Returns next running date/time for all active programs *Available on 1st gen.* + Response 200 (application/json) { "nextRuns": [ { "pid": 31, "startTime": "05:55" }, { "pid": 33, "startTime": "11:22" } ] } ##/program/{id} + Parameters + id (required, number, `1`) ... Numeric `id` of the program to retrieve ### GET Get program with specified id *Partial support on 1st gen: "uid", "name", "active", "startTime", "cycles", "soak", "cs_on", "delay", "delay_on", "status", "frequency", "ignoreInternetWeather", "futureField1", "freq_modified", "nextRun", "wateringTimes".* + Response 200 (application/json) { "uid": 32, "name": "Afternoon two days", "active": true, "startTime": "16:00", "cycles": 0, "soak": 0, "cs_on": false, "delay": 0, "delay_on": false, "status": 0, "startTimeParams": { "offsetSign": 0, "type": 0, "offsetMinutes": 0 }, "frequency": { "type": 1, "param": "2" }, "coef": 0.0, "ignoreInternetWeather": false, "futureField1": 0, "freq_modified": 0, "useWaterSense": false, "nextRun": "2016-11-17", "simulationExpired": false, "wateringTimes": [ { "id": 1, "name": "Lawn Front", "duration": 0, "active": false, "userPercentage": 1.0 }, { "id": 2, "name": "Flowers on the back of the house", "duration": 0, "active": false, "userPercentage": 1.0 }, { "id": 3, "name": "Bushes and trees on the shade", "duration": 0, "active": true, "userPercentage": 1.0 }, { "id": 4, "name": "Trees and bushes test", "duration": 0, "active": false, "userPercentage": 1.0 }, { "id": 5, "name": "Lawn green front side of the porch", "duration": 0, "active": false, "userPercentage": 1.0 }, { "id": 6, "name": "Citrus trees ", "duration": 0, "active": false, "userPercentage": 1.0 }, { "id": 7, "name": "Grass on the right side of the house", "duration": 0, "active": false, "userPercentage": 1.0 }, { "id": 8, "name": "Back yard beautiful lawn area", "duration": 0, "active": false, "userPercentage": 1.0 } ] } ### POST Update program parameters with specified id *Partial support on 1st gen: "uid", "name", "active", "startTime", "cycles", "soak", "cs_on", "delay", "delay_on", "status", "frequency", "ignoreInternetWeather", "futureField1", "freq_modified", "nextRun", "wateringTimes". Response: "statusCode", "message".* + Request (application/json) { "uid": 1 "name": "Program With Changed Name", "active": true, "startTime": "16:00", "cycles": 0, "soak": 0, "cs_on": false, "delay": 0, "delay_on": false, "status": 0, "startTimeParams": { "offsetSign": 0, "type": 0, "offsetMinutes": 0 }, "frequency": { "type": 1, "param": "2" }, "coef": 0.0, "ignoreInternetWeather": false, "futureField1": 0, "freq_modified": 0, "useWaterSense": false, "nextRun": "2016-11-17", "simulationExpired": false, "wateringTimes": [ { "id": 1, "name": "Lawn Front", "duration": 0, "active": false, "userPercentage": 1.0 }, { "id": 2, "name": "Flowers on the back of the house", "duration": 0, "active": false, "userPercentage": 1.0 }, ] } + Response 200 (application/json) { "statusCode": 0 } ## /program/{id}/delete + Parameters + id (required, number, `1`) ... Numeric `id` of the program to retrieve ### POST Delete Program with id *Available on 1st gen. Response: "statusCode", "message".* + Response 200 (application/json) { "statusCode": 0 } ## /program/{id}/start + Parameters + id (required, number, `1`) ... Numeric `id` of the program to retrieve ### POST Start watering Program with id *Available on 1st gen. Response: "statusCode", "message".* + Response 200 (application/json) { "statusCode": 0 } ## /program/{id}/stop + Parameters + id (required, number, `1`) ... Numeric `id` of the program to retrieve ### POST Remove Program with id from watering queue *Available on 1st gen.* + Response 200 (application/json) { "statusCode": 0 } # Group Zones Irrigation zones, each zone corresponds to a valve connector on device ## GET /zone Returns a list of *all* zones and their generic properties *Partial support on 1st gen: "uid", "name", "state", "remaining", "type", "master".* | Variable | Type | Description | | ------------------------------|---------------------|--------------------------------------------------------------------------------------- | | `uid` | *integer* | Zone unique ID Usually from 1 to max number of valves | | `name` | *string* | Name of the zone | | `state` | *integer* | Watering status: 0 - not running, 1 - running, 2 - queued | | `active` | *boolean* | If zone is active (can be watered and added to watering programs | | `userDuration` | *integer* | Duration in seconds that was set by user for this zone | | `machineDuration` | *integer* | Duration of actual watering that was calculated by RainMachine | | `remaining` | *integer* | Remaining duration when watering has started | | `cycle` | *integer* | The current cycle for this zone (if running from a program with cycles enabled) | | `noOfCycles` | *integer* | Total number of cycles for this zone for running program | | `restriction` | *boolean* | If the zone is in any current restrictions | | `type` | *integer* | Vegetation Type (see below) | | `master` | *boolean* | If the zone is set as master valve | | `watersense` | *boolean* | NO LONGER USED in API 4.3 | + Response 200 (application/json) { "zones": [ { "uid": 1, "name": "Lawn Front", "state": 0, "active": true, "userDuration": 0, "machineDuration": 0, "remaining": 0, "cycle": 0, "noOfCycles": 0, "restriction": false, "type": 2, "master": false, "waterSense": false }, { "uid": 2, "name": "Flowers on the back of the house", "state": 0, "active": true, "userDuration": 0, "machineDuration": 0, "remaining": 0, "cycle": 0, "noOfCycles": 0, "restriction": false, "type": 4, "master": false, "waterSense": false }, { "uid": 3, "name": "Bushes and trees on the shade", "state": 0, "active": true, "userDuration": 0, "machineDuration": 0, "remaining": 0, "cycle": 0, "noOfCycles": 0, "restriction": false, "type": 6, "master": false, "waterSense": false }, { "uid": 4, "name": "Trees and bushes test", "state": 0, "active": true, "userDuration": 0, "machineDuration": 0, "remaining": 0, "cycle": 0, "noOfCycles": 0, "restriction": false, "type": 7, "master": false, "waterSense": false }, { "uid": 5, "name": "Lawn green front side of the porch", "state": 0, "active": true, "userDuration": 0, "machineDuration": 0, "remaining": 0, "cycle": 0, "noOfCycles": 0, "restriction": false, "type": 2, "master": false, "waterSense": false }, { "uid": 6, "name": "Citrus trees ", "state": 0, "active": true, "userDuration": 0, "machineDuration": 0, "remaining": 0, "cycle": 0, "noOfCycles": 0, "restriction": false, "type": 6, "master": false, "waterSense": false }, { "uid": 7, "name": "Grass on the right side of the house", "state": 0, "active": true, "userDuration": 0, "machineDuration": 0, "remaining": 0, "cycle": 0, "noOfCycles": 0, "restriction": false, "type": 5, "master": false, "waterSense": false }, { "uid": 8, "name": "Back yard beautiful lawn area", "state": 0, "active": true, "userDuration": 0, "machineDuration": 0, "remaining": 0, "cycle": 0, "noOfCycles": 0, "restriction": false, "type": 2, "master": false, "waterSense": false } ] } ## GET /zone/properties Returns advanced properties for *all* zones *Partial support on 1st gen: "uid", "name", "active", "type", "internet", "history", "master", "before", "after".* | Variable | Type | Description | | ------------------------------|---------------------|--------------------------------------------------------------------------------------- | | `ETcoef` | *float* | The custom (Other) vegetation coeficient set by user for this zone | `savings` | *int* | The percentage that increase or decrease the Field Capacity of this zone | `slope` | *int* | The slope of the zone (see below) | `sun` | *int* | The sun exposure of the zone (see below) | `soil` | *int* | The soil type (see below) | `group_id` | *int* | The sprinkler head type (see below) | `maxAllowedDepletion` | *float* | The maximum allowed depletion | `precipitationRate` | *float* | Sprinkler head precipiration rate (mm/h) | `appEfficiency` | *float* | Sprinkler head application efficiency (percent) | `allowedSurfaceAcc` | *float* | Soil allowed surface accumulation (mm) | `rootDepth` | *int* | Average Root depth of the plants in the zone (mm) | `isTallPlant ` | *bool* | True/False if plant is above 20cm | `soilIntakeRate` | *float* | Soil intake rate (mm/h) | `detailedMonthsKc` | *string* | String with format "[0.4, 0.3,....12th Value]" expressing the crop coeficient for each year month | `permWilting` | *float* | Permanent wilting point (percent of the plant root depth) | `fieldCapacity` | *float* | Decimal percentage that is used when defining a custom Soil type which is the amount of water remaining in the soil a few days after having been wetted and after free drainage has ceased | | `currentFieldCapacity` | *float* | Current field capacity a read-only value that is computed by rainmachine from the sun, slope, soil and vegetation types parameters. This represent how much water in mm the zone can hold | | `referenceTime` | *int* | EPA Watersense suggested daily summer day watering time in seconds. This value is read-only and it's computed by RainMachine based on other zone parameters | | `area` | *int* | The zone area in square meters | | `flowRate` | *int* | The zone flow debit in cubic meters per hour | ### Vegetation Type (`type`) Numerical Values Used: Not Set = 0 Not Set Old = 1 Grass = 2 FruitTrees = 3 Flowers = 4 Vegetables = 5 Citrus = 6 Bushes = 7 Xeriscape = 9 Other = 99 (Use advanced values) ### Soil Type (`soil`) Numerical Values Used: NotSet = 0 ClayLoam = 1 SiltyClay = 2 Clay = 3 Loam = 4 SandyLoam = 5 LoamySand = 6 Sand = 7 SandyClay = 8 SiltLoam = 9 Silt = 10 Other = 99 (Use advanced values) ### Sprinkler Type (`group_id`) Numerical Values Used: NotSet = 0 PopupSpray = 1 Rotors = 2 SurfaceDrip = 3 Bubblers = 4 RotorsHigh = 5 Other = 99 (Use advanced values) ### Slope Type (`slope`) Numerical Values Used: NotSet = 0 Flat = 1 Moderate = 2 High = 3 VeryHigh = 4 Other = 99 (Use advanced values) ### Sun Exposure (`sun`) Numerical Values Used: NotSet = 0 FullSun = 1 PartialShade = 2 FullShade = 3 + Response 200 (application/json) { "zones": [ { "uid": 1, "name": "Lawn Front", "valveid": 1, "ETcoef": 0.80000000000000004, "active": true, "type": 2, "internet": true, "savings": 70, "slope": 1, "sun": 1, "soil": 6, "group_id": 1, "history": true, "master": false, "before": 0, "after": 0, "waterSense": { "fieldCapacity": 0.14000000000000001, "rootDepth": 203, "appEfficiency": 0.69999999999999996, "isTallPlant": false, "permWilting": 0.029999999999999999, "allowedSurfaceAcc": 9.1400000000000006, "maxAllowedDepletion": 0.40000000000000002, "precipitationRate": 35.560000000000002, "currentFieldCapacity": 8.9299999999999997, "area": 92.900000000000006, "referenceTime": 440, "detailedMonthsKc": [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ], "flowrate": null, "soilIntakeRate": 12.699999999999999 } }, { "uid": 2, "name": "Flowers on the back of the house", "valveid": 2, "ETcoef": 0.80000000000000004, "active": true, "type": 4, "internet": true, "savings": 130, "slope": 1, "sun": 3, "soil": 4, "group_id": 2, "history": true, "master": false, "before": 0, "after": 0, "waterSense": { "fieldCapacity": 0.26000000000000001, "rootDepth": 229, "appEfficiency": 0.65000000000000002, "isTallPlant": true, "permWilting": 0.029999999999999999, "allowedSurfaceAcc": 7.6200000000000001, "maxAllowedDepletion": 0.5, "precipitationRate": 8.8900000000000006, "currentFieldCapacity": 26.34, "area": 92.900000000000006, "referenceTime": 1778, "detailedMonthsKc": [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ], "flowrate": null, "soilIntakeRate": 8.8900000000000006 } }, { "uid": 3, "name": "Bushes and trees on the shade", "valveid": 3, "ETcoef": -1.0, "active": true, "type": 6, "internet": true, "savings": 150, "slope": 1, "sun": 3, "soil": 1, "group_id": 1, "history": true, "master": false, "before": 0, "after": 0, "waterSense": { "fieldCapacity": 0.23999999999999999, "rootDepth": 1016, "appEfficiency": 0.69999999999999996, "isTallPlant": true, "permWilting": 0.029999999999999999, "allowedSurfaceAcc": 6.5999999999999996, "maxAllowedDepletion": 0.5, "precipitationRate": 35.560000000000002, "currentFieldCapacity": 106.68000000000001, "area": 92.900000000000006, "referenceTime": 268, "detailedMonthsKc": [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ], "flowrate": 0.0, "soilIntakeRate": 5.0800000000000001 } }, { "uid": 4, "name": "Trees and bushes test", "valveid": 4, "ETcoef": 0.80000000000000004, "active": true, "type": 7, "internet": true, "savings": 100, "slope": 1, "sun": 1, "soil": 2, "group_id": 1, "history": true, "master": false, "before": 0, "after": 0, "waterSense": { "fieldCapacity": 0.22, "rootDepth": 711, "appEfficiency": 0.69999999999999996, "isTallPlant": true, "permWilting": 0.029999999999999999, "allowedSurfaceAcc": 5.8399999999999999, "maxAllowedDepletion": 0.5, "precipitationRate": 35.560000000000002, "currentFieldCapacity": 67.549999999999997, "area": 92.900000000000006, "referenceTime": 550, "detailedMonthsKc": [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ], "flowrate": null, "soilIntakeRate": 3.8100000000000001 } }, { "uid": 5, "name": "Lawn green front side of the porch", "valveid": 5, "ETcoef": 0.80000000000000004, "active": true, "type": 2, "internet": true, "savings": 100, "slope": 1, "sun": 1, "soil": 1, "group_id": 1, "history": true, "master": false, "before": 0, "after": 0, "waterSense": { "fieldCapacity": 0.23999999999999999, "rootDepth": 203, "appEfficiency": 0.69999999999999996, "isTallPlant": false, "permWilting": 0.029999999999999999, "allowedSurfaceAcc": 6.5999999999999996, "maxAllowedDepletion": 0.40000000000000002, "precipitationRate": 35.560000000000002, "currentFieldCapacity": 17.050000000000001, "area": 92.900000000000006, "referenceTime": 440, "detailedMonthsKc": [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ], "flowrate": null, "soilIntakeRate": 5.0800000000000001 } }, { "uid": 6, "name": "Citrus trees ", "valveid": 6, "ETcoef": 0.80000000000000004, "active": true, "type": 6, "internet": true, "savings": 100, "slope": 1, "sun": 1, "soil": 1, "group_id": 1, "history": true, "master": false, "before": 0, "after": 0, "waterSense": { "fieldCapacity": 0.23999999999999999, "rootDepth": 1016, "appEfficiency": 0.69999999999999996, "isTallPlant": true, "permWilting": 0.029999999999999999, "allowedSurfaceAcc": 6.5999999999999996, "maxAllowedDepletion": 0.5, "precipitationRate": 35.560000000000002, "currentFieldCapacity": 106.68000000000001, "area": 92.900000000000006, "referenceTime": 357, "detailedMonthsKc": [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ], "flowrate": null, "soilIntakeRate": 5.0800000000000001 } }, { "uid": 7, "name": "Grass on the right side of the house", "valveid": 7, "ETcoef": 0.80000000000000004, "active": true, "type": 5, "internet": true, "savings": 100, "slope": 1, "sun": 1, "soil": 1, "group_id": 1, "history": true, "master": false, "before": 0, "after": 0, "waterSense": { "fieldCapacity": 0.23999999999999999, "rootDepth": 457, "appEfficiency": 0.69999999999999996, "isTallPlant": true, "permWilting": 0.029999999999999999, "allowedSurfaceAcc": 6.5999999999999996, "maxAllowedDepletion": 0.34999999999999998, "precipitationRate": 35.560000000000002, "currentFieldCapacity": 33.590000000000003, "area": 92.900000000000006, "referenceTime": 633, "detailedMonthsKc": [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ], "flowrate": null, "soilIntakeRate": 5.0800000000000001 } }, { "uid": 8, "name": "Back yard beautiful lawn area", "valveid": 8, "ETcoef": 0.80000000000000004, "active": true, "type": 2, "internet": true, "savings": 100, "slope": 1, "sun": 1, "soil": 1, "group_id": 1, "history": true, "master": false, "before": 0, "after": 0, "waterSense": { "fieldCapacity": 0.23999999999999999, "rootDepth": 203, "appEfficiency": 0.69999999999999996, "isTallPlant": false, "permWilting": 0.029999999999999999, "allowedSurfaceAcc": 6.5999999999999996, "maxAllowedDepletion": 0.40000000000000002, "precipitationRate": 35.560000000000002, "currentFieldCapacity": 17.050000000000001, "area": 92.900000000000006, "referenceTime": 440, "detailedMonthsKc": [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ], "flowrate": 0.0, "soilIntakeRate": 5.0800000000000001 } } ] } ## /zone/{id} + Parameters + id (required, number, `1`) ... Numeric `id` of the zone to water ### GET Retrieve properties for zone with specified id. *Partial support on 1st gen* + Response 200 (application/json) { "uid": 1, "name": "Zone 1", "state": 0, "active": true, "userDuration": 0, "machineDuration": 0, "remaining": 0, "cycle": 0, "noOfCycles": 0, "restriction": false, "type": 1, "master": false, "waterSense": false } ## /zone/{id}/properties + Parameters + id (required, number, `1`) ... Numeric `id` of the zone to water ### GET Retrieve advanced properties for zone with specified id. *Partial support on 1st gen* + Response 200 (application/json) { "uid": 1, "name": "Lawn Front", "valveid": 1, "ETcoef": 0.80000000000000004, "active": true, "type": 2, "internet": true, "savings": 70, "slope": 1, "sun": 1, "soil": 6, "group_id": 1, "history": true, "master": false, "before": 0, "after": 0, "waterSense": { "fieldCapacity": 0.14000000000000001, "rootDepth": 203, "appEfficiency": 0.69999999999999996, "isTallPlant": false, "permWilting": 0.029999999999999999, "allowedSurfaceAcc": 9.1400000000000006, "maxAllowedDepletion": 0.40000000000000002, "precipitationRate": 35.560000000000002, "currentFieldCapacity": 8.9299999999999997, "area": 92.900000000000006, "referenceTime": 440, "detailedMonthsKc": [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ], "flowrate": null, "soilIntakeRate": 12.699999999999999 } } ### POST Set properties for zone with id *Partial support on 1st gen. Response: "statusCode", "message".* + Response 200 (application/json) { } ## /zone/{id}/start + Parameters + id (required, number, `1`) ... Numeric `id` of the zone to water ### POST Start watering zone with id *Available on 1st gen. Response: "statusCode", "message".* + Request { "time": 60 } + Response 200 (application/json) {} ## /zone/{id}/stop + Parameters + id (required, number, `1`) ... Numeric `id` of the zone to water ### POST Stop watering zone with id *Available on 1st gen. Response: "statusCode", "message".* + Response 200 (application/json) { "statusCode": 0 } ## POST /zone/simulate Returns the suggested watering duration in seconds and field capacity size in mm from the zone properties sent in the request body. + Request { "ETcoef": 1, "type": 2, "internet": true, "savings": 50, "slope": 1, "sun": 1, "soil": 1, "group_id": 1, "history": true, "waterSense": { "fieldCapacity": 0.0, "rootDepth": 0, "appEfficiency": 0.0, "isTallPlant": 0, "permWilting": 0.0, "maxAllowedDepletion": 0.0, "precipitationRate": 0.0, "allowedSurfaceAcc": 0.0, "referenceTime": 661, "detailedMonthsKc": [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ], "soilIntakeRate": 0.0 } } + Response 200 (application/json) { "referenceTime": 460, "currentFieldCapacity": 6.35 } # Group Watering Watering Information and Status including data for past water usage. The past water usage statistics are split in two parts real data that comes from user programs (which could be daily or every 7 days) and user manual watering, and a simulated part that comes from a simulated daily program that is simulated each day. ## GET /watering/zone Returns status of watering on *all* zones + Response 200 (application/json) { "zones": [ { "uid": 1, "name": "Zone 1", "state": 0, "userDuration": 0, "machineDuration": 0, "remaining": 0, "cycle": 0, "noOfCycles": 0, "restriction": false }, { "uid": 2, "name": "Zone 2", "state": 0, "userDuration": 0, "machineDuration": 0, "remaining": 0, "cycle": 0, "noOfCycles": 0, "restriction": false }, { "uid": 3, "name": "Zone 3", "state": 0, "userDuration": 0, "machineDuration": 0, "remaining": 0, "cycle": 0, "noOfCycles": 0, "restriction": false }, { "uid": 4, "name": "Zone 4", "state": 0, "userDuration": 0, "machineDuration": 0, "remaining": 0, "cycle": 0, "noOfCycles": 0, "restriction": false }, { "uid": 5, "name": "Zone 5", "state": 0, "userDuration": 0, "machineDuration": 0, "remaining": 0, "cycle": 0, "noOfCycles": 0, "restriction": false }, { "uid": 6, "name": "Zone 6", "state": 0, "userDuration": 0, "machineDuration": 0, "remaining": 0, "cycle": 0, "noOfCycles": 0, "restriction": false }, { "uid": 7, "name": "Zone 7", "state": 0, "userDuration": 0, "machineDuration": 0, "remaining": 0, "cycle": 0, "noOfCycles": 0, "restriction": false }, { "uid": 8, "name": "Zone 8", "state": 0, "userDuration": 0, "machineDuration": 0, "remaining": 0, "cycle": 0, "noOfCycles": 0, "restriction": false } ] } ## GET /watering/program Returns the running watering program or empty list if no programs are currently running. + Response 200 (application/json) { "programs": [ { "uid": 1, "name": "Program1", "manual": true, "userStartTime": "2015-06-03 23:43:00", "realStartTime": "2015-06-03 23:43:48", "status": 1 } ] } ## GET /watering/queue Returns the current watering queue as a list of objects or empty list if no watering is taking place. Each object in the list will have the fields below: | Field | Type | Description | |-------------------|-----------|-----------------------------------------------------------------------| | `availableWater` | *int* | The available water for the zone being watered | | `realDuration` | *int/null*| The duration in seconds computed by RainMachine (0 if manual start) | | `running` | *bool* | If the zone is actually watering or only queued | | `uid` | *int/null*| UID of the record or null (ignored) | | `restriction` | *bool* | If under restriction or not | | `manual` | *boot* | If the watering event was started manually | | `pid` | *int/null*| The program ID for which this event belongs | | `flag` | *int* | Watering flag value, see description from GET dailystats call | | `machineDuration` | *int* | Duration (seconds) as computed by RainMachine | | `userDuration` | *int* | Duration (seconds) entered by user | | `zid` | *int* | The ID of the zone being watered | | `userStartTime` | *date/time string* | eg: 2016-11-23 08:41:31 | | `cycles` | *int* | The total number of cycles this watering event will have | | `hwZid` | *int* | The actual hardware valve ID (this is equal to zone ID for now) | | `remaining` | *int* | Remaining seconds to water for this event | | `realStartTime` | *date/time string* | eg: 2016-11-23 08:41:31 | | `cycle` | *int* | The current cycle number | + Response 200 (application/json) { "queue": [ ] } ## /watering/past/{date}/{days} + Parameters + date: `2017-03-15` (string) - Date for which the data is wanted + days: `30` (number) - How many days to return ### GET Returns the et0 and qpf values used on the last runs of programs, including the date on which the programs started. If no date/days parameters are sent the yesterday values are returned. + Response 200 (application/json) { "pastValues": [ { "pid": 32, "dateTimestamp": 1450166400, "dateTime": "2015-12-15 00:00:00", "used": true, "et0": 1.3241329016030579, "qpf": 0 }, { "pid": 32, "dateTimestamp": 1450252800, "dateTime": "2015-12-16 00:00:00", "used": true, "et0": 1.417105023767904, "qpf": 0 } ] } ## /watering/available/{date}/{days} + Parameters + date: `2017-03-15` (string) - Date for which the data is wanted (optional) + days: `30` (number) - How many days to return (optional) ### POST Sets a zone available water in the specified program. If program id (pid) is set to -1, then this zone is set in all available programs. The available water is set as decimal percentage from 0%(0) to 100%(1) from the zone field capacity value (the actual value is computed internally after the POST call) . + Request (application/json) + Body { "availableWaterValues": [ { pid: -1, zid: 1, percentage: 0.5, }, ] } + Response 200 (application/json) { "statusCode": 0 } ### GET Returns the available water in soil for each zone in each program for all days. + Response 200 (application/json) { "availableWaterValues": [ { "dateTime": "2014-12-08 00:00:00", "day": 1418025600, "pid": 32, "zid": 3, "aw": 19.60317710318884 }, { "dateTime": "2014-12-07 00:00:00", "day": 1417939200, "pid": 32, "zid": 3, "aw": 19.653164729968374 }, { "dateTime": "2014-12-06 00:00:00", "day": 1417852800, "pid": 32, "zid": 3, "aw": 19.40323269049864 }, { "dateTime": "2014-12-05 00:00:00", "day": 1417766400, "pid": 32, "zid": 3, "aw": 19.469913502450538 }, { "dateTime": "2014-12-03 00:00:00", "day": 1417593600, "pid": 32, "zid": 3, "aw": 0.0 }, { "dateTime": "2014-12-02 00:00:00", "day": 1417507200, "pid": 32, "zid": 3, "aw": 0.0 }, { "dateTime": "2014-11-28 00:00:00", "day": 1417161600, "pid": 32, "zid": 3, "aw": 0.0 } ] } ## GET /watering/log Return all basic past water usage + Response 200 (application/json) { "waterLog": { "days": [ { "date": "2015-06-03", "realDuration": 541, "dayTimestamp": 1433314800 } ] } } ## /watering/log/{date}/{days} + Parameters + date: `2017-03-15` (string) - Date for which the data is wanted + days: `30` (number) - How many days to return ### GET Returns basic water usage data starting from specified `date` for a number of specified `days` + Response 200 (application/json) { "waterLog": { "days": [ { "date": "2015-06-03", "realDuration": 541, "dayTimestamp": 1433314800 } ] } } ## /watering/log/details/{date}/{days} + Parameters + date: `2017-03-15` (string) - Date for which the data is wanted + days: `30` (number) - How many days to return ### GET Returns detalied water usage starting from specified `date` for a number of specified `days`. + Response 200 (application/json) { "waterLog": { "days": [ { "date": "2015-06-03", "dateTimestamp": 1433314800, "programs": [ { "id": 32, "zones": [ { "uid": 3, "flag": 0, "cycles": [ { "id": 1, "startTime": "2015-06-03 06:00:00", "startTimestamp": 1433336400, "userDuration": 150, "machineDuration": 120, "realDuration": 120 }, { "id": 2, "startTime": "2015-06-03 06:00:00", "startTimestamp": 1433336400, "userDuration": 150, "machineDuration": 120, "realDuration": 120 } ] } ] }, { "id": 0, "zones": [ { "uid": 1, "flag": 0, "cycles": [ { "id": 1, "startTime": "2015-06-03 23:43:48", "startTimestamp": 1433400228, "userDuration": 300, "machineDuration": 300, "realDuration": 300 } ] } ] } ] } ] } } ## /watering/log/simulated/{date}/{days} + Parameters + date: `2017-03-15` (string) - Date for which the data is wanted + days: `30` (number) - How many days to return ### GET Returns basic water usage data for the simulated program (doesn't actually water, used for Daily Water Needs graphs) starting from specified `date` for a number of specified `days` + Response 200 (application/json) { "waterLog": { "days": [ { "date": "2015-06-03", "realDuration": 541, "dayTimestamp": 1433314800 } ] } } ## /watering/log/simulated/details/{date}/{days} + Parameters + date: `2017-03-15` (string) - Date for which the data is wanted + days: `30` (number) - How many days to return ### GET Returns detailed water usage for the simulated program (doesn't actually water, used for Daily Water Needs graphs) starting from specified `date` for a number of specified `days`. + Response 200 (application/json) { "waterLog": { "days": [ { "date": "2015-06-03", "dateTimestamp": 1433314800, "programs": [ { "id": 1, "zones": [ { "uid": 1, "flag": 0, "cycles": [ { "id": 1, "startTime": "2015-06-03 06:00:00", "startTimestamp": 1433336400, "userDuration": 300, "machineDuration": 240.5214319229126, "realDuration": 241 } ] } ] }, { "id": 0, "zones": [ { "uid": 1, "flag": 0, "cycles": [ { "id": 1, "startTime": "2015-06-03 23:43:48", "startTimestamp": 1433400228, "userDuration": 300, "machineDuration": 300, "realDuration": 300 } ] } ] } ] } ] } } ## POST /watering/stopall Stops all watering in progress including zones and programs that were started. + Response 200 (application/json) { "statusCode": 0 } ## POST /watering/pauseall Pause all watering on device for the specified duration (in seconds). Calling this with duration set to 0 will unpause the watering. + Request (application/json) + Body { "duration": 60 } + Response 200 (application/json) { "statusCode": 0 } ## /watering/flowmeter ### GET Returns the registered values from flowmeter. + Response 200 (application/json) { "flowMeterWateringClicks": 4000, "flowMeterLeakClicks": 10, flowMeterStartIndexClicks": 120 } ### POST Add values to flowmeter counters from an external smart water meter (like Flume) not wired directly to RainMachine. Units can be "clicks", "gal", "m3" and "litre". + Request (application/json) + Body { "value": 60, "units": clicks } + Response 200 (application/json) { "statusCode": 0 } # Group Restrictions Watering Restriction Hourly, Daily, Weekly, Monthly and Freeze Control/Rain Delay. New in 4.1: Rain Sensor ## /restrictions/currently ### GET Returns a summary of current restrictions on device. If any of the month, week day, hourly, freeze or rain delay restrictions are active a coresponding field in the reply is set to true. + Response 200 (application/json) { "hourly": false, "freeze": false, "month": false, "weekDay": false, "rainDelay": false, "rainDelayCounter": -1, "rainSensor": false } ## /restrictions/global ### GET Returns global watering restrictions like freeze protect, snooze, months and week days restrictions. + Response 200 (application/json) { "hotDaysExtraWatering": true, "freezeProtectEnabled": true, "freezeProtectTemp": 2, "noWaterInWeekDays": "1001011", "noWaterInMonths": "000000000000", "rainDelayStartTime": 1479210751, "rainDelayDuration": 0 } ### POST Sets global watering restrictions + Response 200 (application/json) { "statusCode": 0 } ## /restrictions/hourly ### GET Returns defined hourly watering restrictions (no watering in specified hour intervals) + Response 200 (application/json) { "hourlyRestrictions": [ { "interval": "02:00 - 03:00", "dayStartMinute": 120, "uid": 1, "minuteDuration": 60, "weekDays": "1000000" } ] } ### POST Sets a new hourly restriction, will return a json with restriction details. + Response 200 (application/json) { "restriction": { "interval": "02:00 - 03:00", "dayStartMinute": 120, "uid": 2, "minuteDuration": 60, "weekDays": "1000000" }, "message": "OK", "statusCode": 0 } ## POST /restrictions/hourly/{id}/delete Removes an hourly restriction with the specified id. + Response 200 (application/json) { "statusCode": 0 } ##/restrictions/raindelay ### GET Returns the number of seconds until the forced Rain Delay is finished *Available on 1st gen.* + Response 200 (application/json) { "delayCounter": 86397 } ### POST Sets the number of days for which a Rain Delay is wanted, the Rain Delay will start at the time of POST request being register. *Available on 1st gen.* + Response 200 (application/json) { "statusCode": 0 } # Group Daily Stats Daily Statistics and Weather ##/dailystats ### GET Returns daily statistics about simulated watering. It contains how much the programs will water for the next 7 days (pozitive id, id 0 is today). | Variable for Basic Stats | Type | Description | | ---------------------------|---------------|----------------------------------------------------------------------------------- | | `id` | *int* | Day offset relative to today which is 0. | | `wateringFlag` | *int* | See below | | `day` | *string* | Day in YYYY-MM-DD format | | `mint` | *float* | Minimum temperature of the day | | `maxt` | *float* | Maximum temperature of the day | | `icon` | *int* | Weather icon for that day (see icon definitions) | | `percentage` | *int* | How much it actually waters | | `simulatedPercentage` | *int* | How much it would water if a daily program would be configured | | `vibration` | *array of int*| How the watering `percetage` varies with historical and future weather predictions | | `simulatedVibration` | *array of int*| As above but if a daily program would be configured | | Variable for Detailed Stats | Type | Description | | ----------------------------|---------------|---------------------------------------------------- | | `scheduledWateringTime` | *int* | User specified watering time for this zone | | `computedWateringTime` | *int* | Calculated watering time for this zone | | `availableWater` | *float* | Available water for this zone | | `coefficient` | *float* | Zone watering coefficient (see zones documentation) | | Watering Flag Value | Description | | ---------------------------|------------------------------------- | | 0 | Normal watering | | 1 | Interrupted by user | | 2 | Restriction Threshold | | 3 | Restriction Freeze Protect | | 4 | Restriction Day | | 5 | Restriction Out Of Day | | 6 | Water Surplus | | 7 | Stopped by Rain Sensor | | 8 | Software rain sensor restriction | | 9 | Month Restricted | | 10 | Rain Delay set by user | | 11 | Program Rain Restriction | *Partial support on 1st gen: "vibration" not available.* + Response 200 (application/json) { "DailyStats": [ { "id": 0, "day": "2016-11-15", "mint": 13.33, "maxt": 16.670000000000002, "icon": 0, "percentage": 36.168480580665893, "wateringFlag": 0, "vibration": [ 33, 38, 20, 21, 40, 36 ], "simulatedPercentage": 35.078271640697743, "simulatedVibration": [ 0, 37, 0, 0, 39, 35 ] }, { "id": 1, "day": "2016-11-16", "mint": 12.220000000000001, "maxt": 16.670000000000002, "icon": 2, "percentage": 43.799943160442922, "wateringFlag": 0, "vibration": [ 45, 44, 44, 44, 44, 44 ], "simulatedPercentage": 43.799943160442929, "simulatedVibration": [ 77, 44, 64, 65, 44, 44 ] }, { "id": 2, "day": "2016-11-17", "mint": 10.56, "maxt": 17.219999999999999, "icon": 3, "percentage": 46.156735489183404, "wateringFlag": 0, "vibration": [ 43, 45, 45, 46, 46, 46 ], "simulatedPercentage": 46.48896192216516, "simulatedVibration": [ 42, 44, 44, 46, 46, 46 ] }, { "id": 3, "day": "2016-11-18", "mint": 10.56, "maxt": 18.890000000000001, "icon": 3, "percentage": 48.670541625659837, "wateringFlag": 0, "vibration": [ 47, 49, 50, 49, 49, 49 ], "simulatedPercentage": 48.670541625659837, "simulatedVibration": [ 47, 49, 50, 49, 49, 49 ] }, { "id": 4, "day": "2016-11-19", "mint": 13.33, "maxt": 18.329999999999998, "icon": 0, "percentage": 41.499260586322904, "wateringFlag": 0, "vibration": [ 41, 42, 42, 42, 41, 41 ], "simulatedPercentage": 42.034238102728658, "simulatedVibration": [ 41, 43, 43, 43, 42, 42 ] }, { "id": 5, "day": "2016-11-20", "mint": 13.33, "maxt": 17.780000000000001, "icon": 0, "percentage": 37.754417971482603, "wateringFlag": 0, "vibration": [ 36, 37, 37, 37, 38, 38 ], "simulatedPercentage": 37.754417971482596, "simulatedVibration": [ 36, 37, 37, 37, 38, 38 ] } ] } ##/dailystats/{date} + Parameters + date: `2017-03-15` (string) - Date string, in YYYY-MM-DD format, from which the data is wanted. ###GET Returns daily statistics about simulated watering starting from specified `date` per program per zone. *Partial support on 1st gen: "vibration" not available.* + Response 200 (application/json) { "id": 1, "day": "2016-11-16", "mint": 12.220000000000001, "maxt": 16.670000000000002, "icon": 2, "percentage": 43.799943160442922, "wateringFlag": 0, "vibration": [ 45, 44, 44, 44, 44, 44 ], "simulatedPercentage": 43.799943160442929, "simulatedVibration": [ 77, 44, 64, 65, 44, 44 ] } ##/dailystats/details ###GET Returns daily statistics detauls about simulated watering starting with `date` which is optional. *Partial support on 1st gen: "vibration" not available.* + Response 200 (application/json) { "DailyStatsDetails": [ { "dayTimestamp": 1479196800, "day": "2016-11-15", "mint": 13.33, "maxt": 16.670000000000002, "icon": 0, "programs": [ { "id": 32, "zones": [ { "id": 3, "scheduledWateringTime": 536, "computedWateringTime": 211.39361566705699, "availableWater": 0, "coefficient": 0.39439107400570333, "percentage": 39.439107400570336, "wateringFlag": 0 } ] } ], "simulatedPrograms": [ { "id": 1, "zones": [ { "id": 2, "scheduledWateringTime": 300, "computedWateringTime": 105.23481492209324, "availableWater": 0, "coefficient": 0.35078271640697745, "percentage": 35.078271640697743 } ] } ] }, { "dayTimestamp": 1479283200, "day": "2016-11-16", "mint": 12.220000000000001, "maxt": 16.670000000000002, "icon": 2, "programs": [ ], "simulatedPrograms": [ { "id": 1, "zones": [ { "id": 2, "scheduledWateringTime": 300, "computedWateringTime": 131.39982948132879, "availableWater": 0, "coefficient": 0.43799943160442933, "percentage": 43.799943160442936 } ] } ] }, { "dayTimestamp": 1479369600, "day": "2016-11-17", "mint": 10.56, "maxt": 17.219999999999999, "icon": 3, "programs": [ { "id": 32, "zones": [ { "id": 3, "scheduledWateringTime": 536, "computedWateringTime": 255.02746950817095, "availableWater": 0, "coefficient": 0.47579751773912493, "percentage": 47.579751773912491, "wateringFlag": 4 } ] } ], "simulatedPrograms": [ { "id": 1, "zones": [ { "id": 2, "scheduledWateringTime": 300, "computedWateringTime": 139.46688576649549, "availableWater": 0, "coefficient": 0.46488961922165162, "percentage": 46.48896192216516 } ] } ] }, { "dayTimestamp": 1479456000, "day": "2016-11-18", "mint": 10.56, "maxt": 18.890000000000001, "icon": 3, "programs": [ ], "simulatedPrograms": [ { "id": 1, "zones": [ { "id": 2, "scheduledWateringTime": 300, "computedWateringTime": 146.01162487697951, "availableWater": 0, "coefficient": 0.48670541625659836, "percentage": 48.670541625659837 } ] } ] }, { "dayTimestamp": 1479542400, "day": "2016-11-19", "mint": 13.33, "maxt": 18.329999999999998, "icon": 0, "programs": [ { "id": 32, "zones": [ { "id": 3, "scheduledWateringTime": 536, "computedWateringTime": 213.83359827888614, "availableWater": 0, "coefficient": 0.39894328037105625, "percentage": 39.894328037105623, "wateringFlag": 4 } ] } ], "simulatedPrograms": [ { "id": 1, "zones": [ { "id": 2, "scheduledWateringTime": 300, "computedWateringTime": 126.10271430818597, "availableWater": 0, "coefficient": 0.42034238102728655, "percentage": 42.034238102728658 } ] } ] }, { "dayTimestamp": 1479628800, "day": "2016-11-20", "mint": 13.33, "maxt": 17.780000000000001, "icon": 0, "programs": [ ], "simulatedPrograms": [ { "id": 1, "zones": [ { "id": 2, "scheduledWateringTime": 300, "computedWateringTime": 113.2632539144478, "availableWater": 0, "coefficient": 0.37754417971482601, "percentage": 37.754417971482603 } ] } ] }, { "dayTimestamp": 1479715200, "day": "2016-11-21", "mint": null, "maxt": null, "icon": null, "programs": [], "simulatedPrograms": [] } ] } # Group Weather Services Weather services (parsers) that fetch weather from different internet weather services. ##/parser ###GET Returns information about all weather parsers available (active or not) + Response 200 (application/json) { "parsers": [ { "lastRun": null, "lastKnownError": "", "hasForecast": true, "uid": 6, "hasHistorical": true, "description": "Global weather service with personal weather station access from Weather Underground", "enabled": false, "custom": false, "params": { "useSolarRadiation": false, "apiKey": "", "useCustomStation": false, "_nearbyStationsIDList": [], "_airportStationsIDList": [], "customStationName": "" }, "isRunning": false, "name": "WUnderground Parser" }, { "lastRun": null, "lastKnownError": "", "hasForecast": false, "uid": 5, "hasHistorical": true, "description": "Example parser for developers", "enabled": false, "custom": false, "isRunning": false, "name": "My Example Parser" }, { "lastRun": null, "lastKnownError": "", "hasForecast": true, "uid": 10, "hasHistorical": true, "description": "Simulated Fake weather data for developers", "enabled": false, "custom": false, "params": { "maxTemp": 25, "minTemp": 5, "_rain6qpf": [], "_lastTS": [] }, "isRunning": false, "name": "Simulator Parser" }, { "lastRun": null, "lastKnownError": "", "hasForecast": false, "uid": 3, "hasHistorical": true, "description": "Personal Weather Station direct data download in pws format", "enabled": false, "custom": false, "params": { "urlPath": "http://weather-display.com/windy/clientraw.txt", "maxAllowedDistance": 100000 }, "isRunning": false, "name": "PWS Parser" }, { "lastRun": "2016-11-15 23:23:10", "lastKnownError": "", "hasForecast": true, "uid": 8, "hasHistorical": false, "description": "North America weather forecast from National Oceanic and Atmospheric Administration", "enabled": true, "custom": false, "isRunning": false, "name": "NOAA Parser" }, { "lastRun": "2016-11-15 23:23:10", "lastKnownError": "", "hasForecast": false, "uid": 1, "hasHistorical": true, "description": "Weather observations from NetAtmo personal weather station", "enabled": true, "custom": false, "params": { "username": "johndoe@netatmo.com", "useSpecifiedModules": false, "_availableModules": [ ], "specificModules": "", "password": "none" }, "isRunning": false, "name": "Netatmo Parser" }, { "lastRun": null, "lastKnownError": "", "hasForecast": true, "uid": 11, "hasHistorical": true, "description": "RainMachine Weather Rules with WUnderground instant data. This feature is in early development do not enable unless you know what you are doing.", "enabled": false, "custom": false, "params": { "apiKey": "", "rules": "[\n {\n \"variable\": \"temperature\",\n \"operator\": \">\",\n \"value\": 36,\n \"action\": \"log\",\n \"params\": {\"msg\": \"Temperature over 36 degrees\"}\n }\n ]", "stationName": "", "_observations": {}, "_actions": [ "log" ] }, "isRunning": false, "name": "Weather Rules Parser" }, { "lastRun": null, "lastKnownError": "", "hasForecast": true, "uid": 2, "hasHistorical": false, "description": "Global weather service from Norwegian Meteorological Institute http://met.no", "enabled": false, "custom": false, "isRunning": false, "name": "METNO Parser" }, { "lastRun": null, "lastKnownError": "", "hasForecast": false, "uid": 9, "hasHistorical": true, "description": "California Irrigation Management Information System weather stations", "enabled": false, "custom": false, "params": { "appKey": "", "customStation": true, "station": 191, "historicDays": 5 }, "isRunning": false, "name": "CIMIS Parser" }, { "lastRun": null, "lastKnownError": "", "hasForecast": true, "uid": 7, "hasHistorical": false, "description": "Global weather service from https://darksky.net (forecast.io)", "enabled": false, "custom": false, "params": { "appKey": null }, "isRunning": false, "name": "ForecastIO Parser" }, { "lastRun": null, "lastKnownError": "", "hasForecast": false, "uid": 4, "hasHistorical": true, "description": "Florida Automated Weather Network observations", "enabled": false, "custom": false, "params": { "station": 480, "useHourly": false }, "isRunning": false, "name": "FAWN Parser" } ] } ##/parser/{id} + Parameters + id (required, number, `1`) ... Numeric `id` of the parser ### GET Returns detalied information about parser + Response 200 (application/json) { "parser": { "lastRun": "2017-02-21 00:52:42", "lastKnownError": "", "hasForecast": true, "uid": 8, "hasHistorical": false, "description": "North America weather forecast from National Oceanic and Atmospheric Administration", "enabled": true, "custom": false, "isRunning": false, "name": "NOAA Parser" } } ## /parser/{id}/data + Parameters + id (required, number, `1`) ... Numeric `id` of the parser ### GET Return all available parser weaher data + Response 200 (application/json) { "parserData": [ { "forecast": { "processed": 1, "id": 5, "time": "2015-06-04 06:13:57" }, "dailyValues": [ { "day": "2015-06-04 00:00:00", "hourlyValues": [ { "hour": "2015-06-04 06:00:00", "temperature": null, "minTemperature": 18.600000000000001, "maxTemperature": 29.800000000000001, "rh": null, "minRh": 37.5, "maxRh": 95, "wind": null, "solarRad": null, "skyCover": null, "rain": null, "et0": null, "pop": null, "qpf": 0, "condition": 3, "pressure": null, "dewPoint": null } ] } ] } ] } ## /parser/{id}/data/{date} + Parameters + id (required, number, `1`) ... Numeric `id` of the parser. + date: `2017-03-15` (string) - Date string, in YYYY-MM-DD format, from which the data is wanted. ### GET Returns parser weather data starting from specified `date` until current day + Response 200 (application/json) { "parserData": [ { "forecast": { "processed": 1, "id": 5, "time": "2015-06-04 06:13:57" }, "dailyValues": [ { "day": "2015-06-04 00:00:00", "hourlyValues": [ { "hour": "2015-06-04 06:00:00", "temperature": null, "minTemperature": 18.600000000000001, "maxTemperature": 29.800000000000001, "rh": null, "minRh": 37.5, "maxRh": 95, "wind": null, "solarRad": null, "skyCover": null, "rain": null, "et0": null, "pop": null, "qpf": 0, "condition": 3, "pressure": null, "dewPoint": null } ] } ] } ] } ## /parser/{id}/data/{date}/{days} + Parameters + id (required, number, `1`) ... Numeric `id` of the parser. + date: `2017-03-15` (string) - Date string, in YYYY-MM-DD format, from which the data is wanted. + days: `30` (number) - How many days to return ### GET Returns parser weather data starting from specified `date` for a number of specified `days` + Response 200 (application/json) { "parserData": [ { "forecast": { "processed": 1, "id": 5, "time": "2015-06-04 06:13:57" }, "dailyValues": [ { "day": "2015-06-04 00:00:00", "hourlyValues": [ { "hour": "2015-06-04 06:00:00", "temperature": null, "minTemperature": 18.600000000000001, "maxTemperature": 29.800000000000001, "rh": null, "minRh": 37.5, "maxRh": 95, "wind": null, "solarRad": null, "skyCover": null, "rain": null, "et0": null, "pop": null, "qpf": 0, "condition": 3, "pressure": null, "dewPoint": null } ] } ] } ] } ## /parser/data ### POST *API 4.6*: Allows Weather data to be pushed to RainMachine from an external source. Multiple weather entries can be sent in each POST request and each weather entry should be in *metric units*. If *timestamp* is not specified the current time at the moment of call will be used. There is no rate limiting but the data will be registered and mixed with data from other weather services hourly. *IMPORTANT*: The QPF and RAIN values shouldn't be send as cumulative values but the measured/forecasted values for each hour or day. The RainMachine Mixer will sum all QPF or RAIN values in the current day to have the day total QPF or RAIN. Also Local Weather Push service should be enabled from Settings > Weather > Developer tab for RainMachine to consider the values being sent. + Request { "weather": [ { "mintemp":null, "maxtemp": null, "temperature": null, "wind": null, "solarrad": null, "qpf": null, "rain": null, "minrh": null, "maxrh": null, "condition": 26, "pressure": null, "dewpoint": null }, { "timestamp": 1563362587, "mintemp":null, "maxtemp": null, "temperature": null, "wind": null, "solarrad": null, "qpf": null, "rain": null, "minrh": null, "maxrh": null, "condition": 26, "pressure": null, "dewpoint": null } ] } + Response 200 (application/json) { "statusCode": 0 } ## /parser/{id}/activate + Parameters + id (required, number, `1`) ... Numeric `id` of the parser. ### POST Activates or deactivates a parser. If a parser is not active it won't be run. + Request { "activate": true, } + Response 200 (application/json) { "statusCode": 0 } ## /parser/{id}/defaults + Parameters + id (required, number, `1`) ... Numeric `id` of the parser. ### POST Sets the default parameters for a parser + Response 200 (application/json) { "statusCode": 0 } ## /parser/{id}/params + Parameters + id (required, number, `1`) ... Numeric `id` of the parser. ### POST Sets the custom parameters for a parser + Response 200 (application/json) { "statusCode": 0 } ## POST /parser/run Forcefully runs parsers, mixer and simulator, this will delete all previous parser data for the specified parser | Variable | Type | Description | | ------------------------------|---------------------|--------------------------------------------------------------------------------------- | | `parserId` | *int* | Which parser to run, empty or -1 means all parsers | | `parser` | *bool* | True means run parser(s), False doesn't run parser(s) | | `mixer ` | *bool* | True means run mixer, False doesn't run mixer | | `simulator` | *bool* | True means run simulator, False doesn't run simulator | + Request { "parser": true, "mixer": true, "simulator": true, "parserId": 1 } + Response 200 (application/json) { "statusCode": 0 } # Group Weather Mixer Weather Mixer aggregates data from multiple weather services (parsers). ## GET /mixer Return all available mixer data + Response 200 (application/json) { "mixerData": [ { "forecastInfo": { "id": 1874, "time": "2016-11-15 23:23:10" }, "dailyValues": [ { "day": "2016-11-14 00:00:00", "temperature": null, "rh": null, "wind": 0.053000000000000005, "solarRad": null, "skyCover": null, "rain": 0, "et0": null, "pop": null, "qpf": null, "condition": null, "pressure": null, "dewPoint": null, "minTemp": 14.699999999999999, "maxTemp": 21.870000000000001, "minRH": 69, "maxRH": 91.329999999999998, "et0calc": 1.5877145686989405, "et0final": 0.79000000000000004 }, { "day": "2016-11-15 00:00:00", "temperature": 14.81, "rh": null, "wind": 0.246, "solarRad": null, "skyCover": null, "rain": null, "et0": null, "pop": 12, "qpf": 0, "condition": 0, "pressure": null, "dewPoint": 12.51, "minTemp": 13.33, "maxTemp": 16.670000000000002, "minRH": null, "maxRH": 86, "et0calc": 1.3350790186449562, "et0final": 1.3400000000000001 }, { "day": "2016-11-16 00:00:00", "temperature": 13.68, "rh": 72, "wind": 0.60400000000000009, "solarRad": null, "skyCover": null, "rain": null, "et0": null, "pop": 4, "qpf": 1.25, "condition": 2, "pressure": null, "dewPoint": 8.5399999999999991, "minTemp": 12.220000000000001, "maxTemp": 16.670000000000002, "minRH": 50, "maxRH": 86, "et0calc": 1.6670258366864579, "et0final": 1.6699999999999999 }, { "day": "2016-11-17 00:00:00", "temperature": 13.130000000000001, "rh": 69, "wind": 0.27599999999999997, "solarRad": null, "skyCover": null, "rain": null, "et0": null, "pop": 1, "qpf": 0, "condition": 3, "pressure": null, "dewPoint": 7.4299999999999997, "minTemp": 10.56, "maxTemp": 17.219999999999999, "minRH": 46, "maxRH": 86, "et0calc": 1.7693698907576059, "et0final": 1.77 }, { "day": "2016-11-18 00:00:00", "temperature": 14.050000000000001, "rh": 71, "wind": 0.31600000000000006, "solarRad": null, "skyCover": null, "rain": null, "et0": null, "pop": null, "qpf": 0, "condition": 3, "pressure": null, "dewPoint": 8.6500000000000004, "minTemp": 10.56, "maxTemp": 18.890000000000001, "minRH": 47, "maxRH": 86, "et0calc": 1.8524008142726132, "et0final": 1.8500000000000001 }, { "day": "2016-11-19 00:00:00", "temperature": 15.42, "rh": 76, "wind": 0.52700000000000002, "solarRad": null, "skyCover": null, "rain": null, "et0": null, "pop": null, "qpf": null, "condition": 0, "pressure": null, "dewPoint": 11.25, "minTemp": 13.33, "maxTemp": 18.329999999999998, "minRH": 58, "maxRH": 86, "et0calc": 1.5998231021898526, "et0final": 1.6000000000000001 }, { "day": "2016-11-20 00:00:00", "temperature": 15.140000000000001, "rh": 80, "wind": 0.27000000000000002, "solarRad": null, "skyCover": null, "rain": null, "et0": null, "pop": null, "qpf": null, "condition": 0, "pressure": null, "dewPoint": 11.67, "minTemp": 13.33, "maxTemp": 17.780000000000001, "minRH": 65, "maxRH": 86, "et0calc": 1.4369331479946277, "et0final": 1.4399999999999999 }, { "day": "2016-11-21 00:00:00", "temperature": 13.140000000000001, "rh": 80, "wind": 0.27000000000000002, "solarRad": null, "skyCover": null, "rain": null, "et0": null, "pop": null, "qpf": 1, "condition": 0, "pressure": null, "dewPoint": 11.67, "minTemp": 13.33, "maxTemp": 17.780000000000001, "minRH": 65, "maxRH": 86, "et0calc": 1.4369331479946277, "et0final": 1.4399999999999999 } ] } ] } ## /mixer/{date} + Parameters + date: `2017-03-15` (string) - Date string, in YYYY-MM-DD format, from which the data is wanted. ### GET Returns mixer data starting from specified `date` until current day + Response 200 (application/json) { "mixerDataByDate": [ { "day": "2016-11-15 00:00:00", "temperature": 14.81, "rh": null, "wind": 0.246, "solarRad": null, "skyCover": null, "rain": null, "et0": null, "pop": 12, "qpf": 0, "condition": 0, "pressure": null, "dewPoint": 12.51, "minTemp": 13.33, "maxTemp": 16.670000000000002, "minRH": null, "maxRH": 86, "et0calc": 1.3350790186449562, "et0final": 1.3400000000000001 }, { "day": "2016-11-16 00:00:00", "temperature": 13.68, "rh": 72, "wind": 0.60400000000000009, "solarRad": null, "skyCover": null, "rain": null, "et0": null, "pop": 4, "qpf": 0, "condition": 2, "pressure": null, "dewPoint": 8.5399999999999991, "minTemp": 12.220000000000001, "maxTemp": 16.670000000000002, "minRH": 50, "maxRH": 86, "et0calc": 1.6670258366864579, "et0final": 1.6699999999999999 }, { "day": "2016-11-17 00:00:00", "temperature": 13.130000000000001, "rh": 69, "wind": 0.27599999999999997, "solarRad": null, "skyCover": null, "rain": null, "et0": null, "pop": 1, "qpf": 1.25, "condition": 3, "pressure": null, "dewPoint": 7.4299999999999997, "minTemp": 10.56, "maxTemp": 17.219999999999999, "minRH": 46, "maxRH": 86, "et0calc": 1.7693698907576059, "et0final": 1.77 }, { "day": "2016-11-18 00:00:00", "temperature": 14.050000000000001, "rh": 71, "wind": 0.31600000000000006, "solarRad": null, "skyCover": null, "rain": null, "et0": null, "pop": null, "qpf": 0, "condition": 3, "pressure": null, "dewPoint": 8.6500000000000004, "minTemp": 10.56, "maxTemp": 18.890000000000001, "minRH": 47, "maxRH": 86, "et0calc": 1.8524008142726132, "et0final": 1.8500000000000001 }, { "day": "2016-11-19 00:00:00", "temperature": 15.42, "rh": 76, "wind": 0.52700000000000002, "solarRad": null, "skyCover": null, "rain": null, "et0": null, "pop": null, "qpf": null, "condition": 0, "pressure": null, "dewPoint": 11.25, "minTemp": 13.33, "maxTemp": 18.329999999999998, "minRH": 58, "maxRH": 86, "et0calc": 1.5998231021898526, "et0final": 1.6000000000000001 }, { "day": "2016-11-20 00:00:00", "temperature": 15.140000000000001, "rh": 80, "wind": 0.27000000000000002, "solarRad": null, "skyCover": null, "rain": null, "et0": null, "pop": null, "qpf": null, "condition": 0, "pressure": null, "dewPoint": 11.67, "minTemp": 13.33, "maxTemp": 17.780000000000001, "minRH": 65, "maxRH": 86, "et0calc": 1.4369331479946277, "et0final": 1.4399999999999999 }, { "day": "2016-11-21 00:00:00", "temperature": 13.140000000000001, "rh": 80, "wind": 0.27000000000000002, "solarRad": null, "skyCover": null, "rain": null, "et0": null, "pop": null, "qpf": 1, "condition": 0, "pressure": null, "dewPoint": 11.67, "minTemp": 13.33, "maxTemp": 17.780000000000001, "minRH": 65, "maxRH": 86, "et0calc": 1.4369331479946277, "et0final": 1.4399999999999999 } ] } ## /mixer/{date}/{days} + Parameters + date: `2017-03-15` (string) - Date for which the data is wanted + days: `30` (number) - How many days to return ### GET Returns mixer data starting from specified `date` for a number of specified `days` + Response 200 (application/json) { "mixerDataByDate": [ { "day": "2016-11-15 00:00:00", "temperature": 14.81, "rh": null, "wind": 0.246, "solarRad": null, "skyCover": null, "rain": null, "et0": null, "pop": 12, "qpf": 0, "condition": 0, "pressure": null, "dewPoint": 12.51, "minTemp": 13.33, "maxTemp": 16.670000000000002, "minRH": null, "maxRH": 86, "et0calc": 1.3350790186449562, "et0final": 1.3400000000000001 }, { "day": "2016-11-16 00:00:00", "temperature": 13.68, "rh": 72, "wind": 0.60400000000000009, "solarRad": null, "skyCover": null, "rain": null, "et0": null, "pop": 4, "qpf": 0, "condition": 2, "pressure": null, "dewPoint": 8.5399999999999991, "minTemp": 12.220000000000001, "maxTemp": 16.670000000000002, "minRH": 50, "maxRH": 86, "et0calc": 1.6670258366864579, "et0final": 1.6699999999999999 }, { "day": "2016-11-17 00:00:00", "temperature": 13.130000000000001, "rh": 69, "wind": 0.27599999999999997, "solarRad": null, "skyCover": null, "rain": null, "et0": null, "pop": 1, "qpf": 1.25, "condition": 3, "pressure": null, "dewPoint": 7.4299999999999997, "minTemp": 10.56, "maxTemp": 17.219999999999999, "minRH": 46, "maxRH": 86, "et0calc": 1.7693698907576059, "et0final": 1.77 }, { "day": "2016-11-18 00:00:00", "temperature": 14.050000000000001, "rh": 71, "wind": 0.31600000000000006, "solarRad": null, "skyCover": null, "rain": null, "et0": null, "pop": null, "qpf": 0, "condition": 3, "pressure": null, "dewPoint": 8.6500000000000004, "minTemp": 10.56, "maxTemp": 18.890000000000001, "minRH": 47, "maxRH": 86, "et0calc": 1.8524008142726132, "et0final": 1.8500000000000001 }, { "day": "2016-11-19 00:00:00", "temperature": 15.42, "rh": 76, "wind": 0.52700000000000002, "solarRad": null, "skyCover": null, "rain": null, "et0": null, "pop": null, "qpf": null, "condition": 0, "pressure": null, "dewPoint": 11.25, "minTemp": 13.33, "maxTemp": 18.329999999999998, "minRH": 58, "maxRH": 86, "et0calc": 1.5998231021898526, "et0final": 1.6000000000000001 }, { "day": "2016-11-20 00:00:00", "temperature": 15.140000000000001, "rh": 80, "wind": 0.27000000000000002, "solarRad": null, "skyCover": null, "rain": null, "et0": null, "pop": null, "qpf": null, "condition": 0, "pressure": null, "dewPoint": 11.67, "minTemp": 13.33, "maxTemp": 17.780000000000001, "minRH": 65, "maxRH": 86, "et0calc": 1.4369331479946277, "et0final": 1.4399999999999999 }, { "day": "2016-11-21 00:00:00", "temperature": 13.140000000000001, "rh": 80, "wind": 0.27000000000000002, "solarRad": null, "skyCover": null, "rain": null, "et0": null, "pop": null, "qpf": 1, "condition": 0, "pressure": null, "dewPoint": 11.67, "minTemp": 13.33, "maxTemp": 17.780000000000001, "minRH": 65, "maxRH": 86, "et0calc": 1.4369331479946277, "et0final": 1.4399999999999999 } ] } # Group Diagnostics Software diagnostics, logs and device status ##/diag ###GET Returns software and device diagnostics. + Response 200 (application/json) { "hasWifi": true, "uptime": "2 days, 22:33:59", "memUsage": 11992, "networkStatus": true, "bootCompleted": true, "lastCheckTimestamp": 1433409727, "wizardHasRun": true, "standaloneMode": false, "cpuUsage": 3.0, "lastCheck": "2015-06-04 02:22:07", "softwareVersion": "4.0.535", "timeStatus": true, "locationStatus": true, "wifiMode": "managed", "gatewayAddress": "192.168.12.1", "internetStatus": true, "cloudStatus": 0, "weatherStatus": true } ##/diag/upload ###GET Returns the status of diagnostics upload progress. Diagnostics are uploaded to RainMachine server for support inspection. + Response 200 (application/json) { "status": 0 } ###POST Starts diagnostics upload to RainMachine support FTP server + Response 200 (application/json) { "statusCode": 0 } ##/diag/log ###GET Retrieves the entire application log with the format: ``YYYY-MM-DD HH:MM:SS,MS - - :`` + Response 200 (application/json) { "log": "YYYY-MM-DD HH:MM:SS,MS - - :" } ##/diag/log/level ###POST Sets the log level for the application. Log level is numeric and can take values: - 10 : Debug - 20 : Info (default) - 30 : Warning - 40 : Errors - 50 : No logging + Response 200 (application/json) { "statusCode": 0 } ##/diag/download ###GET Retrieves an archive with logs and databases from RainMachine *Only Available on 1st gen.* + Response 200 (application/zip) # Group Machine ## /machine/time ### GET Returns the time on machine in format ``YYYY-MM-DD HH:MM:SS`` *Available on 1st gen.* + Response 200 (application/json) { "timestamp": 1495618396, "appDate": "2017-05-24 12:33:16", "timezone": "America/Los_Angeles" } ### POST Changes the time on machine *Available on 1st gen.* + Response 200 (application/json) { "statusCode": 0 } ## /machine/update/check ### POST Request a check for available updates. The status returned from **GET /machine/update** will be updated with new information. This is usually followed by a **GET /machine/update** call. + Response 200 (application/json) { "statusCode": 0 } ## /machine/update ### GET Returns software update status. If there is an available update the field **update** will be true and **packageDetails** field will be a list of available packages in this update: "packageDetails": [ { "packageName": "rainmachine-app", "newVersion": "4.0.840", "oldVersion": "4.0.636" } ] Available **updateStatus** field codes: - STATUS_IDLE = 1 - STATUS_CHECKING = 2 - STATUS_DOWNLOADING = 3 - STATUS_UPGRADING = 4 - STATUS_ERROR = 5 - STATUS_REBOOT = 6 *Available on 1st gen.* + Response 200 (application/json) { "lastUpdateCheckTimestamp": 1433411100, "packageDetails": [], "update": false, "lastUpdateCheck": "2016-11-16 02:45:00", "updateStatus": 1 } ### POST Starts a software update (requires a **POST /machine/update/check** before) *Available on 1st gen.* + Response 200 (application/json) { "statusCode": 0 } ##/machine/sysupgrade ###POST Initiate a firmware download and install. This is for developers only and for RainMachine Mini-8. Using bad data can brick your device. + Response 200 (application/json) { "statusCode": 0 } ## /machine/ssh ### POST Disables/Enables SSH daemon, the daemon will also be stopped/started accordingly. + Response 200 (application/json) { "statusCode": 0 } ## /machine/touch ### POST Disable/Enable touch interface. Use if you want a 3rd party application to control the leds/touch buttons. Only for Mini-8 devices. + Response 200 (application/json) { "statusCode": 0 } ## /machine/reboot ### POST Initiates a system reboot *Available on 1st gen.* + Response 200 (application/json) { "statusCode": 0 } ## /machine/shortdetection ### GET For Mini-8 display detection and settings for valves short circuit protection and reporting. + Response 200 (application/json) { "load": 0, "short": 0, "settings": { "retrymaxcount": 3, "tresholdaction": 63, "actionforload": 1, "dobuzzer": 0, "debouncebuf": 14, "maxperiod": 60000, "watchforload": 2, "debounceint": 2000, "retrymasterwait": 1500, "watchforshort": 1, "disabletime": 10000, "tresholdcheck": 57, "minperiod": 20000, "actionforshort": 1 } } ## /machine/pinqr ### GET (Requires API 4.6.1) (Internal) For HD12/16 and Pro devices returns last pin and code used to generate the QR Code + Response 200 (application/json) { "code": null, "pin": null } ## POST (Requires API 4.6) (Internal) For Pro devices shows a QR Code for Apple HomeKit on device screen. + Request (application/json) + Body { "code": "your homekit code", "pin": "numeric homekit pin" } + Response 200 (application/json) { "statusCode": 0 } # Group Dev Developer and beta update options ## /dev/timezonedb.json ### GET Retrieves the Time Zone database available on the device. This database contains *all* available timezones and their Olson format + Response 200 (application/json) { "America/Los_Angeles": "PST8PDT,M3.2.0,M11.1.0" } ## /dev/beta Get the status of beta updates subscription. ### GET + Response 200 (application/json) { "enabled": false } ## /dev/import/parser ### POST Installs a new parser to the device. Parsers are written in python and follow [RainMachine Parser API](http://docs.rainmachineparsers.apiary.io/). + Response 200 (application/json) { "statusCode": 0 } ## /dev/import/waterlog ### POST Imports a waterlog database from another RainMachine device + Response 200 (application/json) { "statusCode": 0 }