a weather application for the raspberry pi and the Pimorioni Inky pHAT.

Overview

mounted pi

raspi-weather

a weather application for the raspberry pi and the Inky pHAT (https://shop.pimoroni.com/products/inky-phat?variant=12549254217811)

The script displays:

  • the current temperature
  • today's date
  • today's temperature range
  • tomorrow's temperature range
  • a verbal description of today's weather
  • weather icons drawn with math and python's drawing library

A valuable resource: https://learn.pimoroni.com/tutorial/sandyj/getting-started-with-inky-phat

Installation

SSH into your rasberry pi

ssh pi@[IPADDRESS]

Install the Inky pHAT libraries

curl https://get.pimoroni.com/inky | bash

Copy weather.py over to your pi

scp /path/to/file username@a:/path/to/destination

Obtain a Weather Underground account

https://www.wunderground.com/

Edit weather.py and update the variables with your API Key, the closest station, and your zipcode

  • ZIPCODE

  • STATION

  • APIKEY

Set the raspberry pi to run your script every 30 minutes

crontab -e

At the very bottom of your crontab file, add the following line:

*/30 * * * * python3 /[PATH TO YOUR SCRIPT]

Comments
  • Extraneous character '6' in URL that gets current conditions

    Extraneous character '6' in URL that gets current conditions

    Line 25 has an extra '6' character after the station ID when trying to get the current conditions.

    query = "https://api.weather.com/v2/pws/observations/current?stationId="+STATION+"6&format=json&units=e&apiKey="+APIKEY

    opened by csharpengineer 1
  • Add time to top line with date. Comment line fix.

    Add time to top line with date. Comment line fix.

    Since this is an e-ink display, you can't tell if the RasPi is powered on or off by looking at the display. The data on the screen may be stale, but you can't tell how stale by just having the date. Added the time and centered both. Minor fix to comment from previous mod.

    opened by Solarmax64 0
  • Use variable font size based on length of narrative string

    Use variable font size based on length of narrative string

    Some narratives are long and truncate. This uses a variable font size to find the largest possible font for the narrative, from font size 9 to 30. It also changes the narrative to center justified.

    opened by Solarmax64 0
  • is instead of == and API

    is instead of == and API

    Apart from the fact that there are several "is" instead of == to be corrected in your weather.py file, my wunderground api doesn't work at all. I keep receiving the error:

    File "/home/Pimoroni/inky/weather.py", line 20, in APIKEY = fdd56a4a142a4d######a4a142a2d68df NameError: name 'fdd56a4a142a4d######a4a142a2d68df' is not defined

    opened by alemarengo 2
  • Source provided not correct? Also getting jsondecodeerror

    Source provided not correct? Also getting jsondecodeerror

    Thanks for this, I am trying to get it to work, however, and don't seem to be able to. I don't know why, I am fairly new to cli side of things. I had to make several changes to the code as it wasn't working for various reasons, partly because I'm using inkyWHAT.

    I have forked the code https://github.com/Tjobbe/raspi-weather/blob/main/weather.py and here is my cli error:

    pi@tjobbe:~ $ python3 /home/pi/scriptsforWHAT/weather-display.py Traceback (most recent call last): File "/home/pi/scriptsforWHAT/weather-display.py", line 29, in <module> x = json.loads(text) File "/usr/lib/python3.9/json/__init__.py", line 346, in loads return _default_decoder.decode(s) File "/usr/lib/python3.9/json/decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/usr/lib/python3.9/json/decoder.py", line 355, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

    opened by Tjobbe 0
Owner
Derek Caelin
Technology for Good
Derek Caelin
Create a low powered, renewable generation forecast display with a Raspberry Pi Zero & Inky wHAT.

GB Renewable Forecast Display This Raspberry Pi powered eInk display aims to give you a quick way to time your home energy usage to help balance the g

Andy Brace 32 Jul 2, 2022
A dashboard for Raspberry Pi to display environmental weather data, rain radar, weather forecast, etc. written in Python

Weather Clock for Raspberry PI This project is a dashboard for Raspberry Pi to display environmental weather data, rain radar, weather forecast, etc.

Markus Geiger 1 May 1, 2022
Historic weather - Home Assistant custom component for accessing historic weather data

Historic Weather for Home Assistant (CC) 2022 by Andreas Frisch github@fraxinas.

Andreas Frisch 1 Jan 10, 2022
Simple Weather Check base on Hefeng api, Work on raspberry Pi

Simple Weather Check base on Hefeng api, Work on raspberry Pi

Retr0mous 28 Sep 17, 2022
An embedded application for toy-car controlling based on Raspberry Pi 3 Model B and AlphaBot2-Pi.

An embedded application for toy-car controlling based on Raspberry Pi 3 Model B and AlphaBot2-Pi. This is the source codes of my programming assignmen

StardustDL 4 Oct 19, 2022
A rubiks cube timer using a distance sensor and a raspberry pi 4, and possibly the pi pico to reduce size and cost.

distance sensor cube timer A rubiks cube timer using a distance sensor and a raspberry pi 4, and possibly the pi pico to reduce size and cost. How to

null 3 Feb 21, 2022
CO2Ampel - This RaspberryPi project uses weather data to estimate the share of renewable energy in the power grid

CO2Ampel This RaspberryPi project uses weather data to estimate the share of ren

Felix 4 Jan 19, 2022
This repository hosts the code for Stanford Pupper and Stanford Woofer, Raspberry Pi-based quadruped robots that can trot, walk, and jump.

This repository hosts the code for Stanford Pupper and Stanford Woofer, Raspberry Pi-based quadruped robots that can trot, walk, and jump.

Stanford Student Robotics 1.2k Dec 25, 2022
Mycodo is open source software for the Raspberry Pi that couples inputs and outputs in interesting ways to sense and manipulate the environment.

Mycodo Environmental Regulation System Latest version: 8.12.9 Mycodo is open source software for the Raspberry Pi that couples inputs and outputs in i

Kyle Gabriel 2.3k Dec 29, 2022
Designed a system that can efficiently sort recyclables and transfer them to corresponding bins using Python, a Raspberry Pi, and Quanser Labs.

System for Sorting and Recycling Containers - Project 3 Table of contents Overview The challenge Screenshot My process Built with Code snippets What I

Mit Patel 2 Dec 2, 2022
Code and build instructions for Snap, a simple Raspberry Pi and LED machine to show you how expensive the electricyty is at the moment

Code and build instructions for Snap, a simple Raspberry Pi and LED machine to show you how expensive the electricyty is at the moment. On row of LEDs shows the cost of the hour, the other row the cost of the day.

Johan Jonk Stenström 3 Sep 8, 2022
Minimal and clean dashboard to visualize some stats of Pi-Hole with an E-Ink display attached to your Raspberry Pi

Clean Dashboard for Pi-Hole Minimal and clean dashboard to visualize some stats of Pi-Hole with an E-Ink display attached to your Raspberry Pi.

Alessio Santoru 104 Dec 14, 2022
A global contest to grow and monitor your own food with Raspberry Pi

growlab A global contest to grow and monitor your own food with Raspberry Pi A capture from phototimer of my seed tray with a wide-angle camera positi

Alex Ellis 442 Dec 23, 2022
A Raspberry Pi Pico powered Macro board, like a Streamdeck but cheaper and simpler.

Env-MCRO A Raspberry Pi Pico powered Macro board, like a Streamdeck but cheaper and simpler. (btw this image is a bit outdated, some of the silkscreen

EnviousData 68 Oct 14, 2022
Raspberry Pi Pico and LoRaWAN from CircuitPython

Raspberry Pi Pico and LoRaWAN from CircuitPython Enable LoRaWAN communications on your Raspberry Pi Pico or any RP2040-based board using CircuitPython

Alasdair Allan 15 Oct 8, 2022
A versatile program that uses the raspberry pi camera and provides it as a service

PiCameleon Is a daemon program meant to provide the RaspberryPi Camera as a service while running according to a configuration.

André Esser 52 Oct 16, 2022
Monorepo for my Raspberry Pi dashboard and GPS satellite listener.

?? pi dashboard My blog post: Listening to Satellites with my Raspberry Pi This is the monorepo for my Raspberry Pi dashboard!

Andrew Healey 27 Jun 8, 2022
KIRI - Keyboard Interception, Remapping, and Injection using Raspberry Pi as an HID Proxy.

KIRI - Keyboard Interception, Remapping and Injection using Raspberry Pi as a HID Proxy. Near limitless abilities for a keyboard warrior. Features Sim

Viggo Falster 10 Dec 23, 2022
Using a raspberry pi, we listen to the coffee machine and count the number of coffee consumption

A typical datarootsian consumes high-quality fresh coffee in their office environment. The board of dataroots had a very critical decision by the end of 2021-Q2 regarding coffee consumption.

dataroots 51 Nov 21, 2022