ideasasylum / DarkPi

An ambient weather display for Raspberry Pi Zero, Pimoroni Blinkt, and Dark Sky api

Repository from Github https://github.comideasasylum/DarkPiRepository from Github https://github.comideasasylum/DarkPi

DarkPi

An ambient weather display for Raspberry Pi Zero W, Pimoroni Blinkt, and Dark Sky API

I thought this would be a useful way to gauge whether the kids needed to bring a jumper or coat to school each day. It uses the Dark Sky api to pull down the forecasts for the next 8 hours, and display some vaguely appropriate colours. The lights are dimmer at night.

Requirements

Powered by Dark Sky

Installation

Install the Blinkt libraries: https://github.com/pimoroni/blinkt sudo pip install python-forecastio

Put the darkypi.py script somewhere

Set the environment variables (I put them in ~/.bash_profile)

DARKSKY_API="somethingsomething"; export DARKSKY_API
LAT="50.7"; export LAT
LON="-10.5"; export LON

Run

python darkpi.py

Scheduling

We want the display to update every hour, and when we power on the device.

I wrote a little shell script called run.sh to hold the environment variables because cron is... awkward

DARKSKY_API="something"; export DARKSKY_API
LAT="50.5"; export LAT
LON="-8.5"; export LON

python ~/darkpi/darkpi.py

Run crontab -e and add these entries to the crontab

0 * * * * /darkpi/run.sh
@reboot   /darkpi/run.sh

Examples

Partly cloudy

Output

Rainy now

Clear and partly cloudy

About

An ambient weather display for Raspberry Pi Zero, Pimoroni Blinkt, and Dark Sky api


Languages

Language:Python 93.8%Language:Shell 6.2%