Hi everybody!
This is the problem. I have a Tilt Hydrometer (https://tilthydrometer.com). The Tilt send the data to a Google Sheet. Then, I need to take that data and put it in a ThingSpeak channel. I'm a beginner in ThingSpeak, And I really need the help with this. Any idea?

 채택된 답변

Vinod
Vinod 2020년 6월 26일

2 개 추천

You can set up a MATLAB analysis code to use this function to read data from your google sheet. Once you have the data in your MATLAB analysis, you can use thingSpeakWrite to write a value into a ThingSpeak channel. You can completely automate this by scheduling your MATLAB analysis using the TimeControl app to do this on a regular interval.

댓글 수: 5

Thanks Vinod.
I´m two days trying to make ir works, but I have some problems.
1) Now, I have the data in a Matlab Analysis like you told me. It works perfect.
But, 2) When I try to send it in the ThnigSpeak Channel woth the thingSpeakeWrite, the system give me an error: "error using Tilt1 Google (line 36). 'Values' value must be an array or a table.".
The data is something like this:
ans =
325×7 cell array
{'Timestamp' } {'Timepoint'} {'SG' } {'Temp'} {'Color'} {'Beer' } {'Comment' }
{'6/27/2020 7:31:02'} {'44,009.69'} {'1.001'} {'78' } {'RED' } {'Prueba 1'} {0×0 double}
{'6/27/2020 7:31:14'} {'44,009.69'} {'1.001'} {'78' } {'RED' } {'Prueba 1'} {0×0 double}
{'6/27/2020 7:32:09'} {'44,009.69'} {'1.00
How can I write the first Column in the Channel 1 Field 1, the second in the Channel 1 Field 2, etc...?
As the error says, you need to convert your cell array from the Google sheet into a table.
SGTable = table(ans(:,1), ans(:,3),'VariableNames',{'timestamp','SG'}) % where ans is the cell array you got back from reading the google sheet
Now, you should be able to use thingSpeakWrite to get the data in SGTable to ThingSpeak.
BEHNAM MOBARAKI .
BEHNAM MOBARAKI . 2022년 5월 23일
Hi. Could you please explain how to do the opposit? I need to send the data from one channel of ThingSpeak to the Google sheets.
Regards
Behnam
Vinod
Vinod 2022년 5월 23일
편집: Vinod 2022년 5월 23일
BEHNAM MOBARAKI .
BEHNAM MOBARAKI . 2022년 5월 24일
Thanks for the recomandation. I have a monitoring system that should be installed on a building, sending the data to ThingSpeak IoT in real time. On the other hand I have developed a Matlab algorithm to get the data from ThingSpeak and transfer them to a Google sheet, in real time. The case is that when I turn off the Laptop this process stops as the Matlab algorthm is not working anymore.
Is there any solution for that?? Lets say a Matlab function to use it in the algorithm to make the algorithm keep working for a year, even if the laptop is turn off?!
Regards
Behnam

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

커뮤니티

더 많은 답변 보기:  ThingSpeak 커뮤니티

카테고리

도움말 센터File Exchange에서 ThingSpeak에 대해 자세히 알아보기

제품

릴리스

R2019a

질문:

2020년 6월 25일

댓글:

2022년 5월 24일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by