Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mh-superbox/openweathermap-telegram-alert
Send OpenWeatherMap alerts (One Call API) to telegram users.
https://github.com/mh-superbox/openweathermap-telegram-alert
Last synced: 3 months ago
JSON representation
Send OpenWeatherMap alerts (One Call API) to telegram users.
- Host: GitHub
- URL: https://github.com/mh-superbox/openweathermap-telegram-alert
- Owner: mh-superbox
- License: mit
- Created: 2022-02-02T20:10:35.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2022-08-29T04:32:06.000Z (over 2 years ago)
- Last Synced: 2023-03-06T08:56:34.198Z (almost 2 years ago)
- Language: Python
- Homepage:
- Size: 106 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# OpenWeatherMap Telegram Alert
Send OpenWeatherMap alerts (One Call API) to telegram users.
![Features](assets/screenshot.png)
## Installation
**Requirements:**
* Python 3.8
```shell
$ apt install python3-yaml python3-requests
```Copy the `om-telegram-alert.py` file:
```shell
$ cp src/usr/local/sbin/om-telegram-alert.py /usr/local/sbin/om-telegram-alert.py
$ chmod +x /usr/local/sbin/om-telegram-alert.py
```Copy the `om-telegram-alert.yaml` configuration file:
```shell
$ cp src/etc/default/om-telegram-alert.yaml /etc/default
```## Configuration
You can set OpenWeatherMap and Telegram settings in the `/etc/default/om-telegram-alert.yaml`.
### OpenWeaterMap
| Key | Value |
|----------------|----------------------------------------------------|
| `lat` | latitude - Geographical coordinates (required). |
| `lon` | longitude - Geographical coordinates (required). |
| `appid` | Your unique API key (required). |
| `exclude_tags` | A list of tags to exlclude from sending messages. |### Telegram
| Key | Value |
|------------|---------------------------|
| `token` | Bot token (required). |
| `chat_ids` | User chat ids (required). |## Start systemd timer
The timer check every 15 minutes for new entries.
```shell
$ cp src/etc/systemd/system/om-telegram-alert.* /etc/systemd/system
$ systemctl enable --now om-telegram-alert.timer
```## Changelog
### 1.0.2
* Avoid sending alerts that are duplicates and have a new timestamp
### 1.0.1
* Clean temporary file if there are more than 20 entries