Matthias Borremans in MATLAB Answers
Last activity on 9 Feb 2022

Hi all, I have a ds18b20 and esp8266 with espeasy which posts a temperature reading to thingspeak every 5 minutes, works without any issue. I want to have multiple fields to be able to show a daily average. I think this is not possible with espeasy directly so i have to get some workaround with the visualizations. I have the code below to show an average, it outputs a number, but nothing is plotted. % Read temperature over the past hour from a ThingSpeak channel readChannelID = 1462749; TemperatureFieldID = 1; readAPIKey = '__REDACTED__'; % Get temperature data for the last 60 minutes [data, timeStamps ] = thingSpeakRead(readChannelID,'Fields',[TemperatureFieldID], 'NumPoints',30,'ReadKey',readAPIKey); % Calculate the average temperature avgTemperature = mean(data); display(avgTemperature,'Average Temperature'); % Plot temperature and timestamp plot(timeStamps,avgTemperature) ylabel('temperature (°C)');

About 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.