-
Notifications
You must be signed in to change notification settings - Fork 25
Description
Following on from #22 and ref forum thread https://community.openenergymonitor.org/t/exporting-multiple-feeds-to-csv/8084?u=pb66
It would also be a great addition to be able to download the CSV output from the graphs page to a CSV file, I know it is possible to copy'n'paste (or use the new "copy to clipboard" button I assume?) and create your own local csv file, but it would be nicer to have emoncms do it for you.
What would also be of great use would be to make that download a user accessible api eg
https://emoncms.org/graph/download.csv?id=12345&apikey=1234abcd
or by graph name
https://emoncms.org/graph/download.csv?name=mygraph&apikey=1234abcd
that way an automated download of a certain set of data feeds and dates can be set up by simply creating and saving a graph.
(It may need an optional "userid" in the request to allow public downloads without an apikey.)
The emoncms/graph/readme.md's changelog does actually say V1 will
Export data as CSV, select time format and whether to show, remove or use the last value when data is missing.
but I suspect that may mean in-directly using copy'n'paste as I can't recall seeing download button.
The "cherry" in this feature request would be an optional "download" button displayed with the embedded graph control buttons so that users can download what they see as a csv file direct from emoncms dashboards. (showing or not showing the download button should be a graph setting like the show tags or show legend etc)
[edit] Essentially the "download" api call in graph would provide a sort of pre-defined multiple feeds download to a (potentially) set timespan eg last month's solar and use, whilst also giving it a short name ie using the graph name rather than recalling all the feedids start time and end time etc etc to create a full feed request api.
Whilst I prefer CSV and that is partially already implemented, it might be worth considering a "download JSON" api too perhaps in time?
https://emoncms.org/graph/download.json?id=12345&apikey=1234abcd
which replies with a list of feed name:values for each listed timestamp.