Black Lives Matter - Action and Equality. ... Adafruit is open and shipping.
0

REQUEST: Future data
Moderators: adafruit_support_bill, adafruit

Forum rules
If you're posting code, please make sure your code does not include your Adafruit IO Active Key or WiFi network credentials.
Please be positive and constructive with your questions and comments.

REQUEST: Future data

by cjdshaw on Fri Jun 12, 2020 7:58 am

At the moment, I'm not allowed to post data with a created_at in the future. This would be handy to allow for, say, weather forecast data or electricity pricing info. Having the whole day's data visible, then logging actual measured temperature value, or power usage in real time would be great

cjdshaw
 
Posts: 23
Joined: Mon May 08, 2017 4:04 pm

Re: REQUEST: Future data

by brubell on Mon Jun 15, 2020 11:48 am

afaik, created_at needs to match the IO server's local time.

This would be handy to allow for, say, weather forecast data or electricity pricing info.

To clarify, this means you'd be importing data from elsewhere?

brubell
 
Posts: 946
Joined: Fri Jul 17, 2015 10:33 pm

Re: REQUEST: Future data

by cjdshaw on Mon Jun 15, 2020 12:40 pm

Exactly. So to elaborate on one of my use cases:

At midnight, a script would download the next 24 hours electricity pricing data from the utility company's server and post it to an IO feed, using future created_at tags
Through the day, a homebrew smart meter would post real time power usage data to another feed
The user could see the two feeds together on a graph and make informed decisions about when to for example, put on a dishwash, based on visible future pricing info

And IO has no problem with creating data with a created_at in the deep past - it doesn't need to match current server time. However, a slightly future value yields:

{"error":"request failed - Record invalid. Failed to save data to <feed>, data created_at may not be in the future"}

cjdshaw
 
Posts: 23
Joined: Mon May 08, 2017 4:04 pm

Please be positive and constructive with your questions and comments.