January 30, 2016
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 30, 2014
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)
Here are steps for anyone looking to try this:
- Set up a ThingHTTP App to read the data.
- 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;
When you execute this MATLAB code, you should see your data inserted into your channel
- Create a new TimeControl app that runs the MATLAB Analysis app in step (2) at a certain schedule.
- Sit back and watch as your channel is populated on schedule with data from your device/website
Most Users Ever Online: 114
Currently Browsing this Page:
Guest Posters: 1
Newest Members:celinabw2, FitoSprayscroma, LunnonGor, lancevl16, bernicenk60, veronicadq18
Administrators: Hans: 387, lee: 457