PyWeather contains weather related modules implemented in Python. Anything weather related is fair game for PyWeather. Currently PyWeather is limited to unit conversion, console reading, and data publication. But, future work can be added to PyWeather in any area.
PyWeather has a lot of support for common unit conversions in distance, temperature, pressure, and volume. Conversion from Fahrenheit to Celsius, and kelvin is supported, as well as conversions between inches of mercury and millibars.
PyWeather now includes a feature to calculate the wind chill factor based on temperature and wind speed. This provides users with additional information about how cold it feels outside, which is particularly useful in cold weather conditions.
PyWeather also contains modules that are capable of downloading observations from weather consoles. The current list of supported weather consoles includes:
- Davis Vantage Pro
- Davis Vantage Pro2
- Netatmo weather station.
PyWeather contains a module that allows developers to post conditions to weather aggregation sites. The current list of support services includes:
- WeatherUnderground (wundgerground.com)
- PWS Weather (pwsweather.com)
- WeatherForYou (weatherforyou.com)
For additional information, please email the maintainer: pyweather@tuxcoder.com
scripts/weatherpub.py supports publication of the weather data. It can also serve as a good usage example.
- Copy
weatherpub.conf.exampleasweatehrpub.conf. - Modify
weatehrpub.conf: - In
[general]section setstationto the name of the station you have. - Set
publicationto a comma-separated list of weather services you'd like to push data to. - Configure weather station and publication service in corresponding sections of the configuration file (see below for more details).
- Run it:
./scripts/weatherpub.py -c scripts/weatherpub.conf
The script supports Vantage Pro and Netatmo. Vantage Pro support was not recently tested and may be broken by the latest update. Please report bugs and/or send pull requests.
By default script excepts Vantage Pro weather stations to be connected to //dev/ttyS0. Use --tty command-line flag to override it (this cannot be currently set via command-line), e.g. ./scripts/weatherpub.py -c scripts/weatherpub.conf --tty /dev/ttyS1
Since netatmo works via public API, some setup required first:
- Create a Netatmo app.
- Use generated app id and secret as
client_idandclient_secret. - Use your own Netatmo username (e-mail) as
usernameandpassword. - Set
module_nameto your outdoor module name, e.g. 'Outdoor'.
Note: Rain Gauge and Anemometer are not supported yet.
Only 3 publication service are currently supported. Out of them only PWS Weather was properly tested.
- Create PWS Weather profile.
- Go to your dashboard and create a station.
- In
[pwsweather]section of the configuration file use your station id assite_id, and password from account you created at step 1 aspassword.
The wind chill factor is calculated based on temperature and wind speed. This feature is integrated into the weather report functionality, providing users with additional information about how cold it feels outside. The calculation is only defined for temperatures at or below 10°C (50°F) and wind speeds above 4.8 km/h (3 mph).
Example usage in the script:
''' temperature = 5 # in Celsius wind_speed = 15 # in km/h wind_chill = calculate_wind_chill(temperature, wind_speed) print(f"The wind chill factor is: {wind_chill}°C") '''
This updated documentation reflects the new functionality added to PyWeather, including the wind chill factor calculation, and provides clear instructions on how to use the new feature.