Code Monkey home page Code Monkey logo

drakeapps / pws-publish Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 24 KB

Poll Wunderground API or connect to Ambient Weather socket stream to receive current weather station information and publish it to a Websocket server, MQTT broker, and/or InfluxDB.

Home Page: https://jamesdrakewilson.com

Dockerfile 2.87% Python 97.13%
influxdb websocket-server mqtt-client wunderground wunderground-api wunderground-pws ambientweather ambientweather-api ambient-weather ambient-weather-api

pws-publish's Introduction

Wunderground/Ambient Weather PWS Publisher

Poll Wunderground API or connect to Ambient Weather socket stream to receive current weather station information and publish it to a Websocket server, MQTT broker, and/or InfluxDB.

Your Wunderground API key is found under member settings.

Create an API key and Application Key under your Ambient Weather account

You will need to have either --wunderground or --ambient-weather as arguments, or it won't connect to either.

Command Line Arguments

python main.py -h
usage: main.py [-h] [--wunderground] --api-key API_KEY --station-id STATION_ID
               [--ambient-weather] [--application-key APPLICATION_KEY]
               [--influx] [--influx-host INFLUX_HOST]
               [--influx-port INFLUX_PORT] [--influx-db INFLUX_DB]
               [--influx-measurement INFLUX_MEASUREMENT] [--websocket]
               [--websocket-host WEBSOCKET_HOST]
               [--websocket-port WEBSOCKET_PORT] [--mqtt]
               [--mqtt-broker MQTT_BROKER] [--mqtt-prefix MQTT_PREFIX]
               [--refresh-rate REFRESH_RATE] [--units UNITS] [--verbose]
               [--stdout] [--raw-stdout]

Wunderground/Ambient Weather PWS Publisher

optional arguments:
  -h, --help            show this help message and exit
  --wunderground        enable wunderground api polling
  --api-key API_KEY     wunderground/ambient weather api key
  --station-id STATION_ID
                        wunderground station id
  --ambient-weather     enable ambient weather api stream
  --application-key APPLICATION_KEY
                        ambient weather application key
  --influx              publish to influxdb
  --influx-host INFLUX_HOST
                        InfluxDB Host
  --influx-port INFLUX_PORT
                        InfluxDB Port
  --influx-db INFLUX_DB
                        InfluxDB Database
  --influx-measurement INFLUX_MEASUREMENT
                        InfluxDB Name of Measurement for point
  --websocket           publish to WebSocket server
  --websocket-host WEBSOCKET_HOST
                        WebSocket server host
  --websocket-port WEBSOCKET_PORT
                        WebSocket server port
  --mqtt                publish to MQTT broker
  --mqtt-broker MQTT_BROKER
                        MQTT broker
  --mqtt-prefix MQTT_PREFIX
                        MQTT prefix for messages. ex: weather ->
                        weather/windSpeed
  --refresh-rate REFRESH_RATE
                        time between Wunderground API requests
  --units UNITS         units for wunderground api to return. e=imperial.
                        m=metric. h=hybrid (uk)
  --verbose             Add debug messages
  --stdout              Write JSON to stdout of parsed data
  --raw-stdout          Write JSON to stdout of raw API data

Docker

  1. Edit .env-sample and copy/move to .env
  2. Edit docker-compose.yml command line to enable/disable/edit any other arguments
  3. docker-compose pull (or build). Images are hosted on GHCR and are built for ARM and x86 on every master commit.
  4. docker-compose up -d

Python (venv)

python3 -m venv venv
source venv/bin/activate
pip3 install -r requirements.txt
# wunderground example
python3 main.py --api-key 1234567890abcdef --station-id KTXHOUST3324 --wunderground --influx --websocket --mqtt

pws-publish's People

Contributors

drakeapps avatar

Stargazers

 avatar  avatar

Watchers

 avatar

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.