roe-dl / weewx-GTS

XType extension for WeeWX to provide solar energy, "Grünlandtemperatursumme" (a kind of growing degree days) and "dayET" and "ET24" as some kind of opposite to "dayRain" and "rain24"

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error "Unable to convert from unix_epoch to last" and no data calculated by GTS

lgb-this opened this issue · comments

I installed the GTS extension on my weewx 5.0.2. I see these infos in the log of weewx:

2024-03-03T13:35:20.319834+01:00 e45 weewxd[14737]: INFO user.GTS: Version 1.1
2024-03-03T13:35:20.319902+01:00 e45 weewxd[14737]: INFO user.GTS: Local mean time (LMT) UTC offset 0:34:47.880000
2024-03-03T13:35:20.319940+01:00 e45 weewxd[14737]: INFO user.GTS: PressureCooker True
2024-03-03T13:35:20.319976+01:00 e45 weewxd[14737]: INFO user.GTS: PressureCooker <user.barometer.PressureCooker object at 0x7fff8ab14310>
2024-03-03T13:35:20.321687+01:00 e45 weewxd[14737]: INFO main: Starting up weewx version 5.0.2
2024-03-03T13:37:11.558049+01:00 e45 weewxd[14737]: INFO user.belchertown: version 1.3.1
2024-03-03T13:37:12.707813+01:00 e45 weewxd[14737]: DEBUG weewx.units: Unable to convert from unix_epoch to last
2024-03-03T13:40:14.038725+01:00 e45 weewxd[14737]: DEBUG weewx.units: Unable to convert from unix_epoch to last
2024-03-03T13:43:15.941161+01:00 e45 weewxd[14737]: DEBUG weewx.units: Unable to convert from unix_epoch to last
2024-03-03T13:46:07.677514+01:00 e45 weewxd[14737]: DEBUG weewx.units: Unable to convert from unix_epoch to last

The error "Unable to convert from unix_epoch to last" is new after installing GTS and i don't see calculated values (e.g. GTS) in my skin with "$current.GTS". I can't see new data fields in my database either.

Is there something missing ?
I followed the install steps in the readme.

That are not enough logging messages to understand the issue. Refer to Help! Posting to weewx user about filing an issue. It applies to issues at Github, too.

  • Which pages are created and which not?
  • Could you provide the whole log of one archive cycle?
  • What did you change in skin.conf and graphs.conf?
  • Did you change template files? If yes, could you provide the changes?

Please note that you need temperature data from the beginning of the year on to calculate GTS. If your database does not cover the time between January 1st and now, GTS cannot be calculated.

I run weewx with the Belchertown skin and i added this on a page in this skin:

<tr> <td>Grünlandtemperatursumme:</td> <td>$current.GTS.format(format_string="%.1f",None_string="-")</td> </tr> <tr> <td>Grünlandtemperatur Datum:</td> <td>$current.GTSdate.last.format(format_string="%d.%m.%Y",None_string="-")</td> </tr>
I have temperature data since beginning of the year.

The debug message "DEBUG weewx.units: Unable to convert from unix_epoch to last" is shown in the log only with "$current.GTSdate.last.format(format_string="%d.%m.%Y",None_string="-")". I don't see this message, when i delete this code.

Regardless of this, I don't see a value for "GTS" and I can't find a debug entry for user.GTS in the log, although debug = 2 is entered in weewx.conf.

How can i debug the GTS extension ?

$current.GTSdate.last.format(format_string="%d.%m.%Y",None_string="-") is the problem.

$current and $latest refer to a certain moment in time. In contrast, $day, $week, $month, and $year refer to a timespan. For timespans only you can specify aggregations like last which means the last available value of the timespan.

What follows the observation type after $current and $latest is interpreted as a unit. last is no valid unit. Therefore you get an error message. So remove last here.

Normally you do not need to add format(...) as there is a reasonable default.

You did not provide the [StdWXCalculate][[Calculations]] of your weewx.conf. So I do not know if GTS and GTSdate are present there. Please check.

There should be at least 2 logging messages, even without debug mode:

  • GTS initialized ...
  • GTS x, y loops where x is the actual GTS value and y is the amount of days since January 1st.

If debug is set, all the day values are logged during calculation.

This is logged only once after the restart of WeeWX.

I found "$current.GTSdate.last.format(format_string="%d.%m.%Y",None_string="-")" in your readme in the section "Display values (CheetahGenerator)".

I forgot, that my test system does not have temperature data from the beginning of the year. The extensions stops with the line:

if soy_ts<db_manager.first_timestamp: return

I have to import the data first - my mistake. A info message would be helpful in this case.

I found "$current.GTSdate.last.format(format_string="%d.%m.%Y",None_string="-")" in your readme

No.

The example is $day.GTSdate.last.format("%Y-%m-%d"). "day" not "current".

I forgot, that my test system does not have temperature data from the beginning of the year.

This explains something. So let's see what happens after including the data.

Ok, copy/paste error. The values are calculated now and i can see debug output in the log.

Thanks for the fast support !