Hey, Robin,

I don't know the weewx way, but here is a sql way that may lead some smart 
person to a better solution.  :-/
I used the system date command up front to get the month-day, which is to avoid 
asking SQLite to do that computation for every row within the query.

$ today=$(date +%\m-%\d); sqlite3 -header /var/lib/weewx/weewx.sdb "select 
date(dateTime, 'unixepoch', 'localtime') as day, min, max from 
archive_day_outTemp where strftime('%m-%d', day)='$today' group by day;"
day|min|max
2017-05-11|46.9|70.0
2018-05-11|43.5|54.9
2019-05-11|39.02|52.7

Oh, and in case outTemp is not the name of your sensor per archive_day_outTemp, 
above, you can glean the table you need from here:

$ sqlite3 /var/lib/weewx/weewx.sdb ".tables"

And of course to see the column names available, it's:

$ sqlite3 /var/lib/weewx/weewx.sdb ".schema archive_day_outTemp"
CREATE TABLE archive_day_outTemp (dateTime INTEGER NOT NULL UNIQUE PRIMARY KEY, 
min REAL, mintime INTEGER, max REAL, maxtime INTEGER, sum REAL, count INTEGER, 
wsum REAL, sumtime INTEGER);

Or the more human readable way:

$ sqlite3 -header /var/lib/weewx/weewx.sdb "select * from archive_day_outTemp 
limit 1;"
dateTime|min|mintime|max|maxtime|sum|count|wsum|sumtime
1325394000|||||0.0|0|0.0|0

HTH.  =D

Regards,
\Leon
--
Leon Shaner :: Dearborn, Michigan (iPad Pro)

> On May 11, 2019, at 9:30 AM, Robin <robin.sand...@otenet.gr> wrote:
> 
> I apologise if this has been asked before or if there is a simple and obvious 
> way to do this, but I can't see it.
> 
> I want to display the temperature (min,max) for today's date for each year 
> since we started keeping records.
> 
> Can somebody point me in the right direction?
> 
> Thanks people.
> -- 
> You received this message because you are subscribed to the Google Groups 
> "weewx-user" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to weewx-user+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/weewx-user/75abaada-5cb6-47ec-9d3e-0b3046f4f9a3%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to weewx-user+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/A548DC9B-FF2C-4C11-ABE2-F99F13EF8640%40isylum.org.
For more options, visit https://groups.google.com/d/optout.

Reply via email to