how to implement forecast table on standard skin or sofaskin?

1,138 views
Skip to first unread message

Marc Aubry

unread,
Nov 24, 2016, 12:01:20 AM11/24/16
to weewx-user
Hi,
I'm running weewx 3.6.2 deb package on a raspberry pi2 with a WH2310 weather station connected with the wh23xx (TyconTP2700). 
archives are hosted on external mysql database (on the same lan).
everything works fine with standard and sofaskin templates.
I have installed wee-forecast-3.0.8 and followed the instruction from https://github.com/weewx/weewx/wiki/forecasting  for the automated installation.
xtide and NWS are not working in my area (west sumatra) and have been removed from the /etc/weewx/weewx.conf and /etc.weewx/skins/forecast/skin.conf
i'm only interested in WU and Zambretti forecasts.
 i have a working WU api key
the page http://my-raspberrypi/weewx/forecast is working and diplay the WU forecast for my zonne and the Zambretti forecast.
Check screen capture bellow.

I then try to implement the forecast table inside the index.html.tmpl page of the standard and sofaskin skins. by modifying the skin.conf as the one in /etc/weewx/skins/forecast/skin.conf files and including the  forecast_tabl.inc. not really knowing or understanding the engine creation process, i just copy(just in case) the folder icons and the .inc file from the forecast skin folder to my skins template folder (standard and sofaskin).

for the two skins (standard and sofaskin) same issue. The engine is not creating any new page and the time display on the index page is the last one before my modification.
i then restore the conf file and the html.tmpl files on the two skins and everything fine again (but without embedded forecast).
It's probably a school boy mistake....

my questions are:
Why the forecast table creation is working from the forecast skin folder and not if i try to implement it in an other page?
What is the exact method to implement the forecast table on different page and skin (different skin folder)?
Is it possible to display the WU forecast in metric instead of imperial?

sorry for my newbies question.
thanks in advance for any help.

Marc Aubry

unread,
Nov 24, 2016, 4:41:35 AM11/24/16
to weewx-user
I'm getting more and more confused with this skin architecture.
I have just change the directory of the report as described in the minimize write of SD card https://github.com/weewx/weewx/wiki/Minimize%20writes%20on%20SD%20cards
to save some SD access on the little pi.
everything run nice and smooth for the remote syslog and for the temporary file system mount in /var/weewx/reports/
but now when i open the index page of the report i have the forcast table of the forecast skin instead on the usual index file (same thing with Standard skin or sofaskin skin)
before i change the directory of the report i had the normal index file display.
I probably mess up something in the weewx.conf and the skin.conf but i can't figure out what?

mwall

unread,
Nov 24, 2016, 9:05:02 AM11/24/16
to weewx-user
hi marc,

this is how to insert the forecast table into the standard report:

1) copy the icons and table template to the standard skin

cp -r skins/forecast/icons skins/Standard
cp skins/forecast/forecast_table.inc skins/Standard


2) modify skin.conf for the standard report.  add the following to the sections already in skin.conf (the ... indicates existing parameters):

[Extras]
    ...
    [[forecast_table_settings]]
        forecast_source = WU
        num_periods = 84

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

[CopyGenerator]
    copy_once = ..., icons/*.png


3) include the table in one of the template files.  for example, put this in skins/Standard/index.html.tmpl:

#include "forecast_table.inc"

that should do it!

if things do not work as you expect, take a look at the log.

m

Sam Roza

unread,
Nov 24, 2016, 2:56:31 PM11/24/16
to weewx-user
I got hung up on this, too. I think there just needs to be a note about adding the include statement in the proper file for this to be much easier.

-SR

Marc Aubry

unread,
Nov 26, 2016, 5:03:00 AM11/26/16
to weewx-user
Thanks mwall.
It work for the 3 days WU forecast with the icons.
Now i have to integrate the WU 6 hours forecast (the one in text)
and the Zamberetti forecast.
Should i copy the table as shown in the forecast/index.html.tmpl ?
do i have to modify the skin.cof to include those 2 forecast?
i think my problem was coming from that part...

Marc Aubry

unread,
Nov 26, 2016, 5:19:57 AM11/26/16
to weewx-user
I answer my own question
it work perfectly for the 3 forecast.
The WU 3 days forecast
the 6 hour WU forecast 
The zambretti forecast
in addition of the mwall previous post
i have just add the following code under the .inc include

#set $periods = $forecast.weather_periods('WU',max_events=6)
#if len($periods) > 0
<h1>Weather Underground</h1>
<p>
#for $period in $periods
$period.event_ts $forecast.label('Weather', $period.clouds)<br/>
#end for
</p>
#end if

#if $varExists('forecast.zambretti')
<h1>Zambretti</h1>
<p>
The forecast is $forecast.label('Zambretti', $forecast.zambretti.code)<br/>
<span style="font-size: 8pt; font-style: italic; color: #aaaaaa;">
Issued at $forecast.zambretti.issued_ts
</span>
</p>
#end if

Andres Revilla

unread,
Aug 16, 2018, 11:48:50 AM8/16/18
to weewx-user
Hi ..

I have tried to follow your tutorial but no luck ...

I get data , but no images ... i copy icons , etc ... If i use standar forecast web all its working ok , but when i use standar modified webpage , i get data but images / colors

I have installed ( weewx 3.8.0 and forecast 3.2.19) .

Maybe config problem?

mwall

unread,
Aug 19, 2018, 10:16:16 AM8/19/18
to weewx-user


On Thursday, August 16, 2018 at 11:48:50 AM UTC-4, Andres Revilla wrote:
Hi ..

I have tried to follow your tutorial but no luck ...

I get data , but no images ... i copy icons , etc ... If i use standar forecast web all its working ok , but when i use standar modified webpage , i get data but images / colors

I have installed ( weewx 3.8.0 and forecast 3.2.19) .

Maybe config problem?


impossible to say without seeing what you are seeing.

post a screenshot of what you see, and explain what you expect to see.  then post the template file with your modifications.

to diagnose the problem, first check the generated html.  use the 'view source' in a web browser, or run it through an html checker.  

then look at the template file that made the generated html.

m 

Matthew Wall

unread,
Aug 19, 2018, 1:47:09 PM8/19/18
to weewx...@googlegroups.com

> On 16 Aug 2018, at 11:48, Andres Revilla <andres.rev...@gmail.com> wrote:
>
> Hi ..
>
> I have tried to follow your tutorial but no luck ...
>
> I get data , but no images ... i copy icons , etc ... If i use standar forecast web all its working ok , but when i use standar modified webpage , i get data but images / colors
>
> I have installed ( weewx 3.8.0 and forecast 3.2.19) .
>
> Maybe config problem?


signature.asc
Reply all
Reply to author
Forward
0 new messages