replacement variables in ThingHTTP | 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
replacement variables in ThingHTTP
No permission to create posts
July 29, 2019
3:40 am
Avatar
TravisH
New Member
Members
Forum Posts: 1
Member Since:
July 29, 2019
sp_UserOfflineSmall Offline

Hello,

I am using React and ThingHTTP to send notifications when one of my temperature values goes outside of a specified value.
This at the moment just sends a note to say check the values, but I am wondering if anyone can share if there are replacement variables for the field name and the value that triggered react.

For example, field1 is fridge temperature, but field2 is freezer temperature. How can i get it to pass the name of the field, and the value so I can just have the one HTTP and not need a new one for each device?

Thanks!

July 30, 2019
4:02 pm
Avatar
cstapels
Moderator
Members


Moderators
Forum Posts: 754
Member Since:
March 7, 2017
sp_UserOnlineSmall Online

All the replacement keys are listed here:
https://www.mathworks.com/help/thingspeak/thinghttp-app.html

I personally use a MATLAB analysis to send notifications through IFTTT.
https://www.mathworks.com/help/thingspeak/analyze-channel-data-to-send-email-notification-from-ifttt.html

You can send additional data in the post, which I use to indicate the value or field or channel that triggered the notification. The extra fields information part of the doc was just updated, please let me know if it still unclear.

August 4, 2019
3:29 am
Avatar
bernd
New Member
Members
Forum Posts: 1
Member Since:
August 4, 2019
sp_UserOfflineSmall Offline

Hello,

i'm having trouble getting these replacement keys to work.
I've created a ThingHTTP that triggers just fine and does post, but the replacement keys never get replaced. instead, they are sent verbatim. This happens regardless of whether I use JSON or URL-encoded.

I'm using this to post to IFTTT, where the request arrives fine, but with the data set to the string "%%channel_ 810383_field_1%%" instead of the channel value.
Any help would be much appreciated. Thanks!

Method: POST
Content Type: application/x-www-form-urlencoded
HTTP Version: 1.1
Host:
Headers:
Body: value1=%%channel_ 810383_field_1%%
Parse String:
Created: 2019-08-04 5:07 am

August 5, 2019
9:12 am
Avatar
cstapels
Moderator
Members


Moderators
Forum Posts: 754
Member Since:
March 7, 2017
sp_UserOnlineSmall Online

bernd,
Can you try to trigger the request with a TimeControl?

August 11, 2019
3:14 pm
Avatar
JonHyeKnudsen
New Member
Members
Forum Posts: 1
Member Since:
August 11, 2019
sp_UserOfflineSmall Offline

I have a problem with it as well.

I try to post to IFTTT with a value in the body, but just get : %25%25channel_ 533028_field_1%25%25 into IFTTT value1.

My Body in the request looks like this: {"value1":" %%channel_ 533028_field_1%% "}, but ThingHTTP does not seem to convert that replacement key into a useful value. I own the channel and the react that I want to trigger this ThingHTTP including itself.

August 19, 2019
9:10 am
Avatar
cstapels
Moderator
Members


Moderators
Forum Posts: 754
Member Since:
March 7, 2017
sp_UserOnlineSmall Online

If you trigger the request with POSTMAN or curl to test it, ThingSpeak will not replace the variables. If TimeControl or React are used to trigger the request, you should have more consistent results. Also you need to choose the content type in ThingHTTP carefully.

Can you let us know if it works with a react or TimeControl triggered request?

Forum Timezone: America/New_York

Most Users Ever Online: 166

Currently Online: cstapels
27 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:

Fathima22, jefflam1994, harrydawson, markpaul7931, sgarsvk2rdx, Win Win

Moderators: cstapels: 460

Administrators: Hans: 405, lee: 457