How do I make calculations with ThingSpeak fields?
Mostrar comentarios más antiguos
In my project, I have 5 channels which gathers the data as in the following fields:
1-) Temperature
2-) Light
3-) Humidity
4-) Particles in Air
5-) Flammable gas
6-) Vapor and smoke
7-) Movement
8-) Sound
Since ThingSpeak channels only retrieve 8 fields, I've created 5 more channels to make visualisations regarding with my data.
I would like to read the data from my channel feeds and calculate AIR Quality Index. Every field in channels will have a coefficient to calculate AQI (Air Quality Index). Eg:
Flammable gas data is more important than Light data in terms of AQI. As a result the fields will have following coefficients.
1-) Temperature (5)
2-) Light (5)
3-) Humidity (5)
4-) Particles in Air (15)
5-) Flammable gas (30)
6-) Vapor and smoke (30)
7-) Movement (5)
8-) Sound (5)
As sum, they will add up to a score over 100 and they will be displayed in a Gauge Widget and an Environmental Status box.
Respuestas (1)
Christopher Stapels
el 6 de Jun. de 2022
Editada: Christopher Stapels
el 6 de Jun. de 2022
1 voto
Use the MATLAB analysis app. Write MATLAB code to read your channel data, do the calculation, and write the AQ value to a new channel. You can store the coeficients in the metadata for your channel.
Read channel data with thingSpeakRead. I prefer to use 'outputformat', 'timetable' so that you can refer to the individual field data by field name and dot notation in the timetable.
Comunidades de usuarios
Más respuestas en ThingSpeak Community
Categorías
Más información sobre Prepare and Analyze Data en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!