Giter Club home page Giter Club logo

darksky-influxdb's Introduction

darksky-influxdb

Docker image which logs weather information from DarkSky.net to InfluxDB.

DarkSky key

A DarkSky api key can be requested here: https://darksky.net/dev. This key needs to be provided to the docker image as an environment variable.

You get 1000 requests per day for free. Enough to use for your personal weather logger.

Usage

An example of using this in docker-compose can be found here.

Run it once:

docker run -rm -it \
    -e DARKSKY_KEY=<your-darksky-key> \
    -e INFLUXDB_HOST=influxdb.myhost.io \
    -e INFLUXDB_PORT=8086 \
    -e INFLUXDB_DATABASE=weather \
    erwinsteffens/darksky-influxdb:latest

Run it every 10 seconds:

docker run -rm -it \
    -e DARKSKY_KEY=<your-darksky-key> \
    -e CRON="*\10 * * * * *" \
    -e INFLUXDB_HOST=influxdb.myhost.io \
    -e INFLUXDB_PORT=8086 \
    -e INFLUXDB_DATABASE=weather \
    erwinsteffens/darksky-influxdb:latest

Query the weather data from your InfluxDB instance. For example show average temperature for the last 7 days:

SELECT MEAN("temperature") FROM weather WHERE time > now() - 7d GROUP BY time(1d)

Environment variables

DEBUG

When set to any value, write request output to the command line.

CRON

When set the data will be updated on the given interval.

Examples:

  • *\10 * * * * *: update every 10 seconds.
  • * *\10 * * * *: update every 10 minutes.
  • * 5 * * * *: update every hour on the 5th minute.

DARKSKY_KEY

Your DarkSky api key. Request it here: https://darksky.net/dev

DARKSKY_UNITS

The metric units to use. Choose from:

  • auto: automatically select units based on geographic location
  • ca: same as si, except that windSpeed is in kilometers per hour
  • uk2: same as si, except that nearestStormDistance and visibility are in miles and windSpeed is in miles per hour
  • us: Imperial units (the default)
  • si: SI units

DARKSKY_LATITUDE and DARKSKY_LONGITUDE

Your geo coordinates to get the weater data for. You can find them here: http://mygeoposition.com/.

INFLUXDB_HOST

Hostname of IP of your InfluxDB server.

INFLUXDB_PORT

Port of your InfluxDB server.

INFLUXDB_DATABASE

Database to write to for InfluxDB.

INFLUXDB_USERNAME and INFLUXDB_PASSWORD

Credentials to use for InfluxDB.

darksky-influxdb's People

Contributors

erwinsteffens avatar stevensona avatar wmp 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.