2543 1 1
|MikeMills private msg quote post Address this user|
plus 1 0
|This posts describes how to forward GroveStreams stream data, as it arrives, to other systems such as ThingSpeak. It's similar to a webhook.
This technique uses the GS Stream Value Arrival Event to make HTTP calls, in the format of the ThingSpeak API, to forward the information to ThingSpeak.
Step 1 - Create the Value Arrival Event:
1) Right click on your component and choose Edit Component
2) Right click on the Events folder and choose Add - Event - Value Arrival Event
Step 2 - Edit the Event:
1) Enter a name for the event. It can be any name.
2) Select the stream that you want to forward the data to
3) Click Change to create and select an event Action Package. Click the Add button on the Action Package picker to create a new one.
Step 3 - Create the Action Package:
1) Give the package a name. It can be any name.
2) Click Add and select HTTP Call
Step 4 - Edit the HTTP Action:
1) Enter a name. It can be any name.
2) Enter the URL you want to push the data to
3) Select the HTTP method. ThingSpeak requires a POST
4) Click Add to add an HTTP header if one is required.
5) ThingSpeak requires what is shown.
6) Enter the body of the HTTP call. ThingSpeak requires what is shown including the ThingSpeak api_key. [trigger.value] is a GS Action template variable. It will be replaced with the latest stream value being uploaded. Click Message Variables to see a list of all variables. variables can be used in the URL, header, and the body.
7) Click OK to save the Action changes. Click Save to save the new Action Package. Select the new Action Package in the picker window and click OK. Save your Component.
All new Stream values will now be forwarded to the HTTP action you just defined.
Watch the GS organization System notifications for any action HTTP errors that may be occurring.
Some platforms, such as ThingSpeak, may throttle calls from outward facing IP addresses. This will limit the number of GS calls being forwarded to those systems over a specified period. Some systems will return an error while throttling, others return nothing to indicate the call was not processed. ThingSpeak returns an HTTP status code of OK while throttling so no errors are recorded by GroveStreams.
|Post 1 IP flag post|