Confused about how to install Weewx-forecast

1,735 views
Skip to first unread message

Russ Adams

unread,
Mar 31, 2015, 5:16:19 PM3/31/15
to weewx...@googlegroups.com
I've been trying to install weewx-forecast on a RPi and can't see to figure it out. I down load weewx-forecast-3.0.4.gz (instructions say it ends with .tgz) to /home/pi/Downloads. I open up terminal and change to the Downloads directory. I then do:

sudo /usr/share/weewx/setup.py --extension --install weewx-forecast-3.0.4.gz

and nothing seems to happen.

I also noticed that the forecast guide in the wiki has different Weewx.conf changes compared to the changes found in the forecast.py comments. Also the forecast package has install.py. should that be run instead of setup?

I'm puzzled. Any help would be appreciated. 

Gary Roderick

unread,
Mar 31, 2015, 5:27:28 PM3/31/15
to weewx...@googlegroups.com
Hi,

I just looked at the weewx wiki under 'managing extensions' and it says the command to install an extension is 
setup.py install --extension filename.tgz
I see your command below does not include the install keyword, have you tried the above syntax?

Gary
--
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.
For more options, visit https://groups.google.com/d/optout.


--

Gary

Russ Adams

unread,
Mar 31, 2015, 5:41:39 PM3/31/15
to weewx...@googlegroups.com

That worked! Should I follow  the weewx.conf mods in the forecast.py comments? They differ some from wiki and seem more correct.

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/IC1-oPV_Q9w/unsubscribe.
To unsubscribe from this group and all its topics, send an email to weewx-user+...@googlegroups.com.

Gary Roderick

unread,
Mar 31, 2015, 5:47:10 PM3/31/15
to weewx...@googlegroups.com
I would tend to follow the forecast.py comments. That being said I am not in front of my PC and consequently have not looked at either. Of course, if they don't work as expected you might try the wiki ones :) The forecast extension runs/saves its data independent of your weather station data, so if you do get it wrong to start with your only impact should be on the forecast data not your weather data.

mwall

unread,
Apr 1, 2015, 6:07:31 AM4/1/15
to weewx...@googlegroups.com
On Tuesday, March 31, 2015 at 5:41:39 PM UTC-4, Russ Adams wrote:

That worked! Should I follow  the weewx.conf mods in the forecast.py comments? They differ some from wiki and seem more correct.


could you be more specific about the discrepancies?

afaik, both the wiki and forecast.py comments are correct.  the wiki shows how to install, using either setup.py or manually.  forecast.py shows all of the options that are available and is not a step-by-step recipe for installation.

m

Russ Adams

unread,
Apr 1, 2015, 9:20:06 AM4/1/15
to weewx...@googlegroups.com
My confusing was really based on:

 1) the .tgz (mentioned in the wiki) vs .gz version that is actually downloaded
 2) not realizing that the full path is required to run setup.py (Maybe the wiki should make that clear. Might also add that you should run setup from the directory forecast was downloaded to.)
 3) my syntax error in running setup.py

Russ Adams

unread,
Apr 1, 2015, 9:33:31 AM4/1/15
to weewx...@googlegroups.com
One last suggestion. In the wiki under "Automated Installation" section 2, might change text to: "Setup.py will rewrite weewx.conf adding most of the required changes, but you need to specify the required parameters in the [Forecast] services section that you want to run as shown below."

George Fievet

unread,
Oct 31, 2017, 10:53:01 AM10/31/17
to weewx-user
So I appreciate this is an old thread but I hate to start a new one...
I'm having one heckuva time finding a download for weewx-forecast.  I can find plenty on how to (or how not to) install it but nothing about where I can find the package.

Any leads?

Thanks.

Thomas Keffer

unread,
Oct 31, 2017, 11:08:46 AM10/31/17
to weewx-user

--
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+unsubscribe@googlegroups.com.

Cycle London

unread,
Feb 5, 2018, 7:21:40 AM2/5/18
to weewx-user
Piggybacking on this old thread, I'm really not enjoying the ordeal of trying to get the forecast service up and running.  The Wiki really isn't clear, and I don't think I'm actually as stoopid as I'm feeling right now.

Example ..

The ForecastVariables search list extension

The forecast extension includes a search list extension called ForecastVariables. This defines a variable called $forecast that you can use to embed fine-grained forecast information anywhere in a template, and that is used extensively in the forecast forecast_*.inc files.

To use the $forecast variable in a template, the ForecastVariables search list extension must be enabled within the skin for that template. For example, to enable ForecastVariables in the Standard skin, modify skins/Standard/skin.conf:

[CheetahGenerator]
    search_list_extension = user.forecast.ForecastVariables
    ...

Right, so I add that line, but the ellipsis below seems to indicate that there is more to add.  Where?   And what?  It isn't clear.  

[CheetahGenerator]
    search_list_extensions = user.forecast.ForecastVariables
    [[ToDate]]
        [[[forecast]]]
            template = index.html.tmpl
        [[[table]]]
            template = single-table.html.tmpl
        [[[multitable]]]
            template = multiple-tables.html.tmpl
        [[[strip]]]
            template = single-strip.html.tmpl
        [[[stripvertical]]]
            template = single-strip-vertical.html.tmpl
        [[[multistrip]]]
            template = multiple-strips.html.tmpl
        [[[periods]]]
            template = forecast-periods.html.tmpl
        [[[zambretti]]]
            template = zambretti.html.tmpl
        [[[tides]]]
           template = tides.html.tmpl
        [[[tidesgraphic]]]
            template = tides-graphic.html.tmpl
        [[[iconic]]]
            template = iconic.html.tmpl
        [[[iconichorizontal]]]
            template = iconic-horizontal.html.tmpl
        [[[compact]]]
            template = compact.html.tmpl


So how mpuch of that must I include?  If I include it all, syslog warns me of a duplicate line where 'ToDate' is, and weewx fails to update my page.

Basically, I just want either a forecast section on my standard page, or else a link on the page pointing to forecast.   I have my WU api but no idea where to go from here.


--More--(82%)

mwall

unread,
Feb 5, 2018, 7:45:48 AM2/5/18
to weewx-user
On Monday, February 5, 2018 at 7:21:40 AM UTC-5, Cycle London wrote:

So how mpuch of that must I include?  If I include it all, syslog warns me of a duplicate line where 'ToDate' is, and weewx fails to update my page.

Basically, I just want either a forecast section on my standard page, or else a link on the page pointing to forecast.   I have my WU api but no idea where to go from here.

the only forecast-specific part is the search list extension - the 'ForecastVariables' search list extension must be enabled, otherwise the '$forecast' variable will not be evaluated in any template file.  the other stanzas that follow tell the skin which template files to process.

for example, the 'forecast' skin has a bunch of templates (*.tmpl), each of which illustrates how to use a different part of the forecasting system.  you probably do not want to use those template files in your 'real' skin, since they are bare-bones.  but you might want to copy part of the html/cheetah code from one of the *.tmpl files and use it in your own *.tmpl file(s).

there are two basic approaches to customizing your template files with forecast information.

1) insert a pre-defined forecast template into your template.  this would be an iconic view, a strip view, a table view, etc.  just include the appropriate forecast_*.inc file in your xxx.tmpl file.

2) embed forecast data throughout your template.  for example, insert the predicted high and low temperatures for the day near the current temperature.  to do this, use the $forecast variable in your template.

in either case, you need ForecastVariables in the skin's search list extensions.

does that help?

m

Cycle London

unread,
Feb 5, 2018, 7:59:25 AM2/5/18
to weewx...@googlegroups.com
It does help, yes.  Thank you.  :)  So let's verify that my skin.conf (using the 'Standard' skin) has the forecast extension enabled..

root@weather:/home/weewx/skins/Standard# grep forecast skin.conf
    search_list_extensions = user.forecast.ForecastVariables

OK, so I want the 'strip' - the one that looks like the attached image and which comes from the 'live' example listed at the top of the wiki.

http://sailing.mit.edu/weather/forecast.html

So which inc file do I want ..?

root@weather:/home/weewx/skins/Standard# ls -l ../forecast/*.inc
-rw-r--r-- 1 root root  4351 Feb  2 11:24 ../forecast/forecast_compact.inc
-rw-r--r-- 1 root root  7150 Feb  2 11:24 ../forecast/forecast_iconic.inc
-rw-r--r-- 1 root root 28361 Feb  2 11:24 ../forecast/forecast_strip.inc
-rw-r--r-- 1 root root 16583 Feb  2 11:24 ../forecast/forecast_table.inc

I'm guessing it will be the forecast/forecast_strip.inc.  So in the file..

/home/weewx/skins/Standard/index.html.tmpl I insert ..

root@weather:/home/weewx/skins/Standard# grep forecast index.html.tmpl
#include "forecast_strip.inc"

So far so good?   In weewx.conf I have my API key from Weather Underground..


    [[WU]]
        api_key = 65165fgh4hh44hd4hdfh4d68h4d68h4df6h

(munged, of course)

In syslog..

Feb  5 12:56:15 weather weewx[4242]: ****    File "/usr/lib/python2.7/dist-packages/Cheetah/Template.py", line 706, in compile
Feb  5 12:56:15 weather weewx[4242]: ****      fileHash += str(os.path.getmtime(file))
Feb  5 12:56:15 weather weewx[4242]: ****    File "/usr/lib/python2.7/genericpath.py", line 62, in getmtime
Feb  5 12:56:15 weather weewx[4242]: ****      return os.stat(filename).st_mtime
Feb  5 12:56:15 weather weewx[4242]: ****  OSError: [Errno 2] No such file or directory: '/home/weewx/skins/Standard/forecast_strip.inc'

I tried ..

#include "../forecast/forecast_strip.inc"

.. and that error _seems_ to disappear, but there is still absolutely nothing on my 'landing' page that resembles a forecast.

--
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/IC1-oPV_Q9w/unsubscribe.
To unsubscribe from this group and all its topics, send an email to weewx-user+unsubscribe@googlegroups.com.
strip.png

mwall

unread,
Feb 5, 2018, 8:11:32 AM2/5/18
to weewx-user
On Monday, February 5, 2018 at 7:59:25 AM UTC-5, Cycle London wrote:
#include "../forecast/forecast_strip.inc"

.. and that error _seems_ to disappear, but there is still absolutely nothing on my 'landing' page that resembles a forecast.

 what do you see when you look at the source of the landing page?  (not the cheetah template source, but the resulting source that cheetah generated)

Cycle London

unread,
Feb 5, 2018, 8:41:03 AM2/5/18
to weewx...@googlegroups.com
You want all of the HTML/Javascript pasted in? 

Here is the 'forecast' section in the source...

<script>
// array of forecast data, one element for each forecast source
var forecast_data = {};

// default display settings based on skin parameters
var default_display_settings = {
  'orientation': 'horizontal',
  'show_temp': 1,
  'show_temp_min': 1,
  'show_temp_max': 1,
  'show_dewpoint': 0,
  'show_humidity': 0,
  'show_wind': 1,
  'show_clouds': 1,
  'show_pop': 1,
  'show_snow': 1,
  'show_precip': 1,
  'show_sun': 0,
  'show_moon': 0,
  'show_moonphase': 0,
  'show_tides': 0,
};

function populate_strip(div_id, data_id, display_settings) {
  if(display_settings === undefined || display_settings === null) {
    display_settings = default_display_settings;
  }
  if(! forecast_data[data_id]) return;
  var elem = document.getElementById(div_id);
  if(! elem) return;
  elem.innerHTML = '';
  var tbl = document.createElement('table');
  if(display_settings.orientation === 'vertical') {
    populate_vertical_strip(tbl, data_id, display_settings);
  } else {
    populate_horizontal_strip(tbl, data_id, display_settings);
  }
  var d = document.createElement('div');
  d.className = 'fc_strip';
  d.appendChild(tbl);
  d.appendChild(create_summary(forecast_data[data_id].summary));
  elem.appendChild(d);
}

function create_col(data) {
  var c = document.createElement('col');
  c.className = data.className;
  return c;
}

function populate_vertical_strip(tbl, data_id, display_settings) {
  tbl.appendChild(create_col(forecast_data[data_id].date));
  tbl.appendChild(create_col(forecast_data[data_id].hour));
  if(display_settings.show_temp_max)
    tbl.appendChild(create_col(forecast_data[data_id].tempMax));
  if(display_settings.show_temp)
    tbl.appendChild(create_col(forecast_data[data_id].temp));
  if(display_settings.show_temp_min)
    tbl.appendChild(create_col(forecast_data[data_id].tempMin));
  if(display_settings.show_dewpoint)
    tbl.appendChild(create_col(forecast_data[data_id].dewpoint));
  if(display_settings.show_humidity)
    tbl.appendChild(create_col(forecast_data[data_id].humidity));
  if(display_settings.show_wind) {
    tbl.appendChild(create_col(forecast_data[data_id].windSpeed));
    tbl.appendChild(create_col(forecast_data[data_id].windGust));
    tbl.appendChild(create_col(forecast_data[data_id].windDir));
  }
  if(display_settings.show_clouds)
    tbl.appendChild(create_col(forecast_data[data_id].clouds));
  if(display_settings.show_pop)
    tbl.appendChild(create_col(forecast_data[data_id].pop));
  if(display_settings.show_precip) {
    tbl.appendChild(create_col(forecast_data[data_id].qpf));
    if(display_settings.show_snow)
      tbl.appendChild(create_col(forecast_data[data_id].qsf));
  }
  if(display_settings.show_sun)
    tbl.appendChild(create_col(forecast_data[data_id].sun));
  if(display_settings.show_moon)
    tbl.appendChild(create_col(forecast_data[data_id].moon));
  if(display_settings.show_moonphase)
    tbl.appendChild(create_col(forecast_data[data_id].moonphase));

  var tr = document.createElement('tr');
  tr.appendChild(create_th_icon(forecast_data[data_id].date));
  tr.appendChild(create_th_icon(forecast_data[data_id].hour));
  if(display_settings.show_temp_max)
    tr.appendChild(create_th_icon(forecast_data[data_id].tempMax));
  if(display_settings.show_temp)
    tr.appendChild(create_th_icon(forecast_data[data_id].temp));
  if(display_settings.show_temp_min)
    tr.appendChild(create_th_icon(forecast_data[data_id].tempMin));
  if(display_settings.show_dewpoint)
    tr.appendChild(create_th_icon(forecast_data[data_id].dewpoint));
  if(display_settings.show_humidity)
    tr.appendChild(create_th_icon(forecast_data[data_id].humidity));
  if(display_settings.show_wind) {
    tr.appendChild(create_th_icon(forecast_data[data_id].windSpeed));
    tr.appendChild(create_th_icon(forecast_data[data_id].windGust));
    tr.appendChild(create_th_icon(forecast_data[data_id].windDir));
  }
  if(display_settings.show_clouds)
    tr.appendChild(create_th_icon(forecast_data[data_id].clouds));
  if(display_settings.show_pop)
    tr.appendChild(create_th_icon(forecast_data[data_id].pop));
  if(display_settings.show_precip) {
    tr.appendChild(create_th_icon(forecast_data[data_id].qpf));
    if(display_settings.show_snow)
      tr.appendChild(create_th_icon(forecast_data[data_id].qsf));
  }
  if(display_settings.show_sun)
    tr.appendChild(create_th_icon(forecast_data[data_id].sun));
  if(display_settings.show_moon)
    tr.appendChild(create_th_icon(forecast_data[data_id].moon));
  if(display_settings.show_moonphase)
    tr.appendChild(create_th_icon(forecast_data[data_id].moonphase));
  tbl.appendChild(tr);


...etc etc ..


Cycle London

unread,
Feb 5, 2018, 9:38:11 AM2/5/18
to weewx...@googlegroups.com
Ah, the source has changed.  It now has the following (although still nothing actually visible on the landing page) ..

<script>
forecast_data.WU = {
  'id': "WU",
  'date': {
    'className': 'date',
    'units': '',
    'td_type': 'date',
    'values':[ '<span class="day">Mon</span><br/><span class="date">2018.02.05</span>', '', '', '', '', '', '', '', '', '<span class="day">Tue</span><br/><span class="date">2018.02.06</span>', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '<span class="day">Wed</span><br/><span class="date">2018.02.07</span>', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '<span class="day">Thu</span><br/><span class="date">2018.02.08</span>', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '<span class="day">Fri</span><br/><span class="date">2018.02.09</span>', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '<span class="day">Sat</span><br/><span class="date">2018.02.10</span>', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '<span class="day">Sun</span><br/><span class="date">2018.02.11</span>', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '<span class="day">Mon</span><br/><span class="date">2018.02.12</span>', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '<span class="day">Tue</span><br/><span class="date">2018.02.13</span>', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '<span class="day">Wed</span><br/><span class="date">2018.02.14</span>', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '<span class="day">Thu</span><br/><span class="date">2018.02.15</span>', '', '', '', '', '', '', '', '', '', '', '', '', '',     ],
    'spanvalues':[ {'colspan': 9, 'label': '<span class="day">Mon</span><br/><span class="date">2018.02.05</span>'}, {'colspan': 24, 'label': '<span class="day">Tue</span><br/><span class="date">2018.02.06</span>'}, {'colspan': 24, 'label': '<span class="day">Wed</span><br/><span class="date">2018.02.07</span>'}, {'colspan': 24, 'label': '<span class="day">Thu</span><br/><span class="date">2018.02.08</span>'}, {'colspan': 24, 'label': '<span class="day">Fri</span><br/><span class="date">2018.02.09</span>'}, {'colspan': 24, 'label': '<span class="day">Sat</span><br/><span class="date">2018.02.10</span>'}, {'colspan': 24, 'label': '<span class="day">Sun</span><br/><span class="date">2018.02.11</span>'}, {'colspan': 24, 'label': '<span class="day">Mon</span><br/><span class="date">2018.02.12</span>'}, {'colspan': 24, 'label': '<span class="day">Tue</span><br/><span class="date">2018.02.13</span>'}, {'colspan': 24, 'label': '<span class="day">Wed</span><br/><span class="date">2018.02.14</span>'}, {'colspan': 14, 'label': '<span class="day">Thu</span><br/><span class="date">2018.02.15</span>'},   ]},
  'hour': {
    'className': 'hour',
    'units': '',
    'td_type': 'txt',
    'values':[ "15h", "16h", "17h", "18h", "19h", "20h", "21h", "22h", "23h", "00h", "01h", "02h", "03h", "04h", "05h", "06h", "07h", "08h", "09h", "10h", "11h", "12h", "13h", "14h", "15h", "16h", "17h", "18h", "19h", "20h", "21h", "22h", "23h", "00h", "01h", "02h", "03h", "04h", "05h", "06h", "07h", "08h", "09h", "10h", "11h", "12h", "13h", "14h", "15h", "16h", "17h", "18h", "19h", "20h", "21h", "22h", "23h", "00h", "01h", "02h", "03h", "04h", "05h", "06h", "07h", "08h", "09h", "10h", "11h", "12h", "13h", "14h", "15h", "16h", "17h", "18h", "19h", "20h", "21h", "22h", "23h", "00h", "01h", "02h", "03h", "04h", "05h", "06h", "07h", "08h", "09h", "10h", "11h", "12h", "13h", "14h", "15h", "16h", "17h", "18h", "19h", "20h", "21h", "22h", "23h", "00h", "01h", "02h", "03h", "04h", "05h", "06h", "07h", "08h", "09h", "10h", "11h", "12h", "13h", "14h", "15h", "16h", "17h", "18h", "19h", "20h", "21h", "22h", "23h", "00h", "01h", "02h", "03h", "04h", "05h", "06h", "07h", "08h", "09h", "10h", "11h", "12h", "13h", "14h", "15h", "16h", "17h", "18h", "19h", "20h", "21h", "22h", "23h", "00h", "01h", "02h", "03h", "04h", "05h", "06h", "07h", "08h", "09h", "10h", "11h", "12h", "13h", "14h", "15h", "16h", "17h", "18h", "19h", "20h", "21h", "22h", "23h", "00h", "01h", "02h", "03h", "04h", "05h", "06h", "07h", "08h", "09h", "10h", "11h", "12h", "13h", "14h", "15h", "16h", "17h", "18h", "19h", "20h", "21h", "22h", "23h", "00h", "01h", "02h", "03h", "04h", "05h", "06h", "07h", "08h", "09h", "10h", "11h", "12h", "13h", "14h", "15h", "16h", "17h", "18h", "19h", "20h", "21h", "22h", "23h", "00h", "01h", "02h", "03h", "04h", "05h", "06h", "07h", "08h", "09h", "10h", "11h", "12h", "13h",   ]},
  'tempMax': {
    'className': 'temp',
    'units': '&#176;C',
    'td_type': 'txt',
    'values':[ "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "",   ]},
  'tempMin': {
    'className': 'temp',
    'units': '&#176;C',
    'td_type': 'txt',


On 5 February 2018 at 13:11, mwall <mw...@users.sourceforge.net> wrote:

mwall

unread,
Feb 5, 2018, 9:39:41 AM2/5/18
to weewx-user


On Monday, February 5, 2018 at 8:41:03 AM UTC-5, Cycle London wrote:
You want all of the HTML/Javascript pasted in? 

just wanted to see whether the .inc file was, in fact, being included.  it is, so that means the search list extension is working.

so you are just missing the one line of javascript that makes it all happen.

in the forecast extension's 'forecast' skin, take a look at the file single-strip.html.tmpl

toward the bottom of the file you will see this:

<script>
populate_strip('wu_strip', 'WU');
</script>

you need to add that to your index.html.tmpl somehwere *after* the include of the .inc

m

mwall

unread,
Feb 5, 2018, 9:43:53 AM2/5/18
to weewx-user
some implementation trivia:

if you look closely at the display part of the forecast code, you will see that i have taken two approaches.  the table view uses very little javascript - it uses cheetah to populate all of the table fields.  the strip view is almost pure javascript - it uses cheetah to populate a bunch of javascript objects, but javascript populates the web page.

i'm still not sure which approach is better

m

Cycle London

unread,
Feb 5, 2018, 9:47:45 AM2/5/18
to weewx...@googlegroups.com
Done, but still nothing on the landing page.

#include "../forecast/forecast_strip.inc"


<script>
populate_strip('wu_strip', 'WU');
</script>
        <p>&nbsp;</p>

        <div class="stats">
          <div class="stats_header">
            Since Midnight
          </div>
          <table>
            <tbody>
              <tr>
                <td class="stats_label">

Is there some issue with the fact that the include file is in /home/weewx/skins/forecast whereas I am referencing it from /home/weewx/skins/Standard ?  I am certainly using '../forecast...' to point to it, but would it be better if that include file were in with the Standard skin files?



--

Cycle London

unread,
Feb 5, 2018, 9:57:33 AM2/5/18
to weewx...@googlegroups.com
Well, if I go to the forecast subdirectory on my browser, I can see predictions under virtually all of the examples (see screenshot).   It's in degrees F which is something else I'd like to change. 

But that's not helping me get the content at the bottom of my index.html.tmpl



--
c.png

mwall

unread,
Feb 5, 2018, 9:58:03 AM2/5/18
to weewx-user


On Monday, February 5, 2018 at 9:47:45 AM UTC-5, Cycle London wrote:
Done, but still nothing on the landing page.

#include "../forecast/forecast_strip.inc"

<script>
populate_strip('wu_strip', 'WU');
</script>
 

try putting the <script>...</script> block after the closing </body> but before the closing </html>

 
Is there some issue with the fact that the include file is in /home/weewx/skins/forecast whereas I am referencing it from /home/weewx/skins/Standard ?  I am certainly using '../forecast...' to point to it, but would it be better if that include file were in with the Standard skin files?

if you intend to do any significant hacking, the preferred approach would be to create your *own* skin instead of modifying the Standard skin.  that means:

1) create a place for it

  mkdir skins/cycle

2) copy everything into it

  rsync -arv skins/Standard/ skins/cycle

3) customize it

  modify skin.conf, modify *.tmpl, copy in any *.inc files that you use

4) point to it in weewx.conf

  [StdReport]
    ...
    [[cycle]]
      skin = cycle
      ...

that way you end up with a self-contained, standalone skin.  weewx is smart enough to not touch your skins when you install an extension or when you update weewx itself.  but this way you can always see how the original 'Standard' skin behaves if you botch something up.

Cycle London

unread,
Feb 5, 2018, 10:02:45 AM2/5/18
to weewx...@googlegroups.com
Moved the script to after the body tag.  Still nothing.  This in the logs ..

Feb  5 15:00:14 weather weewx[4242]: manager: Added record 2018-02-05 15:00:00 GMT (1517842800) to database 'weewx.sdb'
Feb  5 15:00:14 weather weewx[4242]: manager: Added record 2018-02-05 15:00:00 GMT (1517842800) to daily summary in 'weewx.sdb'
Feb  5 15:00:18 weather weewx[4242]: cheetahgenerator: Generated 14 files for report StandardReport in 4.00 seconds
Feb  5 15:00:24 weather weewx[4242]: imagegenerator: Generated 36 images for StandardReport in 5.43 seconds
Feb  5 15:00:24 weather weewx[4242]: copygenerator: copied 0 files to /home/weewx/public_html
Feb  5 15:00:32 weather weewx[4242]: cheetahgenerator: Generated 12 files for report forecast in 8.53 seconds
Feb  5 15:00:32 weather weewx[4242]: copygenerator: copied 0 files to /home/weewx/public_html/forecast


--

mwall

unread,
Feb 5, 2018, 10:13:04 AM2/5/18
to weewx-user


On Monday, February 5, 2018 at 9:57:33 AM UTC-5, Cycle London wrote:
Well, if I go to the forecast subdirectory on my browser, I can see predictions under virtually all of the examples (see screenshot).   It's in degrees F which is something else I'd like to change. 


units are easy - use the same mechanism that you use everywhere else in weewx.  do it in the [Units][[Groups]] section of skin.conf, or do it in the weewx configuration file like this:

[StdReport]
    ...
    [[StandardReport]]
        skin = Standard
        [[[Units]]]
            [[[[Groups]]]]
                group_altitude = meter
                group_temperature = degree_C
                ...

m

Cycle London

unread,
Feb 5, 2018, 10:14:45 AM2/5/18
to weewx...@googlegroups.com
Got it.  Although it's of little use if I can't actually see the forecasts on my landing page ....  :-(



--

mwall

unread,
Feb 5, 2018, 10:44:26 AM2/5/18
to weewx-user
On Monday, February 5, 2018 at 10:02:45 AM UTC-5, Cycle London wrote:
Moved the script to after the body tag.  Still nothing.  This in the logs ..

there is probably a parse error in the generated web page.

open index.html in a web browser

then go into developer mode in your browser

see what the browser tells you
 

Cycle London

unread,
Feb 5, 2018, 11:36:16 AM2/5/18
to weewx...@googlegroups.com
I can't see anything in the 'debugger' but then I'm not a web dev.

--

Andrew Milner

unread,
Feb 5, 2018, 12:52:44 PM2/5/18
to weewx-user
How about attaching the generated index.html page??



On Monday, 5 February 2018 18:36:16 UTC+2, Cycle London wrote:
I can't see anything in the 'debugger' but then I'm not a web dev.
On 5 February 2018 at 15:44, mwall <mw...@users.sourceforge.net> wrote:
On Monday, February 5, 2018 at 10:02:45 AM UTC-5, Cycle London wrote:
Moved the script to after the body tag.  Still nothing.  This in the logs ..

there is probably a parse error in the generated web page.

open index.html in a web browser

then go into developer mode in your browser

see what the browser tells you
 

--
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/IC1-oPV_Q9w/unsubscribe.
To unsubscribe from this group and all its topics, send an email to weewx-user+...@googlegroups.com.

mwall

unread,
Feb 5, 2018, 1:50:52 PM2/5/18
to weewx-user


On Monday, February 5, 2018 at 11:36:16 AM UTC-5, Cycle London wrote:
I can't see anything in the 'debugger' but then I'm not a web dev.


you need to create a div for the javascript to populate.

somewhere in the html hierarchy do this:

<div id="wu_strip"></div>

the strip data will be inserted into that div when populate_strip("wu_strip", "WU") is invoked

the syntax for populate_strip is:

populate_strip(div_id, data_id, display_settings)

where div_id is the id of the div that will receive the data, data_id is the identifier of the data set that contains the data, and display_settings is an option override of any parameters such as orientation, show_tides, show_snow, etc.

by convention, the data id is the forecast source identifier.  in this case 'WU'

to summarize:  you must first include the strip .inc file, then you must create a div with an id of your choosing, then you must invoke the populate_strip function with the div id and the data id.

including table display is somewhat easier - there is just the .inc inclusion, since it is not javascript.  this is why there are xxx.html.tmpl files in the default forecast skin, so that there will be fully functional, minimal examples from which to copy.  

suggestions about how to improve database query performance, javascript/html rendering performance, and/or simplification of the install/customize process would be very much appreciated.

m

Cycle London

unread,
Feb 6, 2018, 3:51:26 AM2/6/18
to weewx...@googlegroups.com
You know how sometimes you can be looking at something for so long that you fail to register that it's not what you think you're looking at?

I put 'wu_script' into the html instead of 'wu_strip' and then couldn't figure out why it wasn't working.  It was only when I was preparing to answer your mail that I ran a grep for 'wu_strip' and the only occurrence of it was in the 'populate' script part.

It's now working, thank you.  :) 

There are a couple of glitches - the icons were not rendering, but I took the icons subdirectory from the forecast skin and `rsync`ed it to public_html and that seemed to do the job. 

I know absolutely nothing about sqlite, so can't really help there.  I was going to move my installation to MySQL as I'm Oracle Certified DBA (or I was in 2014, so probably a bit rusty now), but the Wiki isn't clear enough and I don't want to break anything.  As for ease of installation, it would have been nice if the wiki actually had the instructions for inserting the <script> and the <div>.  Maybe it was blindingly obvious, but my 'experience' of HTML basically stopped when I was doing a rudimentary webpage in 1995, working at IBM up in Scotland.  :-|

Thank you again for your help.  :)

Cycle London

unread,
Feb 6, 2018, 4:01:38 AM2/6/18
to weewx...@googlegroups.com
There is one thing that strikes me.  On the temperature scale, the degree sign and 'C' appears three times.  I'm assuming that this represents a high, low and actual prediction?   It's not - I think - anything to do with my installation, as if I check out the 'MIT Sailing Pavillon' live example, they have it too..

http://sailing.mit.edu/weather/forecast.html

is there a way to include high and low? 

And is it possible to limit the number of days forward that the forecast reaches? 

Is there actually a page where the options for the strip are detailed?  So far, I've only seen the HOWTO on the wiki.


Cycle London

unread,
Feb 6, 2018, 7:04:46 AM2/6/18
to weewx...@googlegroups.com
Running almost perfectly now.    Couple of niggles: the WU and UKMO forecasts give different temperature and wind speeds.  Guessing that this is because the UKMO is 'greater London' whereas (I think) the WU data are gleaned from a more 'local' source or sources?

I also tried to include text inside the div to have a 'heading' at the top of each graph, but that doesn't appear to have been included. 

Thanks again.

--

Damjan Hajsek

unread,
Apr 11, 2018, 5:11:17 AM4/11/18
to weewx-user
Hi
I have the same problem but I am lost at the end, still doesn't get anything on my index page.
I have attached my index.html.tmpl file. Can someone help me?


Dne torek, 06. februar 2018 10.01.38 UTC+1 je oseba Cycle London napisala:
index.html.tmpl

Damjan Hajsek

unread,
Apr 11, 2018, 8:46:30 AM4/11/18
to weewx-user
I have manage to solve it by myself problem was icons, so I changed apache settings and disabled autoindex.conf

Dne sreda, 11. april 2018 11.11.17 UTC+2 je oseba Damjan Hajsek napisala:

Topher Webb

unread,
Feb 22, 2019, 8:06:55 AM2/22/19
to weewx-user
Yet another n00b confused about the forecast extension. Sorry!

Working down the line of https://github.com/weewx/weewx/wiki/forecasting install instructions....

I have downloaded the *.tgz file, I have ran the extension installer, edited weewx.conf with the API data.
Placed "CheetahGenerator" variable data into the standard skin.conf

Pasted html coding into index template, Extras and StdReport data into Skin.conf and Weewx.conf respectively.

Im stuck here. I want to use Forecast Compact for the output, but cant seem to work out where to go from here.

If I go to my domain dot com/forecast I get a list of options for forecast outputs and domain dot com/forecast/compact.html gives me a working forecast. I just seem to display the forecast on my main page. 

Im obviously missing something, and just cant seem to work out what. Can anyone point me to the correct spot? Its frustrating me just a wee bit :D


mwall

unread,
Feb 22, 2019, 1:53:59 PM2/22/19
to weewx-user


On Friday, February 22, 2019 at 8:06:55 AM UTC-5, Topher Webb wrote:
Im stuck here. I want to use Forecast Compact for the output, but cant seem to work out where to go from here.

If I go to my domain dot com/forecast I get a list of options for forecast outputs and domain dot com/forecast/compact.html gives me a working forecast. I just seem to display the forecast on my main page.

so the sample 'forecast' skin is working properly, but what do you see your report's index.html?

did you follow these instructions:


if you did something else, then please post your index.html.tmpl, skin.conf, weewx.conf, and the resulting index.html

m
 

Topher Webb

unread,
Feb 22, 2019, 5:42:47 PM2/22/19
to weewx-user
Hi mate

Followed step 1,2,3,4 & 5

The only change was that 
[StdReport]
    ...
    [[Seasons]]

Was in Weewx.conf as [[SeasonsReport]] and not [[Seasons]] so figured that wouldnt have a bearing on an output

Topher Webb

unread,
Feb 23, 2019, 8:05:58 AM2/23/19
to weewx-user
Had another look at what had gone on and checked what I had done in the WeeWx, Skin and Index files and what I ended up doing is commenting out the forecast api sections for those I didnt have APIs for and that seemed to have worked...

So, I had step 2 correction to make.

Thanks, Matt, for jumping in on the thread after it going quiet for 12 months... I appreciate it... and really like your work


Chris
Reply all
Reply to author
Forward
0 new messages