How to compute and aggregate energy production
Latest activity Reply by Christopher Stapels
on 18 Nov 2022
Dear Community,
I'm new on ThingSpeak for nearly 4 weeks and I'm struggling to compute some MATLAB data. Mostly because I don't know the syntax.
I have a hourly graph of solar production in kW, I'm taking a sample every 20 seconds, and I would like to aggregate the data on a daily basis in kWh.
I guess I need to select the last 7 days of data using some thingsread function, add the data into an array and compute the daily data into an average/sum ... As you can see, I mostly got the mechanics but I'm struggling to create the car ;) Is there anyone kind enough to assist me ?
Thansk a lot !
10 Comments
Time DescendingHere it is in two glorious lines. Ive done it using the traffic monitor channel, since it posts data every 15 seconds, you can't read 7 days in one try.
myData=thingSpeakRead(38629,'numdays',2,'outputformat','timetable');
newData=retime(myData,'hourly','sum');
Sign in to participate