I have a question about the API. Does the API indicate the current status of a hose timer valve being open and/or whether flow is currently detected?
I see in the API docs the valve object is:
{
"valve": {
"id": "string",
"name": "string",
"connectionId": "string",
"photo": {
"id": "string",
"default": true
},
"state": {
"reportedState": {
"connected": true,
"defaultRuntimeSeconds": 0,
"lastWateringAction": {
"start": "2023-10-03T10:42:42.663Z",
"durationSeconds": 0,
"reason": "QUICK_RUN",
"programId": "string",
"flowDetected": true
},
"lastSeen": "2023-10-03T10:42:42.663Z",
"batteryStatus": "GOOD",
"firmwareVersion": "string",
"calendarHash": "string"
},
"desiredState": {
"defaultRuntimeSeconds": 0,
"calendarHash": "string"
},
"matches": true
},
"color": "LIGHT_BLUE",
"detectFlow": true,
"created": "2023-10-03T10:42:42.663Z",
"updated": "2023-10-03T10:42:42.663Z"
}
}
(1) I suspect that the “detectFlow” field indicates whether the valve is configured to detect flow, not whether the value is currently detecting flow. Is that right?
(2) The flowDetected field in the reportedState seemingly indicates whether flow was detected the last time the valve watered. But that watering session may have ended already, right? So, the flowDetected field in the reportedState does not seem to indicate whether flow is currently detected.
Am I missing something? That seems like something that the API would provide access to…If the API does not currently provide this information, please consider it a feature request.
It would be great to have the reportedState include:
(1) currentWateringAction; and
(2) nextWateringAction
with the same fields as the lastWateringAction, as applicable.
(1) Is the most important, though, as nextWateringAction can be derived from the dayView part of the API. But I don’t think currentWateringAction could be. In a perfect world, you could check to see if the lastWateringAction is still ongoing accounting for its start time and duration, but there’s no way to know if that is in fact the case, e.g., user could have manually stopped, flow might not be detected, etc.
Thanks!