Apply a formula to incoming data | ThingSpeak Plugins | 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
Apply a formula to incoming data
No permission to create posts
May 7, 2015
5:59 am
Avatar
rodri
Italy

Silver
Members
Forum Posts: 19
Member Since:
May 23, 2014
sp_UserOfflineSmall Offline

Hi,
Is it possible to create a plugin in which a formula is applied to data? I mean I have raw data coming from the sensor and I want the chart displaying converted value, let's say:
Y=aX+b
where, X is raw data sent from sensor and Y is converted data that I want to display

Thanks,
Rodri

May 7, 2015
8:51 am
Avatar
lee

Admin
Forum Posts: 457
Member Since:
March 14, 2011
sp_UserOfflineSmall Offline

Hi Rodri,

Yes this is possible, but you'll have to know JavaScript and manipulate the data points directly after they're retrieved but before the chart is drawn.

lee

May 8, 2015
1:25 am
Avatar
rw950431

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

Hi Rodri
I did something similar with https://thingspeak.com/plugins/3339. In my case to convert steadily-rising counter values into a rate according to the formula (this_count-last_count)/(this_time-last_time)

Hopefully you can 'view page source' to get the code. Thingspeak doesnt have a lot of support for sharing details of public plugins.

June 30, 2015
4:54 am
Avatar
rodri
Italy

Silver
Members
Forum Posts: 19
Member Since:
May 23, 2014
sp_UserOfflineSmall Offline

Yes finally I also used plugins. Thank you very much

June 14, 2018
11:30 am
Avatar
danu
New Member
Members
Forum Posts: 2
Member Since:
June 13, 2018
sp_UserOfflineSmall Offline

may i know how to Apply a formula y = ax + b to incoming data in thingspeak?
i need it

June 19, 2018
10:01 am
Avatar
cstapels
Moderator
Members


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

danu,
Would it be acceptable to apply to formula after you get the data in a channel? I would recommend you write the data to a channel and then use a MATLAB analysis script to read the data, apply the formula, and then write the data to another channel. There are several good tutorials that show this kind of work flow. For example the get started tutorial:
https://www.mathworks.com/help/thingspeak/getting-started-with-thingspeak.html
or the wind chill tutorial:
https://www.mathworks.com/help/thingspeak/calculate-wind-chill.html

These tutorials also show how to set up a time control to perform the formula application on a regular schedule.
If you want to apply the formula each time new data is posted, you can use the react app. Here is an explanation of that work flow:
https://www.mathworks.com/help/thingspeak/monitor-channel-inactivity-using-multiple-thingSpeak-apps.html

Forum Timezone: America/New_York

Most Users Ever Online: 114

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

dollyip18, toddbt2, SatrapB, Ronalpsync, wandaim69, GregoryGof

Administrators: Hans: 387, lee: 457