ThingHTTP - How to use read data? | ThingSpeak Apps | 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
ThingHTTP - How to use read data?
No permission to create posts
January 30, 2016
6:21 am
Avatar
VanKurt
New Member
Members
Forum Posts: 1
Member Since:
January 30, 2016
sp_UserOfflineSmall Offline

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?

January 31, 2016
9:56 pm
Avatar
rw950431

Top
Members
Forum Posts: 261
Member Since:
January 30, 2014
sp_UserOfflineSmall Offline

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)

February 22, 2017
4:57 pm
Avatar
Vinod

MathWorks
Members
Forum Posts: 200
Member Since:
May 1, 2016
sp_UserOfflineSmall Offline

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:
14 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

rw950431: 261

Vinod: 196

piajola: 85

turgo: 70

vespapierre: 63

Adarsh_Murthy: 62

Member Stats:

Guest Posters: 1

Members: 5703

Moderators: 0

Admins: 2

Forum Stats:

Groups: 4

Forums: 17

Topics: 1313

Posts: 4565

Newest Members:

celinabw2, FitoSprayscroma, LunnonGor, lancevl16, bernicenk60, veronicadq18

Administrators: Hans: 387, lee: 457