forked from matthewwall/weewx-forecast
-
Notifications
You must be signed in to change notification settings - Fork 12
/
readme.txt
177 lines (137 loc) · 6.39 KB
/
readme.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
This is a forecasting extension for the weewx weather system.
Copyright 2013-2020 Matthew Wall
Distributed under terms of the GPLv3
This package includes the forecasting module, unit tests, and a sample skin.
The following forecast sources are supported:
US National Weather Service (NWS)
the weather underground (WU)
open weathermap (OWM)
UK Met Office (UKMO)
Aeris Weather
World Weather Online (WWO)
Dark Sky (DS)
Zambretti
tide predictions using xtide
The forecast extension includes a few independent parts:
- a forecast engine that downloads and/or generates forecast data
- a database schema that is normalized to store data from various sources
- a search list extension for using forecast data in reports
- a pre-defined forecast_table for inclusion in reports
- a pre-defined forecast_strip for inclusion in reports
- icons for cloud cover, storms, rainfall, snow, etc.
The forecast_table displays forecast data in a table with time going down the
page. The forecast_table.inc file is a cheetah template designed to be
included in other templates. At the beginning of the file is a list of
variables that determine which forecast data will be displayed.
The forecast_strip displays forecast data in a compact form with time going
from left to right. The forecast_strip.inc file is a cheetah template designed
to be included in other templates. At the beginning of the file is a list of
variables that determine which forecast data will be displayed.
===============================================================================
Pre-requisites
If you want NWS forecasts, determine your 3-character forecast office
identifier and 6-character location identifier:
http://www.nws.noaa.gov/oh/hads/USGS/
If you want WU forecasts, obtain an api_key:
http://www.wunderground.com/weather/api/
If you want OWM forecasts, obtain an api_key:
http://openweathermap.org/appid
If you want UK Met Office forecasts, obtain an api_key:
http://metoffice.gov.uk/datapoint
If you want Aeris forecasts, obtain a client id and client secret:
http://www.aerisweather.com/account
If you want WWO forecasts, obtain an api_key:
https://developer.worldweatheronline.com/auth/register
If you want DS forecasts, obtain an api_key:
https://darksky.net/dev/register
If you want tide forecasts, install xtides:
sudo apt-get install xtide
Then determine your location:
http://tides.mobilegeographics.com/
Note: current versions of debian (bookworm) do not include xtide.
This is perhaps true of other distributions.
You'll need to build it yourself and set the 'prog' variable in the xtide
section.
Example (building xtide)
Note: the first two lines change to your home directory and set the mode on your home directory
such that the weewx user can find the tide program.
cd
chmod 755 .
wget https://flaterco.com/files/xtide/xtide-2.15.5.tar.xz
(decompress and then cd to xtide-2.15.5 directory)
sudo apt-get install libpng-dev
sudo apt-get install libtcd-dev
./configure --with-x=no
make tide
Example (setting prog variable to point to where you have built xtide):
[Forecast]
...
[[XTide]]
location = Palo Alto Yacht Harbor, San Francisco Bay, California
prog = /home/jkline/software/xtide-2.15.5/tide
You'll still need to install xtide-data. Example:
apt install xtide-data
and you'll need to create an /etc/xtide.conf file to tell xtide where to find the harmonic
data you installed with xtide-data. Example:
/etc/xtide.conf:
/usr/share/xtide
(xtide-data installs harmonic data in the /usr/share/xtide directory)
===============================================================================
Installation instructions:
1) run the installer:
For WeeWX 5:
weectl extension install weewx-forecast-3.5.zip
For WeeWX 4:
wee_extension --install weewx-forecast-3.5.zip
2) modify weewx.conf for your location:
[Forecast]
[[NWS]]
lid = MAZ005 # specify a location identifier
foid = BOX # specify a forecast office identifier
lid_desc = Framingham-Middlesex MA # (optional) specify a lid description for cases
# where the lid is repeated in the forecast file
# and the user does not want the first entry for that lid.
# Just omit this entry entirely unless you have examined
# the forecast file and know the description of the repeated
# lid entry that you want to use.
[[WU]]
api_key = XXXXXXXXXXXXXXXX # specify a weather underground api_key
# A location may be specified. If it isn't, your stations lat/long
# will be used.
#
# To specify the location for which to generate a forecast, one can specify
# the Geocode (lat, long), IATA Code, ICAO Code, Place ID or Postal Key.
#
# These options are listed here:
# https://docs.google.com/document/d/1_Zte7-SdOjnzBttb1-Y9e0Wgl0_3tah9dSwXUyEA3-c/
#
# If none of the following is specified, the station's latititude and longitude
# will be used. If more than one is specified, the first will be used according
# to the order listed here.
#
# geocode = "33.74,-84.39"
# iataCode = DEN
# icaoCode = KDEN
# placeid = 327145917e06d09373dd2760425a88622a62d248fd97550eb4883737d8d1173b
# postalKey = 81657:US
[[OWM]]
api_key = XXXXXXXXXXXXXXXX # specify an open weathermap api_key
[[UKMO]]
api_key = XXXXXXXXXXXXXXXX # specify a UK met office api_key
location = 2337 # specify code for UK location
[[Aeris]]
client_id = XXXXXXXXXXXXXXXX # specify client identifier
client_secret = XXXXXXXXXXXXXXXX # specify client secret key
[[DS]]
api_key = XXXXXXXXXXXXXXXX # specify a dark sky api_key
[[XTide]]
location = Boston # specify a location
3) restart weewx:
sudo /etc/init.d/weewx stop
sudo /etc/init.d/weewx start
This will result in a skin called forecast with web pages that illustrate how
to use the forecasts. See comments in forecast.py for detailed customization
options.
===============================================================================
Credits:
Icons were derived from Adam Whitcroft's climacons.