-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathapiary.apib
More file actions
4700 lines (4183 loc) · 159 KB
/
Copy pathapiary.apib
File metadata and controls
4700 lines (4183 loc) · 159 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
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
<a name="post-auth-login"></a>
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=<obtained 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=<obtained 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,