I can't seem to find a decent approach to my problem. I'm setting up an automade garden which is made up of several sensors collecting different types of data (soil moisture, light conditions, temperature...). I'd like to store all these variables in a MYSQL table under a same DATETIME, i.e., temperature, humidity, soil moisture... at 23:45 2019-05-17. This means that I should get the data simultaneously and insert it into the DB.
Whilst writing the script, I have defined several functions to read these values, but how should I store them (keep track of the previous sensor's data) so that I can upload them at the same time (under the same DATETIME parameter). I thought about using a dictionary, but in case a sensor fails and the process runs again, the sensor's previous value wouldn't be overwritten and should be uploaded again.
I wish you could understand. Should you require further information, please post a reply.