Welcome to the Cumulus Support forum.

Latest Cumulus MX V3 release 3.28.6 (build 3283) - 21 March 2024

Cumulus MX V4 beta test release 4.0.0 (build 4019) - 03 April 2024

Legacy Cumulus 1 release 1.9.4 (build 1099) - 28 November 2014
(a patch is available for 1.9.4 build 1099 that extends the date range of drop-down menus to 2030)

Download the Software (Cumulus MX / Cumulus 1 and other related items) from the Wiki

Custom SQL command Cumulus MX

From build 3044 the development baton passed to Mark Crossley. Mark has been responsible for all the Builds since. He has made the code available on GitHub. It is Mark's hope that others will join in this development, but at the very least he welcomes your ideas for future developments (see Cumulus MX Development suggestions).

Moderator: mcrossley

Post Reply
josebp
Posts: 65
Joined: Tue 13 Apr 2010 11:37 am
Weather Station: Davis Vantage Pro2
Operating System: WINDOWS 10
Location: Sevilla, España
Contact:

Custom SQL command Cumulus MX

Post by josebp »

Hi all
I wanted to upload with the 'MYSQL' Settings:
custom SQL command to be executed at an interval in minutes the monthly files to 10 minutes, since my monthly .txt is 1 minute.
Use:
"INSERT IGNORE INTO ' Monthly' (LogDateTime,Temp,Humidity,Dewpoint,Windspeed,Windgust,Windbearing,RainRate,TodayRainSoFar,Pressure,Raincounter,InsideTemp,InsideHumidity,LatestWindGust,WindChill,HeatIndex,UVindex,SolarRad,Evapotrans,AnnualEvapTran,ApparentTemp,MaxSolarRad,HrsSunShine,CurrWindBearing,RG11rain,RainSinceMidnight,WindbearingSym,CurrWindBearingSym)'

and I get this error:

You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '"INSERT IGNORE INTO 'Monthly' (LogDateTime,Temp,Humidity,Dewpoint,Windspeed,Wind' at line 1

What do I do wrong?

Thanks greetings,
José Ramón
Image
sfws
Posts: 1183
Joined: Fri 27 Jul 2012 11:29 am
Weather Station: Chas O, Maplin N96FY, N25FR
Operating System: rPi 3B+ with Buster (full)

Re: Custom SQL command Cumulus MX

Post by sfws »

Missing COMMA
(LogDate , Time
josebp
Posts: 65
Joined: Tue 13 Apr 2010 11:37 am
Weather Station: Davis Vantage Pro2
Operating System: WINDOWS 10
Location: Sevilla, España
Contact:

Re: Custom SQL command Cumulus MX

Post by josebp »

Not, is LogDateTime in Monthly ;)
Gracias.
Saludos,
José Ramón
Image
jlmr731
Posts: 225
Joined: Sat 27 Aug 2016 12:11 am
Weather Station: Davis vantage pro 2
Operating System: Debian
Location: Wickliffe, Ohio
Contact:

Re: Custom SQL command Cumulus MX

Post by jlmr731 »

josebp wrote: Fri 29 Mar 2019 6:50 pm
"INSERT IGNORE INTO ' Monthly' (LogDateTime,Temp,Humidity,Dewpoint,Windspeed,Windgust,Windbearing,RainRate,TodayRainSoFar,Pressure,Raincounter,InsideTemp,InsideHumidity,LatestWindGust,WindChill,HeatIndex,UVindex,SolarRad,Evapotrans,AnnualEvapTran,ApparentTemp,MaxSolarRad,HrsSunShine,CurrWindBearing,RG11rain,RainSinceMidnight,WindbearingSym,CurrWindBearingSym)'
dont need the first " and you didnt end it either but still not needed

here is a small one ive used for logging windrun so it should help, for some reason i remember i had to add the Values clause, and since you are adding from Cumulus you need to add the values as web tags. I didnt do any testing but I think the single quotes are needed for each entry

INSERT INTO `wind` (`DateTime`, `windrun`) VALUES ('<#time format="yyyy-MM-dd HH:mm:ss">', '<#windrun>')
User avatar
mcrossley
Posts: 12756
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Custom SQL command Cumulus MX

Post by mcrossley »

You are providing the table and column names but no values? See Jeff's example
josebp
Posts: 65
Joined: Tue 13 Apr 2010 11:37 am
Weather Station: Davis Vantage Pro2
Operating System: WINDOWS 10
Location: Sevilla, España
Contact:

Re: Custom SQL command Cumulus MX

Post by josebp »

:bash: :bash: :bash: :bash: :clap: :clap: :clap:
Best Regards,
José Ramón
Image
Post Reply