average - Averaged Historical Data from Xively feed API -


the xively (cosm) web interface issues following function averaged historical datapoints

// averaged historical datapoints https://www.xively.com/feeds/<feedid>/datastreams/humidity/graph.json&duration=21600seconds&interval=30&limit=1000&find_previous=true&function=average 

i fetch averaged historical data points (that if there multiple samples within interval asking return averaged rollup representative point of interval) using xively rest api

however seems return raw data points (they pick 1 datapoint represent sample interval)

https://api.xively.com/v2/feeds/127181539.json?datastreams=temp&duration=1month&interval=21600&limit=200&function=average 

so questions

1) how can return averaged data points xively web interface? parameter needed feed api call?

2) know parameter interval_type? have read here (https://xively.com/dev/docs/api/quick_reference/historical_data/) 50 times still don't it!

update

  1. function=sum function=average works /datastreams/temp.json endpoint. also, discrete default.
  2. the function=average not works /feeds/feed_id.json endpoint. maybe bug?

if you've got "function=average" (which have) query parameter, points should bucketed interval specified (21600 seconds / 6 hours). each point represents average value period.

it might worth making query against datastreams endpoint though, e.g.

https://api.xively.com/v2/feeds/127181539/datastreams/temp.json?duration=1month&interval=21600&limit=200&function=average

hope helps!


Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

android - Keyboard hides my half of edit-text and button below it even in scroll view -

css - Make div keyboard-scrollable in jQuery Mobile? -