Display the first date entry in the database

88 views
Skip to first unread message

Meteo Oberwallis

unread,
Feb 16, 2024, 7:59:17 AMFeb 16
to weewx-user
Hello everyone
I would like to display the date of the first entry in the weexs.sdb in Belchertownskin. The reason for this is that you can see how long the weather station has been in operation. Since I operate several stations, this would make my work extremely easier. This could say something like "Operating since: 10/2023" or something like that. Can someone help me with that?
Thank you and sunny greetings

Dominic Reich

unread,
Feb 16, 2024, 8:33:19 AMFeb 16
to weewx...@googlegroups.com
Just fetch the first entry from the database.

sqlite3 dbfile.db "SELECT dateTime FROM archive LIMIT 1;"

(untested)

--
The quieter you become, the more you can hear.
- Ram Dass

Tom Keffer

unread,
Feb 16, 2024, 8:43:02 AMFeb 16
to weewx...@googlegroups.com
I haven't tried it, but I don't see why the following wouldn't work:

$alltime.dateTime.min

-tk

--
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+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/65e5faa2-2cda-4014-ae79-f236286b312fn%40googlegroups.com.

steepleian

unread,
Feb 16, 2024, 9:30:43 AMFeb 16
to weewx...@googlegroups.com
This is what I use which works: -

$alltime.outTemp.firsttime.raw";

Ian


On 16 Feb 2024, at 13:43, Tom Keffer <tke...@gmail.com> wrote:



Meteo Oberwallis

unread,
Feb 16, 2024, 9:37:17 AMFeb 16
to weewx-user
Hello.
Thank you for the answers. The $alltime.outTemp.firsttime.raw works. Now I have to format the whole thing so that I can get it into a “normal date”. Can anyone else give me help?

Tom Keffer

unread,
Feb 16, 2024, 10:12:14 AMFeb 16
to weewx...@googlegroups.com
On Fri, Feb 16, 2024 at 6:37 AM Meteo Oberwallis <sschn...@bluewin.ch> wrote:
Hello.
Thank you for the answers. The $alltime.outTemp.firsttime.raw works. Now I have to format the whole thing so that I can get it into a “normal date”. Can anyone else give me help?


$alltime.dateTime.mintime


Meteo Oberwallis

unread,
Feb 16, 2024, 10:16:27 AMFeb 16
to weewx-user
Hello Tom.

It`s not working

Feb 16 16:14:28 wetterstation wee_reports[11564] ERROR weewx.cheetahgenerator: **** Ignoring template /etc/weewx/skins/Belchertown/about/index.html.tmpl
Feb 16 16:14:28 wetterstation wee_reports[11564] ERROR weewx.cheetahgenerator: **** Reason: cannot find 'mintime' while searching for 'alltime.dateTime.mintime                              e'
Feb 16 16:14:28 wetterstation wee_reports[11564] ERROR weewx.cheetahgenerator: **** To debug, try inserting '#errorCatcher Echo' at top of template
Feb 16 16:14:32 wetterstation wee_reports[11564] INFO weewx.cheetahgenerator: Generated 11 files for report Belchertown in 13.56 seconds
Feb 16 16:14:32 wetterstation wee_reports[11564] INFO weewx.reportengine: Copied 39 files to /var/www/html/weewx/user

Meteo Oberwallis

unread,
Feb 16, 2024, 10:21:20 AMFeb 16
to weewx-user
This works

$alltime.outTemp.firsttime

This is the Result: 01.02.2017 00:01:00

@steepleian: Thanks

Tom Keffer

unread,
Feb 16, 2024, 3:03:29 PMFeb 16
to weewx...@googlegroups.com
Not sure why that doesn't work --- I'll have to investigate.

But, the sure fire way to do this is with

$alltime.start

See the section start, end, and dateTime.


--
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+...@googlegroups.com.

Tom Keffer

unread,
Feb 16, 2024, 4:03:47 PMFeb 16
to weewx...@googlegroups.com
Figured out why my first suggestion did not work. A long time ago, if you wanted the start time of an aggregation, you used $alltime.dateTime, instead of $alltime.start. To keep backwards compatibility, I defined dateTime=start, so the net effect is that 

$alltime.dateTime.min

is equivalent to

$alltime.start.min

which is nonsense. Hence the error.

It may be time to retire the backwards compatibility shim.

-tk

sschn...@bluewin.ch

unread,
Feb 17, 2024, 3:34:00 AMFeb 17
to weewx...@googlegroups.com

Hey Tom.

 

Hey Tom

Thanks for your help and explanation. With the $alltime.outTemp.firsttime it works perfectly

--
You received this message because you are subscribed to a topic in the Google Groups "weewx-user" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/weewx-user/foZYSxdc0Cw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to weewx-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/CAPq0zECp%2BJVBFapDb%2Bnh38%3DW%2BXP8Srt4x27rbk4Fi1ZEa%3DAw2w%40mail.gmail.com.

Reply all
Reply to author
Forward
0 new messages