November 12, 2018
i am using a BME280 and BH1750 to gather some environment data and sending them to thingspeak. Working fine so far and i am really happy with thingspeak so far.
However i'd like to calculate the dawn so i can display it on a little webpage where i display all the other data.
The brightness is measured every 30 sec and send to a Thingspeak Channel as field5.
So my idea was to check at which moment the brightness has for 10 minutes an average of under 5 lux and save this moment as the dawning point. Then i can display this on my website.
I know that i can query the average of the via API request. So i thought of sending the query every X seconds to thingspeak, check if the value is below 5 and if so, send an field update to save this moment.
However i just discovered the Plugin React and ThingHTTP. So my question is, can i do this within Thingspeak? That would be really elegant not to send data from my sensor to Thingspeak, query these data on my raspberry and send them back to Thingspeak.
Thansk in advance and regards,
March 7, 2017
I'm pretty sure you can do what you want to do (you can do some pretty elegant stuff), but can you clarify what you want the result to be?
"... not to send data from my sensor to Thingspeak, query these data on my raspberry and send them back to Thingspeak."
You can set a react to trigger when the field value is over a set threshold, or you can set a react on data insert that runs a MATLAB analysis that calculates the recent average. Then it could post the result to a webpage if criteria are met.
You could also use ThingHTTP to query a weather API, and compare your calculated dawn to the published value for that location.
November 12, 2018
I don't want to call an external weather API since the lux from my sensor are sufficient 🙂
I want to determine the moment when the average 10 entries of a channel field is below 5. If this is the case, i just want to send the current datetime to a field on the same channel.
So i could use a cronjob to check every 10 minutes (or any other interval) to check if the feed of the follwoing query is below 5:
However i am looking for a way to do it with thingspeak because otherwise i read the data from the sensor, send it to Thingspeak then query the data every 10 minutes and check if the value is below 5 and send it back to Thingspeak. Is there a way to do this directly with Thingspeak or MathLab?
March 7, 2017
You can set up a MATLAB analysis that reads the thingspeak data and calculates the average.
If the value is below 5, then it can send data back to thingspeak, or trigger some other notification.
You can use TimeControl to call the MATLAB analysis every 10 minutes.
The Getting started tutorial covers much of this and it doesn't take to long to do. It might give you more ideas about how you can use ThingSpeak.
Most Users Ever Online: 166
Currently Browsing this Page:
Guest Posters: 1
Newest Members:qkpham, SANGAMNATH B, swatiiot, firstname.lastname@example.org, Romi, Drakan01
Moderators: cstapels: 460
Administrators: Hans: 405, lee: 457