WeeWX-Forecast 3.4.0b12 - Zambretti Update Issue

140 views
Skip to first unread message

Rory Gillies

unread,
Feb 10, 2023, 9:36:29 AM2/10/23
to weewx-user
Hi,

I'm running WeeWX 4.8 on a RPi with Debian Bullseye (WeeWX installed via DEB package). I am using the chaunceygardiner version of weewx-forecast 3.4.0b12 with a SQLite forecast database.

The forecast extension works fine with the exception of the Zambretti thread which is what I want. I have configured Aeris and it downloads the forecast every 30 minutes, however the Zambretti code is calculated once after restarting the weewx service, and then one again within the interval. After that it is not calculated again or showing up in the syslog until the weewx service is restarted.

Here are the relevant sections of weewx.conf:

[DataBindings]

    [[wx_binding]]

    [[forecast_binding]]

        manager = weewx.manager.Manager

        schema = user.forecast.schema

        table_name = archive

        database = forecast_sqlite

[Databases]

    [[forecast_sqlite]]

        database_name = forecast.sdb

        database_type = SQLite

[Engine]

    [[Services]]

        archive_services = weewx.engine.StdArchive, user.forecast.ZambrettiForecast, user.forecast.AerisForecast

[Forecast]

    data_binding = forecast_binding

    interval = 1800

    [[Zambretti]]

        hemisphere = NORTH

    [[Aeris]]

        client_id = xxxxxxx

        client_secret = xxxxxxx

And the skin.conf that I'm running (NeoWX Material):

[CheetahGenerator]

    search_list_extensions = user.historygenerator.MyXSearch, user.forecast.ForecastVariables

And the index.html.tmpl where the Zambretti forecast is called:

        <div class="row">
          <div class="col-3">
              #if $forecast.zambretti.code == 'A'
                #if $current.radiation.raw > 0
                <h5 class="h2-responsive $Extras.color-text"><i class="wi wi-day-sunny" ></i></h5>
                #else
                <h5 class="h2-responsive $Extras.color-text"><i class="wi wi-night-clear" ></i></h5>
                #end if
              #else if $forecast.zambretti.code == 'B'
                #if $current.radiation.raw > 0
                <h5 class="h2-responsive $Extras.color-text"><i class="wi wi-day-cloudy" ></i></h5>
                #else
                <h5 class="h2-responsive $Extras.color-text"><i class="wi wi-night-alt-cloudy" ></i></h5>
                #end if
              #else if $forecast.zambretti.code == 'C'
              <h5 class="h2-responsive $Extras.color-text"><i class="wi wi-cloudy" ></i></h5>
              #else if $forecast.zambretti.code == 'D'
              <h5 class="h2-responsive $Extras.color-text"><i class="wi wi-cloudy" ></i></h5>
              #else if $forecast.zambretti.code == 'E'
              <h5 class="h2-responsive $Extras.color-text"><i class="wi wi-showers" ></i></h5>
              #else if $forecast.zambretti.code == 'F'
              <h5 class="h2-responsive $Extras.color-text"><i class="wi wi-cloudy" ></i></h5>
              #else if $forecast.zambretti.code == 'G'
              <h5 class="h2-responsive $Extras.color-text"><i class="wi wi-showers" ></i></h5>
              #else if $forecast.zambretti.code == 'H'
              <h5 class="h2-responsive $Extras.color-text"><i class="wi wi-showers" ></i></h5>
              #else if $forecast.zambretti.code == 'I'
              <h5 class="h2-responsive $Extras.color-text"><i class="wi wi-showers" ></i></h5>
              #else if $forecast.zambretti.code == 'J'
              <h5 class="h2-responsive $Extras.color-text"><i class="wi wi-rain-mix" ></i></h5>
              #else if $forecast.zambretti.code == 'K'
              <h5 class="h2-responsive $Extras.color-text"><i class="wi wi-showers" ></i></h5>
              #else if $forecast.zambretti.code == 'L'
              <h5 class="h2-responsive $Extras.color-text"><i class="wi wi-cloudy-windy" ></i></h5>
              #else if $forecast.zambretti.code == 'M'
              <h5 class="h2-responsive $Extras.color-text"><i class="wi wi-cloudy-windy" ></i></h5>
              #else if $forecast.zambretti.code == 'N'
              <h5 class="h2-responsive $Extras.color-text"><i class="wi wi-showers" ></i></h5>
              #else if $forecast.zambretti.code == 'O'
              <h5 class="h2-responsive $Extras.color-text"><i class="wi wi-showers" ></i></h5>
              #else if $forecast.zambretti.code == 'P'
              <h5 class="h2-responsive $Extras.color-text"><i class="wi wi-rain-mix" ></i></h5>
              #else if $forecast.zambretti.code == 'Q'
              <h5 class="h2-responsive $Extras.color-text"><i class="wi wi-showers" ></i></h5>
              #else if $forecast.zambretti.code == 'R'
              <h5 class="h2-responsive $Extras.color-text"><i class="wi wi-rain-wind" ></i></h5>
              #else if $forecast.zambretti.code == 'S'
              <h5 class="h2-responsive $Extras.color-text"><i class="wi wi-rain-wind" ></i></h5>
              #else if $forecast.zambretti.code == 'T'
              <h5 class="h2-responsive $Extras.color-text"><i class="wi wi-rain-wind" ></i></h5>
              #else if $forecast.zambretti.code == 'U'
              <h5 class="h2-responsive $Extras.color-text"><i class="wi wi-rain-wind" ></i></h5>
              #else if $forecast.zambretti.code == 'V'
              <h5 class="h2-responsive $Extras.color-text"><i class="wi wi-rain-wind" ></i></h5>
              #else if $forecast.zambretti.code == 'W'
              <h5 class="h2-responsive $Extras.color-text"><i class="wi wi-rain" ></i></h5>
              #else if $forecast.zambretti.code == 'X'
              <h5 class="h2-responsive $Extras.color-text"><i class="wi wi-rain-wind" ></i></h5>
              #else if $forecast.zambretti.code == 'Y'
              <h5 class="h2-responsive $Extras.color-text"><i class="wi wi-thunderstorm" ></i></h5>
              #else if $forecast.zambretti.code == 'Z'
              <h5 class="h2-responsive $Extras.color-text"><i class="wi wi-thunderstorm" ></i></h5>
              #end if
          </div>

          <div class="col-6">
            <h4 class="h5-responsive">$forecast.label('Zambretti', $forecast.zambretti.code)</h4>
## display Zambretti code for debug          

<div class="font-small text-muted">$forecast.zambretti.code</div>
          </div>
          <div class="col-3 text-muted font-small indigo-text">
          Issued at <br>
          $forecast.zambretti.issued_ts.format($Extras.Formatting.datetime_today)
          </div>
        </div>

And here is the syslog after starting the weewx service:

Feb 10 09:09:00 weather systemd[1]: Starting LSB: weewx weather system...
Feb 10 09:09:01 weather weewx[674112] INFO __main__: Initializing weewx version 4.8.0
Feb 10 09:09:01 weather weewx[674112] INFO __main__: Using Python 3.9.2 (default, Feb 28 2021, 17:03:44) #012[GCC 10.2.1 20210110]
Feb 10 09:09:01 weather weewx[674112] INFO __main__: Platform Linux-5.15.32-v8+-aarch64-with-glibc2.31
Feb 10 09:09:01 weather weewx[674112] INFO __main__: Locale is 'en_GB.UTF-8'
Feb 10 09:09:01 weather weewx[674112] INFO __main__: Using configuration file /etc/weewx/weewx.conf
Feb 10 09:09:01 weather weewx[674112] INFO __main__: Debug is 2
Feb 10 09:09:01 weather weewx[674112] INFO __main__: PID file is /var/run/weewx.pid
Feb 10 09:09:01 weather weewx[674115] DEBUG __main__: Initializing engine
Feb 10 09:09:01 weather weewx[674115] INFO weewx.engine: Loading station type WLLDriver (user.WLLDriver)
Feb 10 09:09:01 weather weewx[674102]: Starting weewx weather system: weewx.
Feb 10 09:09:01 weather systemd[1]: Started LSB: weewx weather system.
Feb 10 09:09:01 weather weewx[674115] DEBUG user.WLLDriver: URL of current_conditions : http://192.168.1.121:80/v1/current_conditions
Feb 10 09:09:01 weather weewx[674115] DEBUG user.WLLDriver: URL of realtime_broadcast : http://192.168.1.121:80/v1/real_time?duration=3600
Feb 10 09:09:01 weather weewx[674115] DEBUG user.WLLDriver: Set future time request health API to 1676020500
Feb 10 09:09:01 weather weewx[674115] INFO user.WLLDriver: Driver name is WLLDriver
Feb 10 09:09:01 weather weewx[674115] INFO user.WLLDriver: Driver version is 2020.12-1
Feb 10 09:09:01 weather weewx[674115] INFO user.WLLDriver: Polling interval set to 5
Feb 10 09:09:01 weather weewx[674115] DEBUG weewx.engine: Loading service weewx.engine.StdTimeSynch
Feb 10 09:09:01 weather weewx[674115] DEBUG weewx.engine: Finished loading service weewx.engine.StdTimeSynch
Feb 10 09:09:01 weather weewx[674115] DEBUG weewx.engine: Loading service weewx.engine.StdConvert
Feb 10 09:09:01 weather weewx[674115] INFO weewx.engine: StdConvert target unit is 0x1
Feb 10 09:09:01 weather weewx[674115] DEBUG weewx.engine: Finished loading service weewx.engine.StdConvert
Feb 10 09:09:01 weather weewx[674115] DEBUG weewx.engine: Loading service weewx.engine.StdCalibrate
Feb 10 09:09:01 weather weewx[674115] DEBUG weewx.engine: Finished loading service weewx.engine.StdCalibrate
Feb 10 09:09:01 weather weewx[674115] DEBUG weewx.engine: Loading service weewx.engine.StdQC
Feb 10 09:09:01 weather weewx[674115] DEBUG weewx.engine: Finished loading service weewx.engine.StdQC
Feb 10 09:09:01 weather weewx[674115] DEBUG weewx.engine: Loading service weewx.wxservices.StdWXCalculate
Feb 10 09:09:01 weather weewx[674115] INFO weewx.wxservices: StdWXCalculate will use data binding wx_binding
Feb 10 09:09:01 weather weewx[674115] DEBUG weewx.manager: Daily summary version is 4.0
Feb 10 09:09:01 weather weewx[674115] DEBUG weewx.engine: Finished loading service weewx.wxservices.StdWXCalculate
Feb 10 09:09:01 weather weewx[674115] DEBUG weewx.engine: Loading service weewx.wxxtypes.StdWXXTypes
Feb 10 09:09:01 weather weewx[674115] DEBUG weewx.engine: Finished loading service weewx.wxxtypes.StdWXXTypes
Feb 10 09:09:01 weather weewx[674115] DEBUG weewx.engine: Loading service weewx.wxxtypes.StdPressureCooker
Feb 10 09:09:01 weather weewx[674115] DEBUG weewx.engine: Finished loading service weewx.wxxtypes.StdPressureCooker
Feb 10 09:09:01 weather weewx[674115] DEBUG weewx.engine: Loading service weewx.wxxtypes.StdRainRater
Feb 10 09:09:01 weather weewx[674115] DEBUG weewx.engine: Finished loading service weewx.wxxtypes.StdRainRater
Feb 10 09:09:01 weather weewx[674115] DEBUG weewx.engine: Loading service weewx.wxxtypes.StdDelta
Feb 10 09:09:01 weather weewx[674115] DEBUG weewx.engine: Finished loading service weewx.wxxtypes.StdDelta
Feb 10 09:09:01 weather weewx[674115] DEBUG weewx.engine: Loading service user.GTS.GTSService
Feb 10 09:09:01 weather weewx[674115] INFO user.GTS: Version 0.9a1
Feb 10 09:09:01 weather weewx[674115] INFO user.GTS: Local mean time (LMT) UTC offset -1 day, 23:55:25.680000
Feb 10 09:09:01 weather weewx[674115] DEBUG weewx.engine: Finished loading service user.GTS.GTSService
Feb 10 09:09:01 weather weewx[674115] DEBUG weewx.engine: Loading service user.xaggs.XAggsService
Feb 10 09:09:01 weather weewx[674115] DEBUG weewx.engine: Finished loading service user.xaggs.XAggsService
Feb 10 09:09:01 weather weewx[674115] DEBUG weewx.engine: Loading service weewx.engine.StdArchive
Feb 10 09:09:01 weather weewx[674115] INFO weewx.engine: Archive will use data binding wx_binding
Feb 10 09:09:01 weather weewx[674115] INFO weewx.engine: Record generation will be attempted in 'hardware'
Feb 10 09:09:01 weather weewx[674115] INFO weewx.engine: Using archive interval of 300 seconds (specified in weewx configuration)
Feb 10 09:09:01 weather weewx[674115] DEBUG weewx.engine: Use LOOP data in hi/low calculations: 1
Feb 10 09:09:01 weather weewx[674115] DEBUG weewx.engine: Finished loading service weewx.engine.StdArchive
Feb 10 09:09:01 weather weewx[674115] DEBUG weewx.engine: Loading service user.forecast.ZambrettiForecast
Feb 10 09:09:01 weather weewx[674115] INFO user.forecast: MainThread: Zambretti: forecast version 3.4.0b12
Feb 10 09:09:01 weather weewx[674115] DEBUG user.forecast: MainThread: Zambretti: last forecast issued 2023-02-10 09:00:00 GMT (1676019600), requested 2023-02-10 09:00:00 GMT (1676019600)
Feb 10 09:09:01 weather weewx[674115] INFO user.forecast: MainThread: Zambretti: interval=600 max_age=604800 winddir_period=1800 pressure_period=10800 hemisphere=NORTH lower_pressure=950.0 upper_pressure=1050.0
Feb 10 09:09:01 weather weewx[674115] DEBUG weewx.engine: Finished loading service user.forecast.ZambrettiForecast

And that is it for Zambretti, it never runs the thread again until weewx is restarted. Any ideas? In the above tests I disabled the Aeris forecast for clarity, but that is running fine every 1800 seconds.

The forecast card on this page, as you can see it has not updated since 09:50 this morning:

https://www.360shetland.co.uk/weather/index.html


John Kline

unread,
Feb 10, 2023, 10:45:10 AM2/10/23
to weewx...@googlegroups.com
Zambretti generates a forecast once a day.

# Zambretti Forecaster
#
# The zambretti forecast is based upon recent weather conditions.  Supposedly
# it is about 90% to 94% accurate.  It is simply a table of values based upon
# the current barometric pressure, pressure trend, winter/summer, and wind
# direction.  Apparently it is most accurate when used at 09:00 to provide
# the forecast for the day.
#
# The forecast is generated using data from a period of time prior to 09:00.
# The forecast will be the same no matter what time of day it is requested, as
# long as there are data for the period prior to 09:00.  A request for forecast
# before 09:00 will return the previous day forecast.  If the forecast has
# already been generated, it will not be re-generated.

On Feb 10, 2023, at 6:36 AM, 'Rory Gillies' via weewx-user <weewx...@googlegroups.com> wrote:

Hi,
--
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/061296c6-9997-4e42-b550-c8f8dcdf2290n%40googlegroups.com.

Rory Gillies

unread,
Feb 10, 2023, 11:17:22 AM2/10/23
to weewx...@googlegroups.com
Thanks John, I had never read that far down the forecast.py file so the mystery is solved.

It would be beneficial for my location to have it update every six hours. In Shetland at 60ºN the Zambretti forecast will change, I have the instrument myself and although it was correct with “U” at 09:00 today now it is reading G. I am no python genius but I may have a go!

Thanks again,

Rory

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/LAhqiTbZ51M/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/8261C674-2184-48BA-B243-A4F40C95068B%40johnkline.com.

Reply all
Reply to author
Forward
0 new messages