runtime intercepter seconds to day, hours and minute

73 views
Skip to first unread message

Meteo Oberwallis

unread,
Oct 1, 2024, 11:54:50 AM10/1/24
to weewx-user
Hello

I have a question. The "runtime" in ecowitt-client is in seconds. When i set de .long_form comes the Time in minute und seconds, not in day:hour:minute. i see this on my site " Systemlaufzeit: 9 minutes, 12 seconds ". Not more. This is written by the interceptor driver into the map, i.e. into the database 'runtime': 430624.0. Now I would like this to be output in days, hours and minutes. Is this possible?

Thx for Help

Tom Keffer

unread,
Oct 1, 2024, 5:57:01 PM10/1/24
to weewx...@googlegroups.com
I'm not familiar with ecowitt-client, so I'm not sure what code we are talking about. 

In general, the type "ValueHelper" is used to format data. For data that are elapsed time, a "time context" is specified. The default is "current", which gives just minutes and seconds, as you witnessed. Perhaps the author of ecowitt-client forgot to specify a more appropriate context? For example, the "weewx uptime" and "system uptime" tags uses a time context of "month", which does what you want. 

In any case, you can override this and specify the exact format you want. For example, if "$ecowitt_runtime" is the tag holding the runtime, then this should work (NOT TESTED):

$ecowitt_runtime.long_form("%(day)d%(day_label)s, %(hour)d%(hour_label)s, %(minute)d%(minute_label)s")

I didn't understand the comment, "This is written by the interceptor driver into the map, i.e. into the database 'runtime': 430624.0." What map? And how is the database entering this?

-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/5f633888-5ef6-41a1-8a74-9fe7f1ff81e4n%40googlegroups.com.
Message has been deleted

Meteo Oberwallis

unread,
Oct 2, 2024, 8:39:11 AM10/2/24
to weewx-user
Hey Tom.

Thanks for your help. That's exactly what I was looking for. The correct variable is $current.runtime.long_form("%(day)d%(day_label)s, %(hour)d%(hour_label)s, %(minute)d%(minute_label)s"). That works. Thank you very much.
Reply all
Reply to author
Forward
0 new messages