Forward data to Thingspeak

5 years 10 months ago #4001 by Pekkis69
Hi,

I need make automation code how I can send data from EasyIOT server to Thingspeak. This is examble how is possible send by browser " api.thingspeak.com/update?api_key= *** Write API key *** &field1=0"

Please Log in or Create an account to join the conversation.

5 years 2 months ago #4012 by essenemari
Hi,
EasyIoT's DB is based on SQL-lite. Having that info you can consider to write some loop to read DB and use CURL to send data wherever you want.

Please Log in or Create an account to join the conversation.

3 years 7 months ago - 3 years 7 months ago #4025 by essenemari
Oftopic, however maybe useful for someone. I discovered very quick way to get data from DB.

For analyses of home heating costs, I needed to know average temperature in home from few sensors and temperature outside.

0. choose your time range. Convert dates to epoch time in miliseconds:  www.epochconverter.com/
1. In Linux command line run sqllite (maybe done from W10 DB Browser for SQLite)
sqliete3
2. attach DB from EasyIoT
attach "/home/pi/easyiot/EasyIoTDatabase.sqlite" as db1;
3. check tables 
.tables
4. Pull the addressid of nodes you need, i.e.
select * from addresses where address="N4S0";
5. take average temperature from sensors inside in time frame i.e. from 1st February to 20th February 
select avg(value) from raw_values where address in (3, 6, 4, 7, 5) and timestamp between 1610236800000 and 1613779200000; 
enjoy your output. 
6.  Take average temperature from weather station sensors:
select avg(value) from raw_values where address=6 and timestamp between 1610236800000 and 1613779200000; 

BTW
I am copy database to Windows or Desktop Linux instead of running it directly on Rpi to not overload SD Card (5th year the same card with EasyIoT)

Please Log in or Create an account to join the conversation.

Time to create page: 0.149 seconds

Forum latest

  • No posts to display.