Page 1 of 1

Catchup Custom MySQL

Posted: Tue 11 Mar 2025 3:04 am
by BrunswickWeather
How do I put the correct time in a MySQL database table with the catchup custom MySQL. The time of the Ecowitt observation is not used. The time that is used is the time when it is written to the database not the time of the observation. Is it possible to insert the date and time as per the Monthly SQL update (Logdatetime) during catchup.
The MySQL used:
INSERT IGNORE INTO extralogssensors (DateTime, Time, Date, YearMonth , FourthTemp , FourthHumidity , Temp , Humidity , ExtraOutTemp , ExtraOutHum , InsideTemp , InsideHum , VioletTemp , VioletHum , SoilMoisture1 , SoilMoisture2 , SoilMoisture3 ) VALUES ('<#date > <#timehhmmss >','<#timehhmmss >','<#date >','<#year>-<#month>',<#ExtraTemp1>,<#ExtraHum1>,<#temp>,<#hum>,<#ExtraTemp2>,<#ExtraHum2>,<#intemp>,<#inhum>, <#ExtraTemp3>,<#ExtraHum3>,<#SoilMoisture1>,<#SoilMoisture2>,<#SoilMoisture3> );

Attached a diagnostic file and the image of the database table

Re: Catchup Custom MySQL

Posted: Tue 11 Mar 2025 9:44 am
by mcrossley
It will need a fix in Cumulus - I missed this issue when I implemented the catchup.

Re: Catchup Custom MySQL

Posted: Tue 11 Mar 2025 5:09 pm
by mcrossley
I have come up with a way of fixing this, but it will mean a change to your Custom MySQL statement(s)

In the next release I have defined a new web tag - <#DataDateTime> - which reflects the date/time of the data rather than the clock time which the other date and time web tags use.

So, your statement above would become...

Code: Select all

... VALUES ('<#DataDateTime format="yyyy-MM-dd HH:mm:00">','<#DataDateTime format="HH:mm:00">','<#DataDateTime format="yyyy-MM-dd">','<#DataDateTime format="yyyy-MM">', ...