7:02 am

May 6, 2020

Hello,
I'm working on an IoT project and I need to create a channel on Thingspeak using HTTP or MQTT methods (Python). I managed to create the channel but I don't know how to set the charts with the options that I want.
import requests r = requests.post('https://api.thingspeak.com/channels.json', data = {"api_key":"XXXXXXX", "name":"Silvia", "field1":"1", "field2": "2"}) # I create the channel with 2 charts
r1 = requests.put('https://api.thingspeak.com/channels/1053983.json', data = {"api_key":XXXXXX", "field1":"fff", "field2": "stcc"}) # changing the name of the charts
1) How can I set chart 1 option "average" to daily?
2) How can I set the status of the channel to true? (The channel should show its status)
I really hope someone can help me, thanks in advance!
11:10 am


Moderators
March 7, 2017

If you want to set the charts options on your channel view, use the pencil icon on the top of the figure.
You can see explanations of the options in the Create Chart documentations, since the parameters are similar.
https://www.mathworks.com/help/thingspeak/createchart.html
and
https://www.mathworks.com/help/thingspeak/rest-api.html
If you want to create a chart with a GET call, you can use the charts API described on that same page. There are parameters for averaging, line style, limits, etc.
You cannot change the standard field chart settings on your channel programatically but you can create custom charts with MATLAB code in the MATLAB visualizations app.
FYI, MATLAB answers is the preferred location for ThingSpeak Community support.
Most Users Ever Online: 166
Currently Online:
24 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:
huldacormier, bogart, estebanmateo93, mikewrite, onlinebusiness, winzy99Moderators: cstapels: 460
Administrators: Hans: 405, lee: 457