https://github.com/andreiregiani/iot-weather
Weather voice speech intended for the IoT
https://github.com/andreiregiani/iot-weather
Last synced: 29 days ago
JSON representation
Weather voice speech intended for the IoT
- Host: GitHub
- URL: https://github.com/andreiregiani/iot-weather
- Owner: AndreiRegiani
- License: gpl-3.0
- Created: 2017-01-21T08:17:05.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2025-02-12T08:39:55.000Z (4 months ago)
- Last Synced: 2025-04-30T20:25:23.971Z (29 days ago)
- Language: Python
- Homepage:
- Size: 31.3 KB
- Stars: 5
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# IoT-weather
Python script that uses Text-To-Speech to say the current weather in specified location. Edit `settings.py` for desired location (lat/long) and use your `Dark Sky API` key (easily create a free account https://darksky.net/dev/). Tested on Raspberry Pi 3 (Raspbian).## How It Works
1. Raw weather data is pulled from `Dark Sky API` via HTTP request
2. Friendly summary is formated from raw data
2. `gTTS` is used to generate `.MP3` audio file from text
3. `mpg123` plays generated fileCheck `output-example/` to hear how it sounds.
## System Requirements
* Linux
* Python 3
* Internet connection
* Audio output## Setup
System dependency: (Debian/Raspbian/Ubuntu)
```
sudo apt install mpg123
```Setup a virtual environment:
```
sudo pip3 install virtualenv
virtualenv -p python3 env
source env/bin/activate
pip install -r requirements.txt
```## Run
```
python3 main.py[AUDIO] checking weather...
[HTTP] requesting weather...
[TTS] generating weather speech...
[AUDIO] Now it's Partly Cloudy, with temperature of 3 degrees.
```