I'm trying to get an export of a feed from my emoncms instance in json format.
I'm using <server>/<path>/data.json?&apikey=<API>&id=<feedid> and I'm getting back the right data but not in the format I expected.
The feed I'm currently working on is daily energy usage
What I had expected to get was a feed with the format:
[{
"Date" : <datevalue1>,
"Energy" : <energyvalue1>,
},
{
"Date" : <datevalue2>,
"Energy" : <energyvalue2>,
},
...
]
where what I'm getting is:
[[<datevalue1>,"<energyvalue1>"],[<datevalue2>,"<energyvalue2>"],...]
where data is being stored in both the key (Date) and value (energy)
is it possible to export a json feed that only stores data in the values and where the keys only indicate what the data represents?
Re: JSON export from emoncms
Given to impending changes to the structure of emoncms, I chose to write an intermediate php script to do the reformatting. I've attached it below, in case it helps out anyone else.
Re: JSON export from emoncms
Hi, Sounds great. I'm monitoring my home with emoncms modular version on local server RPi . I would like to upload to central server daily or hourly and this sounds like a great way to do it.
Cheers
Peter
Re: JSON export from emoncms
What's the correct path on emoncms.org? I've tried http://emoncms.org/emoncms3/feed/data.json?&apikey=APIKEY&id=1234 and other variantsbut to no avail....
Eamonn