I've been playing with ThingSpeak plugins in order to determine the best method of generating a specific chart that I'm after. All I'm looking to do is to plot the first value for every day on a single chart (for say 180 days or so).
I thought this was going to be easy, as I'm not looking for too many data points, and ThingSpeak provides the "timescale=daily" option for this processing to occur on the server. However, daily only works for the UTC day, not for time zones. I'd like to be able to apply an offset, for example, I'm after the first value that is entered every day in EST time, NOT UTC time.
Are there any plans to allow the daily calculations to be offset on the server side? If not, I have to query all of the data and do this myself. Not that big of deal really, except that with the 8000 value limit I'll have to do this many times to get the few values I'm after!
We have time zone parameters that should help you: https://thingspeak.com/docs#timezones .
Here are examples of two charts with different daily calculations based on time zone:
I think your example shows the issue I'm having...
I downloaded your data (last 8000 points)...
If you click on your link showing EST time (http://api.thingspeak.com/channels/9/charts/1?days=2×cale=daily&timezone=America/New_York), you get the following point:
Light: 359, Tue Jun 30 2015, 16:00:00 GMT-0400
Which aligns with the points from the data:
If I'm not mistaken, the first point of the day for EST time (New York) would be at 0400UTC, which corresponds to this point:
So it appears to me that the daily is taking the first point of the day in UTC, NOT EST like requested.
I do see that your first point is changing with the different time zone request, however, this point is more than 8000 points ago, so I cannot see this data.
In addition, when requesting EST time, why is the point showing up at 1600? I'm in the EST time zone, so that is the setting on my computer. I believe it's adjusting for the requested time zone from UTC time, and then also adjusting for the local time set on my computer.
What am I missing???
I dug into this a little more... Since I downloaded your data from yesterday, I added to it by downloading the last 8000 points from today. Now I have the data to cover the last 2 points in your plot. Here's what I see:
The most recent point is the same point in both plots, which is the first point of the day in UTC time (as previous post shows). The first point however, varies depending on the time zone used in the query.
For the UTC case, the correct point is provided (the first point of the day in UTC):
However, for the EST case, this point is provided (no idea why???):
Field 1 has many repeating values. So to narrow down to the correct row, I had to use the field1 and field2 combination.
Are you seeing the same results?
I'm also having issues with timezones. I have a python script GET some JSON feed data to parse and I am using the ?timezone parameter. It's not working. It keeps displaying UTC time and nothing else.
I actually think it worked once or twice, but now it doesn't since I've refreshed more than ten times to see if it fixed itself.
Here is the channel feed I'm trying, which timezone is ignored:
It DOES work with the last entry though:
Your first query is not a valid HTTP request, it should be: https://api.thingspeak.com/channels/11869/feeds.json?results=30&timezone=America%2FLos_Angeles .
Lee - thanks for looking into this and for the update.
Are there any plans to add a max or min for the daily calculations? I could keep this processing on the server side, if a max function was implemented. I see that you have an option to limit the max value returned, but I'm interested in finding the max value for each day.
Any plans for this?
Most Users Ever Online: 114
Currently Online: cstapels, jacktheripper125
Currently Browsing this Page:
Guest Posters: 1
Administrators: Hans, lee