I have a question, but let me introduce myself since this is my first post: My name is Aaron. I'm presently working on a way to quickly check my daily water usage from my phone (and possibly shut off my water remotely, but I'm calling that "extra credit" right now). I'm on a well system near the ocean, and have to be very careful in order to avoid seawater intrusion. Nearby wells have failed, making me very nervous!
Being a software developer by trade, this seemed like a fun opportunity for some spare-time coding. I'm having a bit of trouble with the Push API, though. Basically, I've been fiddling around with the Push API Builder and can't quite understanding how the counts and start/end dates interact. I'd also love to know exactly what the format of the UTC+ms numbers is.
When I use the API Builder, I find it funny that entering any start and end dates (e.g., setting both of them to today--21032015--or maybe one day apart) causes the query to return 0 results. Totally mystified there. Any ideas?
In the end, I'm basically hoping to quickly find out how many gallons I've used since midnight on the current day. Conceptually, this would involve getting the pulse counter reading closest to midnight, subtracting this from the latest reading, and multiplying by gallon/pulse to get the daily gallons. Getting the latest reading is pretty easy. Getting the reading closest to midnight is a bit less obvious. One thought--which errs on the side of pessimism--would be to query one value from a short span of time immediately preceding midnight. Would that work? If I use the UTC+ms or starttime/endtime values to construct a range that describes 11pm-12am and ask for 1 reading, will I get the value closest to midnight? Or should I? Again, I can't get this to work with API Builder, so I'm suspicious of my thinking.
Of course, I could query all values for the current day, pick the highest and lowest, and diff those, but that's a big query from which to distill a single number!
I'm a little lost.
If there's a paper that describes how all of these filters are used, their order of precedence, etc., that would be totally awesome!!
EDIT: As an example, I'd expect the following URL to return an hour's worth of JSON-formatted data for pulse counter #1 for the hour 23:00:00 to 23:59:59 on the night of March 20th, 2015. But it returns nothing. (This is the Push API Builder meter, BTW, not my own.)
Code: Select all