Page 1 of 1

Do any exist?

Posted: Thu 14 Apr 2022 11:11 am
by Mapantz
I'm currently logging grass temp, soil temp, soil moisture and leaf wetness to an SQL table, just for recent graphing purposes.

Does anyone know of a script, or have a way to log and extract daily highs/lows for that particular data? :geek:

Re: Do any exist?

Posted: Thu 14 Apr 2022 11:33 am
by freddie
I log the realtime values of some of those elements, and run a query at rollover to save values with their respective date/times to the day summary table.

Re: Do any exist?

Posted: Mon 18 Apr 2022 12:44 am
by BeaumarisWX
freddie wrote: Thu 14 Apr 2022 11:33 am I log the realtime values of some of those elements, and run a query at rollover to save values with their respective date/times to the day summary table.
Hi Freddie,

I do the same as Mapantz just upload to MySql (I do have some views I have off the main upload, however your rollover query day summary sounds perfect, any chance you could share same, would be greatly appreciated.

Kindest Regards,
Tony

Re: Do any exist?

Posted: Wed 20 Apr 2022 2:01 pm
by freddie
BeaumarisWX wrote: Mon 18 Apr 2022 12:44 am
freddie wrote: Thu 14 Apr 2022 11:33 am I log the realtime values of some of those elements, and run a query at rollover to save values with their respective date/times to the day summary table.
Hi Freddie,

I do the same as Mapantz just upload to MySql (I do have some views I have off the main upload, however your rollover query day summary sounds perfect, any chance you could share same, would be greatly appreciated.
Hi Tony,

This is my end-of-day query:

Code: Select all

INSERT IGNORE INTO ExtraDayfile (LogDate,GrassMin,GrassMinTime,Depth30cmTemp) Values(str_to_date('<#metdateyesterday>', '%m/%d/%Y'), (select min(GrassTemp) from ExtraRealtime where LogDateTime >= str_to_date('<#metdateyesterday> 09:00:00', '%m/%d/%Y %H:%i:%s') and LogDateTime < str_to_date('<#shortyear>-<#month>-<#day> 09:00', '%Y-%m-%d %H:%i')), (select min(LogDateTime) from ExtraRealtime where GrassTemp = (select min(GrassTemp) from ExtraRealtime where LogDateTime >= str_to_date('<#metdateyesterday> 09:00:00', '%m/%d/%Y %H:%i:%s') and LogDateTime < str_to_date('<#shortyear>-<#month>-<#day> 09:00', '%Y-%m-%d %H:%i')) and LogDateTime >= str_to_date('<#metdateyesterday> 09:00:00', '%m/%d/%Y %H:%i:%s') and LogDateTime < str_to_date('<#shortyear>-<#month>-<#day> 09:00', '%Y-%m-%d %H:%i')), (select Depth30cmTemp from ExtraMonthly where LogDateTime = str_to_date('<#metdateyesterday> 09:00:00', '%m/%d/%Y %H:%i:%s')));
I have separate tables for my extra sensors data - ExtraRealtime, ExtraMonthly and ExtraDayfile. I roll over at 09:00. The query I run at rollover gets the lowest grass temperature and the time it occurred from the ExtraReatime table, and stores this in ExtraDayfile. It also gets the 30cm depth temperature at 09:00 and stores that in the same row.

You may not wish to do exactly the same operations, but this code could be used as a starting point.