How to get yesterday's kWhd value?

Hi,

I've got a kWhd feed using PHPTIMESERIES and from the vis view I can see each days value at 12:00.  How do I pull that value from the feed API? It seems whatever json I user (get/data/histogram) I get back blank data such as 0/false/[]

Thanks for your help!
Kev

JumpMaster's picture

Re: How to get yesterday's kWhd value?

I've managed to get a list of feeds from data.json and limited to a single item.

 

http://emoncms.org/feed/data.json?id=8343&start=1440633600000&end=144072...

and here's the output

[[1440630000000, 10.639547348022]]

Is there a way of directly requesting entry 1440630000000?

Thanks,
Kev

TrystanLea's picture

Re: How to get yesterday's kWhd value?

Hello Kev, limiting a data.json request to one item is the only way to do it at the moment, Its the method I recently used to fetch last week/month/year data in myelectric.

All that you need to do, much as you've worked out is set the end time to 1 second after the time you wish to request and the interval to 1 second and then it will give the value at the start time requested.

http://emoncms.org/feed/data.json?id=8343&start=1440633600000&end=1440633601000&interval=1

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.