{"id":21259943,"url":"https://github.com/madebyadem/weerbot","last_synced_at":"2026-05-09T02:33:38.294Z","repository":{"id":249100542,"uuid":"830540854","full_name":"MadeByAdem/WeerBot","owner":"MadeByAdem","description":"This project is an addition to my Nest Project, but works as a standalone as well. Simply remove the functions you don't want. In essence it retrieves several weather data and sends it to your Telegram account. It also stores the data in a JSON file and sends it to another server (in my case where my Nest Project is hosted).","archived":false,"fork":false,"pushed_at":"2024-07-18T13:28:38.000Z","size":13,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-21T21:47:16.171Z","etag":null,"topics":["bash","linux","python","telegram"],"latest_commit_sha":null,"homepage":"https://madebyadem.dev","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MadeByAdem.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-07-18T13:23:57.000Z","updated_at":"2024-07-18T13:28:41.000Z","dependencies_parsed_at":"2024-07-18T16:57:23.737Z","dependency_job_id":null,"html_url":"https://github.com/MadeByAdem/WeerBot","commit_stats":null,"previous_names":["madebyadem/weerbot"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MadeByAdem%2FWeerBot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MadeByAdem%2FWeerBot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MadeByAdem%2FWeerBot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MadeByAdem%2FWeerBot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MadeByAdem","download_url":"https://codeload.github.com/MadeByAdem/WeerBot/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243695514,"owners_count":20332626,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bash","linux","python","telegram"],"created_at":"2024-11-21T04:16:02.061Z","updated_at":"2026-05-09T02:33:33.273Z","avatar_url":"https://github.com/MadeByAdem.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Dutch Weather Telegram bot\n\nThis project is an addition to my Nest Project, but works as a standalone as well. Simply remove the functions you don't want. In essence it retrieves several weather data and sends it to your Telegram account. It also stores the data in a JSON file and sends it to another server (in my case where my Nest Project is hosted).\n\n## Features\n### Interactive Commands:\n- /start - Initiates the bot and provides a welcome message.\n- /menu - Displays the menu with available weather options.\n- Weather Summaries: Provides a concise summary of current weather conditions, including temperature, wind speed, and a brief description.\n- Detailed Weather Information: Offers detailed weather data, including temperature, humidity, wind direction and speed, UV index, sunrise and sunset times, and forecasts for today and tomorrow.\n- Authorized Access: Ensures that only authorized users can access the bot’s functionalities.\n- Automatic Logging: Logs weather data twice per hour and more detailed data a few times per day.\n- Weather Data Retrieval: Fetches weather data from the KNMI API and handles potential errors and retries.\n- UV Data Retrieval: Obtains UV index data from the OpenUV API, with support for both primary and backup API keys.\n- Data Processing: Processes raw weather and UV data to create user-friendly summaries and detailed reports.\n- Data Transmission: Securely transmits weather data to a designated server using SCP.\n- Scheduled Updates: Supports scheduling of regular weather updates using the schedule module.\n\n## Files\n`weather_bot.py`: The main script. \\\n`weather_functions.py`: Functions used in the script. \\\n`weather_update.py`: The weather update function. \\\n`.env.example`: An example `.env` file. \\\n`weather_bot.service`: A systemd service file. \\\n`weather_update.service`: A systemd service file.\n\n## Setup\n\n### Prerequisites\n- Python 3.x\n- `pip` package manager\n- A Telegram bot token. You can get one by creating a bot through the [BotFather](https://core.telegram.org/bots#botfather).\n- API keys for the OpenUV and KNMI APIs\n- Encryption key. [Check documentation how to get one](https://cryptography.io/en/latest/fernet/).\n\n### Installation\n\n1. **Clone the repository:**\n    ```bash\n    git clone https://github.com/MadeByAdem/WeerBot\n    cd WeerBot\n    ```\n\n2. **Create a virtual environment and activate it:**\n    ```bash\n    python -m venv venv\n    source venv/bin/activate  # On Windows, use `venv\\Scripts\\activate`\n    ```\n\n3. **Install the required packages:**\n    ```bash\n    pip install -r requirements.txt\n    ```\n\n4. **Set up your environment variables:**\n\n    Copy the `.env.example` file to `.env` and variables with your keys.\n    ```bash\n    cp .env.example .env\n    ```\n\n5. **Run the bot:**\n    ```bash\n    python weather_bot.py\n    ```\n\n### Setting up as a Systemd Service\n\n1. **Modify the service files:**\n\n    Update the `weather_bot.service` file with your actual paths:\n    ```ini\n    [Unit]\n    Description=Weather Bot\n    After=network.target\n\n    [Service]\n    ExecStart=/your/path/to/weather_bot/venv/bin/python /your/path/to/weather_bot/weather_bot.py\n    WorkingDirectory=/your/path/to/weather_bot\n    User=root\n    Restart=always\n\n    [Install]\n    WantedBy=multi-user.target\n    ```\n\n    Update the `weather_update.service` file with your actual paths:\n    ```ini\n    [Unit]\n    Description=Weather Update\n    After=network.target\n\n    [Service]\n    ExecStart=/your/path/to/weather_bot/venv/bin/python /your/path/to/weather_bot/weather_update.py\n    WorkingDirectory=/your/path/to/weather_bot\n    User=root\n    Restart=always\n\n    [Install]\n    WantedBy=multi-user.target\n    ```\n\n2. **Copy the service file to systemd:**\n    ```bash\n    sudo cp weather_bot.service /etc/systemd/system/\n    sudo cp weather_update.service /etc/systemd/system/\n    ```\n\n3. **Reload systemd and start the service:**\n    ```bash\n    sudo systemctl daemon-reload\n    sudo systemctl start weather_bot.service\n    sudo systemctl start weather_update.service\n    ```\n\n4. **Enable the service to start on boot:**\n    ```bash\n    sudo systemctl enable weather_bot.service\n    sudo systemctl enable weather_update.service\n    ```\n\n## Usage\n1. Start a chat with your bot on Telegram.\n2. Use the `/start` command to receive the welcome message.\n3. Use the `/menu` command to see the available weather options.\n\n## Environment Variables\n`SECRET_TOKEN_WEATHERBOT` : Your Telegram bot token. \\\n`CHAT_ID_PERSON_1` : Chat ID of the first person. \\\n`CHAT_ID_PERSON_2` : Chat ID of the second person. You can add more, just modify the functions. \\\n`SSHKEY` : If you want to send the json to another server. Make sure this sshkey is added to the receiving server. \\\n`RECEIVING_SERVER` : The IP address and port of the receiving server. \\\n`RECEIVING_FILE_PATH` : The path on the receiving server where the data should be stored. \\\n`LOG_DIRECTORY` : The directory where the log file is stored. \\\n`LOG_FILE_NAME` : The name of the log file. \\\n`KNMI_API_KEY` : Your KNMI API key. \\\n`KNMI_LOCATION_CODE` : The location you want to receive data from (format: `latitude,longitude`). \\\n`WEATHER_JSON_FILE_PATH` : The path where the json file is stored. \\\n`UV_API_KEY` : Your OpenUV API key. \\\n`UV_API_BACKUP_KEY` : Your OpenUV backup API key (in case of to many api requests)  \\\n`ENCRYPTION_KEY` : Your encryption key \\\n\n\n## Contributing\nFeel free to submit issues or pull requests if you have suggestions for improvements or new features. Please follow the existing coding style.\n\n## License\nThis project is licensed under the Custom License. See the [LICENSE](LICENSE) file for more details.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmadebyadem%2Fweerbot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmadebyadem%2Fweerbot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmadebyadem%2Fweerbot/lists"}