seconds less/more than yesterday

124 views
Skip to first unread message

vigilance wx

unread,
Sep 20, 2024, 8:02:42 AM9/20/24
to weewx-user

From the weewx index page Its it possible to  capture the valuve xyz seconds less/more than yesterday

Today has 12 hours, 18 minutes, and 52 seconds of daylight,
230 seconds less than yesterday”

 

I have tried to make my own python scripts to log sunrise sunset times and subtract them but they don’t seem as accurate as the weewx calculation

 

How can I log this figure?

 

Thanks for any advice

Tom Keffer

unread,
Sep 20, 2024, 10:28:40 AM9/20/24
to weewx...@googlegroups.com
I'm not really understanding your question. You have a Python script that calculates a delta time and you want to display it? Or, you want to know how to accurately do the calculation?

-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/8d805477-8602-4c41-98c8-c2f3ac3180b2n%40googlegroups.com.

vigilance wx

unread,
Sep 20, 2024, 11:27:50 AM9/20/24
to weewx-user
hi sorry for not being clear

i would like to log the daily change in the number of seconds for daylight interval changes.
 its is displayed on the weewx index page as  "XYZ" seconds less/more than yesterday 

not wanting to cause any issues within the weewx structure. i originally made my own standalone script not using any of the weewx architecture, but for some reason i am getting strange times

therefore i would like to know how i can log the "XYZ" variable that is displayed on the index page. i didnt want to start messing around blindly within the weewx structure for fear of causing other problems

vigilance wx

unread,
Sep 20, 2024, 11:32:16 AM9/20/24
to weewx-user
just for your information i use weewx 4.10.2  with a GW2000 driver and weewx performs flawlessly 

Tom Keffer

unread,
Sep 20, 2024, 12:00:39 PM9/20/24
to weewx...@googlegroups.com
It sounds like you're using an existing skin which is displaying something like

230 seconds less than yesterday

and you want it to say

3 minutes 50 seconds less than yesterday

Is that correct? If so, you may not have seen the release note Breaking changes for skins that use delta times. This involves adding the suffix ".long_form" to get it to display time using minutes and seconds instead of just seconds.

Or, are you asking about something else?

-tk

vigilance wx

unread,
Sep 20, 2024, 3:10:01 PM9/20/24
to weewx-user
i just want to save the daily  value in seconds  for example 230 to a database i have already crated

Tom Keffer

unread,
Sep 20, 2024, 4:08:16 PM9/20/24
to weewx...@googlegroups.com
You're going to have to be more specific about what you're trying to accomplish. What database? The main WeeWX database? Or, something else?

If it's the main WeeWX database, you will need to add it to the schema, then arrange for the value to be put in the archive record, perhaps by using a WeeWX service. Then it will be automatically included.





vigilance wx

unread,
Sep 20, 2024, 4:20:24 PM9/20/24
to weewx-user
i can modify the database  i  have created services for other data items before such as 1 wire systems and UV sensors but  what is the "tag" assigned to this "seconds"  value so i can capture it
or is it more complicated than that

Tom Keffer

unread,
Sep 20, 2024, 4:51:10 PM9/20/24
to weewx...@googlegroups.com
You've really lost me. I thought you had already done the calculation and now you want to save it in a database. 

If you need to do the calculation, you first create an Almanac object, then add attributes, similar to a tag. For example (NOT TESTED):

import weewx.almanac

timestamp = (some unix epoch time)
latitude = (some decimal latitude)
longitude = (some decimal longitude)

almanac = weewx.almanac.Almanac(timestamp, latitude, longitude)

print(almanac.sun.visible_change)
240

If that's not what you're trying to do, you've got to be more specific. Take your time and write down what the requirements are. 

-tk

vigilance wx

unread,
Sep 21, 2024, 3:51:03 AM9/21/24
to weewx-user
thats it super precisely  what i am after sorry for any confusion and thanks for your help
Reply all
Reply to author
Forward
0 new messages