I posted this first in another thread, but think this should be posted separately:
I have a question about the API. Does the API indicate the current status of a hose timer valve being ope/closedn 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 (at least during some portion of the watering session?). But that watering session may have ended already So, the flowDetected field in the reportedState does not seem to indicate whether flow is currently detected, right?
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.
If the API in fact does not currently provide this information in some way, please consider it a feature request.
Options:
(1) Include a ‘stop’ field in the lastWateringAction field of reportedState, indicating if and when the last watering action was reported as stopped (i.e., valve closed) (value will be null if has started but not stopped yet)
(2) include a “valve” field directly under reportedState to indicate whether the valve was open or closed as of its last report
(3) Include a “flowDetected” field directly under the reportedState object, to indicate whether flow was reported in the valve’s last report. So, this new “flowDetected” field indicates whether the valve is “currently” detecting flow as of its last report, wherewas the existing “flowDetected” field indicates whether the valve detected flow at some point during that last watering session (which may have since ended and therefore doesn’t reflect whether the valve “currently” detects flow)
This would be huge. Thank you for considering it.
An added bonus would be to have the reportedState also include “nextWateringAction” with the same fields as the lastWateringAction, as applicable.