Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export Sensor Data Modal #11

Open
dsilvers opened this issue Nov 5, 2015 · 4 comments
Open

Export Sensor Data Modal #11

dsilvers opened this issue Nov 5, 2015 · 4 comments
Assignees

Comments

@dsilvers
Copy link
Contributor

dsilvers commented Nov 5, 2015

Ideas:

  • Export to CSV? XLS?
  • Select multiple sensors in a Zone? (multiple sheets in one XLS)
  • Fancy PDF with data, graphs, sparklines, status changes? (probably more than is needed...)
@dsilvers dsilvers self-assigned this Nov 13, 2015
@dsilvers
Copy link
Contributor Author

See branch feature/data-export:
9f7ce13
a7e734a

Here's a quick and easy implimentation of the django-restframework-csv package. It's a little different than what we discussed, but this seems like a really nice and clean integration with DRF and our relatively simple requirements for this project.

To request a CSV:
http://localhost:9000/api/v1/data/?zone_ids=1&format=csv

We can add any of the start_date, end_date, sensor_ids, zone_ids, min/max_value filters to the request to further filter the data.

datetime,id,sensor,sensor_name,state,state_changed,value
2015-11-16T18:14:02.340208Z,9,http://localhost:9000/api/v1/sensors/1/?format=csv,afdsljasdfljkafds,False,True,34.0
2015-11-16T16:44:34.428203Z,3,http://localhost:9000/api/v1/sensors/1/?format=csv,afdsljasdfljkafds,True,False,55.0
2015-11-16T16:44:28.794275Z,2,http://localhost:9000/api/v1/sensors/1/?format=csv,afdsljasdfljkafds,True,True,44.0
2015-11-16T16:44:22.531360Z,1,http://localhost:9000/api/v1/sensors/1/?format=csv,afdsljasdfljkafds,False,True,33.0
2015-11-16T18:13:57.422918Z,8,http://localhost:9000/api/v1/sensors/2/?format=csv,HAY,True,True,43.0
2015-11-16T18:13:51.209636Z,7,http://localhost:9000/api/v1/sensors/2/?format=csv,HAY,False,False,22.0
2015-11-16T18:13:45.035128Z,6,http://localhost:9000/api/v1/sensors/2/?format=csv,HAY,False,False,33.0
2015-11-16T18:13:36.561943Z,5,http://localhost:9000/api/v1/sensors/2/?format=csv,HAY,False,True,33.0
2015-11-16T16:44:40.746121Z,4,http://localhost:9000/api/v1/sensors/2/?format=csv,HAY,True,False,55.0

@dsilvers
Copy link
Contributor Author

Refactored the CSV export format, it's more usable for staff. Removed all the unnecessary fields.

datetime,sensor_name,state,value
2015-11-16T18:14:02.340208Z,afdsljasdfljkafds,False,34.0
2015-11-16T16:44:34.428203Z,afdsljasdfljkafds,True,55.0
2015-11-16T16:44:28.794275Z,afdsljasdfljkafds,True,44.0
2015-11-16T16:44:22.531360Z,afdsljasdfljkafds,False,33.0
2015-11-16T18:13:57.422918Z,HAY,True,43.0
2015-11-16T18:13:51.209636Z,HAY,False,22.0
2015-11-16T18:13:45.035128Z,HAY,False,33.0
2015-11-16T18:13:36.561943Z,HAY,False,33.0
2015-11-16T16:44:40.746121Z,HAY,True,55.0
2015-11-16T19:01:29.955081Z,DEADBEEF00000012345TEST,False,15.0
2015-11-16T19:00:06.868816Z,DEADBEEF00000012345TEST,False,15.0
2015-11-16T19:30:55.179612Z,Test Sensor Excluded,True,22.0
2015-11-16T18:59:27.341773Z,Test Sensor Excluded,True,22.0

@dsilvers
Copy link
Contributor Author

@bkeating - How do we want to integrate this into the UI? (start/end date fields, zone select and submit button)

@bkeating
Copy link
Contributor

See fields in this mockup... I'll get the HTML/CSS/Bower deps comitted for you to plug into. I would suggest jquery-ui's datepicker utility for the datepicker. We use it on LIDM and is extensible enough to satisfy longbets.org, which makes me think it's decent enough in most short-term cases ;) 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants