- Sat Feb 04, 2023 4:13 am
#95954
Project updated 02/01/2023: Now logs data to Google Sheets continously; every 15 minutes for years.
Google Script that retrieves environmental data (datetime, temperature, heat index, humidity, dewpoint, pressure, and a difference value) from a web interface and appends it to a Google Spreadsheet. The sheet name is based on the current month and year, and a new sheet will be created with an additional number if the sheet with the same name already exists. If it's the last day of the current month, a new sheet for the next month will be created. The script has several functions, including getting the name of the current month, creating a new sheet with the specified name, adding headers to the new sheet, and appending the data to the sheet. Script is designed to create a new sheet at the end of each month with the name of the month and the year. The year will be incremented by 1 if the "flag" variable is set to 1. The "testForNextYear" function is supposed to update the "flag". The script checks if the current time is equal to the first day of the next year. If it is, the flag is set to 1.
Script modified by William Lucid; coding assist from OpenAI.com and ChatGPT. My first experience attemping to write GS Script; without OpenAI.com and ChatGPT, would have been an impossiable task!
Live feed of data from ESP32 to Google Sheet "BME280 ChatGPT"Gist of "BME280 ChatGPT" Google Sheets App ScriptWilliam