How to get value 24 hours ago to compare with now | 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
How to get value 24 hours ago to compare with now
No permission to create posts
August 29, 2020
9:13 am
Avatar
Vali
New Member
Members
Forum Posts: 2
Member Since:
August 29, 2020
sp_UserOfflineSmall Offline

Hello friends, I need to retrieve a single value from a field 24 hours ago and compare it with its current value, my problem is that I can't find a way to recover this old value, unless all the data in this 24 hour series is slow.
Very grateful for any guidance.
Edson

August 31, 2020
2:20 pm
Avatar
cstapels
Moderator
Members


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

You can use the daterange name value pair in thingSpeakRead()
See the doc page for thingSpeakRead more information.
you can use a variable to change the range.
dayAdjust = 5;
myDay = datetime('today')-days(5)
[data,timestamps,channelInfo] = thingSpeakRead(12397,'Fields',[1 4],...
'DateRange',[myDay,datetime('today')])

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

September 1, 2020
8:08 pm
Avatar
Vali
New Member
Members
Forum Posts: 2
Member Since:
August 29, 2020
sp_UserOfflineSmall Offline

thanks for the help, it worked

Forum Timezone: America/New_York

Most Users Ever Online: 166

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

anis, 43994554AKS, suda, marisol, qkpham, SANGAMNATH B

Moderators: cstapels: 460

Administrators: Hans: 405, lee: 457