ThingHTTP - How to use read data? | ThingSpeak Apps | Forum

Avatar

Please consider registering
Guest

Search

— Forum Scope —






— Match —





— Forum Options —





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

Register Lost password?
sp_Feed sp_TopicIcon
ThingHTTP - How to use read data?
Avatar
VanKurt
New Member
Forum Posts: 1
sp_UserOfflineSmall Offline
1
January 30, 2016 - 6:21 am
sp_Permalink sp_Print

I have set up a ThingHTTP + TimeControl. These grab a value from a website every hour using the "parse string".
This works very well ūüôā

But how do actually USE this value? For example, I would like to store it in one of my channels.
Is this possible?

What else can I do with data read by ThingHTTPs?

Avatar
rw950431

Forum Posts: 252
sp_UserOfflineSmall Offline
2
January 31, 2016 - 9:56 pm
sp_Permalink sp_Print

there is no direct way of doing this, even though its an obvious thing to do.

It seems that thingHTTP was originally designed to allow a microcontroller with limited resources to easily extract data from a web-page, even one that is HTTPS:// or otherwise too complicated.

It can now be done with a matlab analysis script . Set up timecontrol to trigger the matlab analysis. Use 'webread' to poll your thingHTTP and the included thingspeakwrite to update the channel. You may have to do a little massaging of the data in between. (I dont claim to be a Matlab expert)

Avatar
Vinod

Forum Posts: 186
sp_UserOfflineSmall Offline
3
February 22, 2017 - 4:57 pm
sp_Permalink sp_Print sp_EditHistory

Here are steps for anyone looking to try this:

  1. Set up a ThingHTTP App to read the data. 
  2. Create a new MATLAB Analysis app with this code:
     

    val = str2double(webread('https://api.thingspeak.com/apps/thinghttp/send_request?api_key=INSERT_API_KEY_OF_THINGHTTP_FROM_STEP_1'));
    myChannelNum = PUT_CHANNEL_NUMBER_HERE;
    myChannelAPIKey = PUT_CHANNEL_WRITE_API_KEY_HERE;
    thingSpeakWrite(myChannelNum,val,'WriteKey', myChannelAPIKey);
    When you execute this MATLAB code, you should see your data inserted into your channel

  3. Create a new TimeControl app that runs the MATLAB Analysis app in step (2) at a certain schedule.
     
  4.  Sit back and watch as your channel is populated on schedule with data from your device/website Cool
Forum Timezone: America/New_York

Most Users Ever Online: 114

Currently Online:
19 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

rw950431: 252

Vinod: 164

cstapels: 96

piajola: 75

vespapierre: 63

Adarsh_Murthy: 59

Newest Members:

winnieeq69

AutoCheernpen

Bostermet

engladNed

iivenul

olewaeayafaku

Forum Stats:

Groups: 4

Forums: 17

Topics: 1313

Posts: 4565

 

Member Stats:

Guest Posters: 1

Members: 5703

Moderators: 0

Admins: 2

Administrators: Hans, lee