Can´t use duration notation for x_interval

22 views
Skip to first unread message

Luc Heijst

unread,
May 2, 2026, 7:57:43 AM (9 days ago) May 2
to weewx-user
In skin.conf duration notations like 3h, 1d, 1w or 366d, can be used for time_length and aggregate_interval.
When used for x_interval, like 1h or 1d, an error occurs, see below.

Is this a bug or done on purpose?

I'm using weewx version 5.3.1 and python 3.13.5

====

(weewx-venv) wx@pi31:/ $ /home/wx/weewx-venv/bin/weectl report run mbem --config=/home/wx/weewx-data/weewx_mbem.conf
Using configuration file /home/wx/weewx-data/weewx_mbem.conf
The following reports will be run: mbem
Generating as of last timestamp in the database.
Traceback (most recent call last):
  File "/home/wx/weewx-venv/lib/python3.13/site-packages/weeutil/weeutil.py", line 1565, in to_int
    return int(x) if x is not None else None
           ~~~^^^
ValueError: invalid literal for int() with base 10: '1h'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/wx/weewx-venv/lib/python3.13/site-packages/weewx/reportengine.py", line 252, in run
    obj.start()
    ~~~~~~~~~^^
  File "/home/wx/weewx-venv/lib/python3.13/site-packages/weewx/reportengine.py", line 482, in start
    self.run()
    ~~~~~~~~^^
  File "/home/wx/weewx-venv/lib/python3.13/site-packages/weewx/imagegenerator.py", line 37, in run
    self.gen_images(self.gen_ts)
    ~~~~~~~~~~~~~~~^^^^^^^^^^^^^
  File "/home/wx/weewx-venv/lib/python3.13/site-packages/weewx/imagegenerator.py", line 100, in gen_images
    plot = self.gen_plot(plotgen_ts,
                         plot_options,
                         self.image_dict[timespan][plotname])
  File "/home/wx/weewx-venv/lib/python3.13/site-packages/weewx/imagegenerator.py", line 157, in gen_plot
    timeinc_user = to_int(plot_options.get('x_interval'))
  File "/home/wx/weewx-venv/lib/python3.13/site-packages/weeutil/weeutil.py", line 1568, in to_int
    return int(float(x))
               ~~~~~^^^
ValueError: could not convert string to float: '1h'
Done.
(weewx-venv) wx@pi31:/ $

Tom Keffer

unread,
May 2, 2026, 8:35:14 AM (9 days ago) May 2
to weewx...@googlegroups.com
Fixed in commit fc1f926

Thanks, Luc.

--
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 visit https://groups.google.com/d/msgid/weewx-user/3a9b9f9f-79c4-4213-83e7-eb8aa6e86394n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages