Merge/Append/Retrieve two channels | ThingSpeak API | Forum

Avatar

Please consider registering
Guest

sp_LogInOut Log In sp_Registration Register

Register | Lost password?
Advanced Search

— Forum Scope —






— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_Feed sp_TopicIcon
Merge/Append/Retrieve two channels
No permission to create posts
June 28, 2019
2:13 pm
Avatar
jjadmin
New Member
Members
Forum Posts: 2
Member Since:
June 28, 2019
sp_UserOfflineSmall Offline

i am working on a Temperature monitor system which collects info from two physical sensors attached to a ESP8266, which works (lets call it Channel A) which gets updates every 30 seconds. I have another channel (lets call it Channel B) which is using Analytics API call to Dark Sky to parse about 3 values from the response. It is triggered every 10 minutes.

I would like to combine this information understanding the different rates. A few ideas that I thought of ( but need some direction on ):

- Create an event when Channel B recieves an insert, get last known (1) value from Channel A and insert into Channel B (new fields)
New record, or append to the last inserted record
- Union the two tables somehow with fuzzy logic on timestamp join
- Update the ino file on the ESP8266 to get the DarkSky info and insert at same time into Channel A
DarkSky API Free is only every 1 minute call
Example of an API call to DarkSky that parses JSON like current.temperature, current.summary, current.windspeed

Thanks in advance for your comments -

June 28, 2019
4:53 pm
Avatar
cstapels
Moderator
Members


Moderators
Forum Posts: 867
Member Since:
March 7, 2017
sp_UserOfflineSmall Offline

I would suggest you use a React on data insert for the first channel and also read the second channel, but then write to a third channel.
You can use thingSpeakRead_...'outputformat' 'timetable') and MATLAB timetable has some good features for resolving and merging timetables to match the data. retime is one of the functions.
Synchronous reads (third suggestion) , would be a good idea and save you extra channels hassle, but what if the dark sky doesn't have the data available at a particular moment, then you might loose data from your sensors. (I'm not sure what the uptime and response time for dark sky is)

Tell us more about your project when you can please!

June 28, 2019
10:24 pm
Avatar
jjadmin
New Member
Members
Forum Posts: 2
Member Since:
June 28, 2019
sp_UserOfflineSmall Offline

Thanks for your response - The purpose of my project to identify the correlation between temperatures in and out of my house as it pertains to heating and cooling.

For Channel A - I have two DS18B20 sensors, one in my attic of my home about 4 feet above the floor, and the other about 2 feet outside of my attic door. This will tell me the temperature in the attic compared to inside the house.

For Channel B - This tells me a general idea of the temperature and cloud conditions from Dark Sky. As a 80 degree sunny day is different from a 80 degree cloudy or windy day.

If I was to compare that, I can say that on a day where it is 80 degrees outside, my attic is typically ## degree.

I eventually want to compare that with the Nest API to when my house had to start cooling the house - say if the attic is at 120 degree, it does ....

Hope that gives you some background

July 2, 2019
9:10 am
Avatar
cstapels
Moderator
Members


Moderators
Forum Posts: 867
Member Since:
March 7, 2017
sp_UserOfflineSmall Offline

Thanks for the description. It will be interesting to see how much the cloud cover changes the heating profile.

Forum Timezone: America/New_York

Most Users Ever Online: 166

Currently Online:
26 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

rw950431: 272

Vinod: 240

piajola: 95

turgo: 70

vespapierre: 63

Adarsh_Murthy: 62

Member Stats:

Guest Posters: 1

Members: 8665

Moderators: 1

Admins: 2

Forum Stats:

Groups: 3

Forums: 14

Topics: 1600

Posts: 5760

Newest Members:

Team_mafia, icXu, emorphistechno, VTVMART, manimozhi, adamhebrew

Moderators: cstapels: 460

Administrators: Hans: 405, lee: 457