Pavel ASCA in Discussions
최근 활동: 2021년 6월 16일

How to read a JSON output of another device and put data into thingspeak channel: Maybe useful for others: just figured out, how to parse a JSON, search for a special entry and enter searched value into thingspeak. For this I used the "Get data from webpage" template. An internet search resolved the access to the UBIBOT-json output at "https://api.ubibot.com/channels?account_key=XXX". This is used as "spcify URL". Having several devices a unique search keyword is needed and added in the template for the "specify target string". So even if the template is not 100% for JSON abjects, this is a quick and dirty method to read it out and use it for further analysis. Full code is this: % TODO - Specify URL of the page to read data from url = 'https://api.ubibot.com/channels?account_key=yyy'; % TODO - Specify the target string to search in webpage targetString = 'last_values":"{\"field3\":{\"value\":'; % TODO - Replace the [] with channel ID to write data to: writeChannelID = 666; % TODO - Enter the Write API Key between the '' below: writeAPIKey = 'yxc'; %% Scrape the webpage %% data = urlfilter(url, targetString); %% Analyze Data %% analyzedData = data; %% Write Data %% thingSpeakWrite(writeChannelID, analyzedData, 'WriteKey', writeAPIKey); parse a JSON into a thingspeak channel - here UBIBOT device Do you need an account at ubibot to use this? You could easily do this transformation in MATLAB (within ThingSpeak), then you wouldn't need to include another API. json parse ubibot external devices

ThingSpeak 정보

The community for students, researchers, and engineers looking to use MATLAB, Simulink, and ThingSpeak for Internet of Things applications. You can find the latest ThingSpeak news, tutorials to jump-start your next IoT project, and a forum to engage in a discussion on your latest cloud-based project. You can see answers to problems other users have solved and share how you solved a problem.