Coder Social home page Coder Social logo

cmcginty / pyweather Goto Github PK

View Code? Open in Web Editor NEW
60.0 12.0 34.0 346 KB

Bindings for Davis Vantage Pro and Pro2 weather stations, upload of weather data (e.g. wunderground.com, pwsweather.com), and meteorological calculation/conversion functions.

License: GNU General Public License v3.0

Python 98.94% Makefile 1.06%

pyweather's Introduction

PyWeather

Abstract

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.

Unit Conversion

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.

Station Observations

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.

Data Publication

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: [email protected]

Data Publication Script

scripts/weatherpub.py supports publication of the weather data. It can also serve as a good usage example.

General usage

  1. Copy weatherpub.conf.example as weatehrpub.conf.
  2. Modify weatehrpub.conf:
  3. In [general] section set station to the name of the station you have.
  4. Set publication to a comma-separated list of weather services you'd like to push data to.
  5. Configure weather station and publication service in corresponding sections of the configuration file (see below for more details).
  6. Run it: ./scripts/weatherpub.py -c scripts/weatherpub.conf

Weather stations

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.

Vantage Pro

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

Netatmo

Since netatmo works via public API, some setup required first:

  1. Create a Netatmo app.
  2. Use generated app id and secret as client_id and client_secret.
  3. Use your own Netatmo username (e-mail) as username and password.
  4. Set module_name to your outdoor module name, e.g. 'Outdoor'.

Note: Rain Gauge and Anemometer are not supported yet.

Publication services

Only 3 publication service are currently supported. Out of them only PWS Weather was properly tested.

PWS Weather

  1. Create PWS Weather profile.
  2. Go to your dashboard and create a station.
  3. In [pwsweather] section of the configuration file use your station id as site_id, and password from account you created at step 1 as password.

pyweather's People

Contributors

bgkerion avatar cmcginty avatar saveriogzz avatar vrusinov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pyweather's Issues

Can't install from pip

So I realize there hasn't been a lot of activity on this project, but thought this might be solved by a quick upload. Right now there is an entry for weather on PyPi but no actual downloads listed.

Current workaround is to install using git+git://github.com/cmcginty/PyWeather but would love to see it installable via PyPi.

Did the API change?

I've been running pyweather forever and it has just worked. Until now. I don't see anything wrong on my account but I am getting authentication error:

weatherpub.py.weather.services._base DEBUG - Connect to: http://weatherstation.wunderground.com
weatherpub.py.weather.services._base DEBUG - GET /weatherstation/updateweatherstation.php?dateutc=2022-09-22+13%3A58%3A05&softwaretype=PyWeather&tempf=66.4&windspeedmph=0&baromin=29.424&rainin=0.0&humidity=95&winddir=117&action=updateraw&dailyrainin=0.0&dewptf=64.8903366236&PASSWORD=XXXX&ID=KNHNASHU20
weatherpub.py.root WARNING - publisher Wunderground: Server returned invalid status: 401 Unauthorized unauthorized

I suspect the API or the endpoint changed?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.