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 4017) - 17 March 2024

Legacy Cumulus 1 release v1.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

Script request

Other discussion about creating web sites for Cumulus that doesn't have a specific subforum

Moderator: daj

Post Reply
Mapantz
Posts: 1774
Joined: Sat 17 Dec 2011 11:55 am
Weather Station: Davis Vantage Pro2
Operating System: Windows 11 x64
Location: Dorset - UK
Contact:

Script request

Post by Mapantz »

Hi there

I'm hoping somebody could help me..

I was planning on changing something on my index page that I have. It currently shows today's extremes aqnd at what time they were recorded ie; high temp, low temp, low humidity, high rain rate, high wind speed and high wind gust I was in the process of changing it to show a comparison with the same day 1 year ago. I managed to do that using a script that sfws made, which uses my sql database. However, I thought about it and changed my mind.

What I want to do now, is to show the record values for "today" whether it was set in 2017, or 2016 etc

I'm not savvy enough to be able to do it unfortunately. So, I wondered if anyone knew of a snippet or something similar which can extract those 6 values/times from my sql database.

Thank you in advance.
Image
User avatar
mcrossley
Posts: 12689
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Script request

Post by mcrossley »

A snippet to just do the MaxTemp, becuase you need different days for each value doing more than one in single query would be "tricky" :roll: Best to do a query for each one

Code: Select all

SELECT
	LogDate,
	MAX(`MaxTemp`)
FROM `daydata`
WHERE MONTH(`LogDate`) = MONTH(NOW())
AND DAYOFMONTH(`LogDate`) = DAYOFMONTH(NOW());
Post Reply