use IFTTT to read the last data point in a field | 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
use IFTTT to read the last data point in a field
No permission to create posts
November 20, 2019
8:06 am
Avatar
shallowal
New Member
Members
Forum Posts: 2
Member Since:
November 20, 2019
sp_UserOfflineSmall Offline

I have tried the suggested API calls on the API keys page of my channel, but IFTTT seems to read no data.
In an attempt to debug the problem I have tried putting the API string in a browser to view the response and cant seem to find a way to get a response that ONLY includes the actual data point. ie using either XML or JSON results in a whole string of data with the final word being "NULL"
eg:
https://api.thingspeak.com/channels/899681/fields/1.json?api_key=xxxxxxxxxxxx&results=2
in a browser gets a result of:
{"channel":{"id":899681,"name":"Temperature","latitude":"-32.262594","longitude":"152.44172","field1":"Field Label 1","field2":"Field Label 2","created_at":"2019-11-01T06:26:08Z","updated_at":"2019-11-11T12:06:39Z","last_entry_id":4664},"feeds":[{"created_at":"2019-11-20T13:02:37Z","entry_id":4663,"field1":"25.25"},{"created_at":"2019-11-20T13:02:53Z","entry_id":4664,"field1":null}]}

When all I wanted returned is: 25.25

November 22, 2019
8:35 am
Avatar
cstapels
Moderator
Members


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

You can use Read last Entry API call. https://www.mathworks.com/help/thingspeak/readlastentry.html
Also add fields in place of feeds, and use .txt.
For example, form the public cheer lights channel:
https://api.thingspeak.com/channels/1417/fields/2/last.txt

You will need the api_key parameter for a private channel.

FYI, MATLAB answers is now the preferred location for ThingSpeak Community support.

November 22, 2019
8:01 pm
Avatar
shallowal
New Member
Members
Forum Posts: 2
Member Since:
November 20, 2019
sp_UserOfflineSmall Offline

Thankyou for the answer.
With the suggested API call I now get just a single numerical response from the web browser, but still nothing from IFTTT.
I'll continue searching for answers.

November 25, 2019
3:50 pm
Avatar
cstapels
Moderator
Members


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

Can you describe your final goal?
Are you trying to create an IFTTT applet that reads ThingSpeak?

Forum Timezone: America/New_York

Most Users Ever Online: 166

Currently Online:
23 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:

hernancrespo, hernancrespo89, Tommilar01, Alperian, rose22, lokesh4757

Moderators: cstapels: 460

Administrators: Hans: 405, lee: 457