-
Notifications
You must be signed in to change notification settings - Fork 19
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
A few questions about the sensors' API and running queries #125
Comments
Returning data for one sensor may not use less resources than downloading the file for all sensors. To return the data for one sensor we use a filter script that needs to go through the whole data file. Downloading this 'static' file (it's generated once per minute) is less work for the server. If you want do download the data of 5 sensors it should be okay to use the /v1/sensor/ filter for each sensor ID once every 3-4 minutes. Some users download the data to their home automation software this way for up to 10 sensors. |
Thanks for the quick reply! So let's say that I want the data for all 10 sensors in a list. In my app, I would use a loop to iterate the list which will result in generating 10 separate requests (1 for each sensor) in less than a second. So if I do this every 5 mins, if I am getting it right, this won't be an issue for you, right? 10 is probably the maximum number of sensors the app will use and I am really looking for a way to not download all the data for hundreds (in the future probably thousands) of sensors when I need the info just for a bunch of them. The "box" filter will not work, as I want to filter by IDs, not by location... |
For a small amount of users this should be okay if you add a small delay between the separate requests. Even a delay of 0.1 seconds should be okay. Its only to spread the requests a bit more. We try to extend the /v1/sensor/ filter so that you can send a request for more than 1 sensor. So you should look in some months if there is an update on our wiki page about this. |
Hey guys,
First of all, congrats on the great air quality tool that you've created! I have a few questions about the API:
Thanks in advance and looking forward to your response!
BR
The text was updated successfully, but these errors were encountered: