SprinklerV2
1.SprinklerV2.getState
Get Current State
| Param | Value | Desc |
|---|---|---|
| method | Sprinkler.getState | Get Current State |
| targetDevice | <String,Necessary> | DeviceId of the Sprinkler you use; |
| token | <String,Necessary> | Net token of the Sprinkler you use; |
| Param | Value | Desc |
|---|---|---|
| data.state | <Object,Necessary> | Current status |
| data.state.running | <Boolean,Necessary> | Current watering status |
| data.state.noWaterWhenRunning | <Boolean,Necessary> | No water when executing watering |
| data.waterMode | <String,Necessary> | Mode, ["manual","schedule"] |
| data.attributes | <Object,Necessary> | Device attributes |
| data.attributes.meterUnit | <Integer,Necessary> | Unit of meter, 0-GAL 1-CCF 2-M3 3-L |
| data.attributes.meterStepFactor | <Integer,Necessary> | Measurement accuracy |
| data.attributes.manualWater | <Object,Necessary> | Manual watering settings |
| data.attributes.manualWater.type | <String,Necessary> | Manual watering type, ["duration","amount"] |
| data.attributes.manualWater.value | <Integer,Necessary> | Duration or amount, Base on type |
| data.attributes.waterDelay | <Object,Necessary> | Water delay settings |
| data.attributes.waterDelay.type | <String,Necessary> | Delay type, ["manual"] |
| data.attributes.waterDelay.duration | <Integer,Necessary> | Delay duration in minute |
| data.running | <Object,Necessary> | Current watering settings |
| data.running.mode | <String,Necessary> | Mode, ["manual","schedule"] |
| data.running.total.type | <String,Necessary> | Watering type, ["duration","amount"] |
| data.running.total.value | <Integer,Necessary> | Duration or amount, base on type |
| data.running.progress | <Integer,Necessary> | Progress of watering |
| data.waterFlowing | <Integer,Necessary> | |
| data.battery | <Integer,Necessary> | Battery level, [0-4] empty to full |
| data.version | <String,Necessary> | Firmware Version of device |
| data.tz | <Integer,Necessary> | Timezone of device. -12 ~ 12 |
2.SprinklerV2.setState
Set Sprinkler State
| Param | Value | Desc |
|---|---|---|
| method | Sprinkler.setState | Set Sprinkler State |
| targetDevice | <String,Necessary> | DeviceId of the Sprinkler you use; |
| token | <String,Necessary> | Net token of the Sprinkler you use; |
| params.running | <Boolean,Optional> | Start/Stop watering |
| params.waterMode | <String,Optional> | Watering mode, ["schedule","manual"] |
| Param | Value | Desc |
|---|---|---|
| data.state | <Object,Necessary> | Current status |
| data.state.running | <Boolean,Necessary> | Current watering status |
| data.state.noWaterWhenRunning | <Boolean,Necessary> | No water when executing watering |
| data.waterMode | <String,Necessary> | Mode, ["manual","schedule"] |
3.SprinklerV2.setAttributes
Set Sprinkler attributes.
| Param | Value | Desc |
|---|---|---|
| method | SprinklerV2.setManualWater | Delay to turn on Sprinkler. |
| targetDevice | <String,Necessary> | DeviceId of the Sprinkler you use; |
| token | <String,Necessary> | Net token of the Sprinkler you use; |
| params.manualWater | <Object,Optional> | Start/Stop Water when in Manual Mode.["start","stop"] |
| params.manualWater.type | <String,Optional> | Manual watering type, ["duration","amount"] |
| params.manualWater.value | <Integer,Optional> | Duration or amount, Base on type |
| params.waterDelay | <Object,Optional> | Water delay settings |
| params.waterDelay.type | <String,Optional> | Delay type, ["manual"] |
| params.waterDelay.duration | <Integer,Optional> | Delay duration in minute |
| Param | Value | Desc |
|---|---|---|
| data.attributes | <Object,Necessary> | Device attributes |
| data.attributes.meterUnit | <Integer,Necessary> | Unit of meter, 0-GAL 1-CCF 2-M3 3-L |
| data.attributes.manualWater | <Object,Necessary> | Manual watering settings |
| data.attributes.manualWater.type | <String,Necessary> | Manual watering type, ["duration","amount"] |
| data.attributes.manualWater.value | <Integer,Necessary> | Duration or amount, Base on type |
| data.attributes.waterDelay | <Object,Necessary> | Water delay settings |
| data.attributes.waterDelay.type | <String,Necessary> | Delay type, ["manual"] |
| data.attributes.waterDelay.duration | <Integer,Necessary> | Delay duration in minute |
4.SprinklerV2.getSchedules
Get Schedule List
| Param | Value | Desc |
|---|---|---|
| method | SprinklerV2.getSchedules | Get Schedule List. |
| targetDevice | <String,Necessary> | DeviceId of the Sprinkler you use; |
| token | <String,Necessary> | Net token of the Sprinkler you use; |
| params.offset | <Integer,Necessary> | Pagination offset |
| Param | Value | Desc |
|---|---|---|
| data.total | <Integer,Necessary> | Total number of schedules number |
| data.count | <Integer,Necessary> | Page size number |
| data.offset | <Integer,Necessary> | Pagination offset |
| data.schedules | <Array<Object>,Necessary> | Schedules |
| data.schedules[*].index | <Integer,Necessary> | Index of schedule |
| data.schedules[*].startDate | <String,Necessary> | Start date of, M-d Formatted |
| data.schedules[*].endDate | <String,Necessary> | End date of, M-d Formatted |
| data.schedules[*].time | <String,Necessary> | Start time, h:m Formatted Formatted |
| data.schedules[*].waterDelay | <Object,Necessary> | Watering mode |
| data.schedules[*].waterDelay.type | <String,Necessary> | Watering mode type, ["duration","amount"] |
| data.schedules[*].waterDelay.value | <Integer,Necessary> | Duration or amount base on type |
| data.schedules[*].days | <Object<,Necessary> | Repeat |
| data.schedules[*].days.type | <String<,Necessary> | Repeat type,["weekly","even_days","odd_days","every_few_days"] |
| data.schedules[*].days.value | <Integer<,Necessary> | If repeat type is "weekly" value should be mask of effected days(Sunday to Saturday), IF type is "every_few_days" value should be days of interval |
| data.schedules[*].valid | <Boolean,Necessary> | Enabled |
5.SprinklerV2.setSchedules
Set Schedule
| Param | Value | Desc |
|---|---|---|
| method | Sprinkler.setSchedules | Set Schedule. |
| targetDevice | <String,Necessary> | DeviceId of the Sprinkler you use; |
| token | <String,Necessary> | Net token of the Sprinkler you use; |
| params.schedules[*].index | <Integer,Necessary> | Index of schedule |
| params.schedules[*].startDate | <String,Necessary> | Start date of, M-d Formatted |
| params.schedules[*].endDate | <String,Necessary> | End date of, M-d Formatted |
| params.schedules[*].time | <String,Necessary> | Start time, h:m Formatted Formatted |
| params.schedules[*].waterDelay | <Object,Necessary> | Watering mode |
| params.schedules[*].waterDelay.type | <String,Necessary> | Watering mode type, ["duration","amount"] |
| params.schedules[*].waterDelay.value | <Integer,Necessary> | Duration or amount base on type |
| params.schedules[*].days | <Object<,Necessary> | Repeat |
| params.schedules[*].days.type | <String<,Necessary> | Repeat type,["weekly","even_days","odd_days","every_few_days"] |
| params.schedules[*].days.value | <Integer<,Necessary> | If repeat type is "weekly" value should be mask of effected days(Sunday to Saturday), IF type is "every_few_days" value should be days of interval |
| params.schedules[*].valid | <Boolean,Necessary> | Enabled |
Same as SprinklerV2.getSchedules
6.Callbacks
You can receive it with Http Callback API or MQTT report topic
<Same as 1.SprinklerV2.getState>