Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jai0401/hackai_hack-230679
The Temperature Alert Agent is a Python script that utilizes the uAgents library to monitor real-time temperatures from the OpenWeatherMap API. Users can set a preferred temperature range for a specific location, and the script will alert them if the temperature goes beyond this range.
https://github.com/jai0401/hackai_hack-230679
fetch-ai fetchai python temperature-monitoring uagents weather-api
Last synced: 2 months ago
JSON representation
The Temperature Alert Agent is a Python script that utilizes the uAgents library to monitor real-time temperatures from the OpenWeatherMap API. Users can set a preferred temperature range for a specific location, and the script will alert them if the temperature goes beyond this range.
- Host: GitHub
- URL: https://github.com/jai0401/hackai_hack-230679
- Owner: Jai0401
- Created: 2023-10-10T17:01:03.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2024-05-23T14:54:03.000Z (7 months ago)
- Last Synced: 2024-10-16T11:41:14.682Z (3 months ago)
- Topics: fetch-ai, fetchai, python, temperature-monitoring, uagents, weather-api
- Language: Python
- Homepage:
- Size: 43.7 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Temperature Alert Agent
## Description
The Temperature Alert Agent is a Python script that uses the uAgents library to fetch real-time temperatures from a free weather API for a specified location. It allows users to set their preferred temperature range (minimum and maximum temperature) and sends an alert/notification when the current temperature in the chosen location goes below the minimum or above the maximum threshold.## Instructions to Run
To run the Temperature Alert Agent, follow these steps:1. Clone the repository to your local machine:
```bash
git clone https://github.com/yourusername/temperature-alert-agent.git2. Navigate to the project directory:
```bash
cd HackAI_Hack-23067
cd src
cd uagents
```3. Install the required dependencies using Poetry:
```bash
poetry install
```4. Set your OpenWeatherMap API key and preferred location in the `hackathon.py` script:
```python
api_key = "Your_OpenWeatherMap_API_Key"
location = "Your_Location" # e.g., "London, UK"
min_temperature = 20 # Minimum preferred temperature in °C
max_temperature = 30 # Maximum preferred temperature in °C
```5. Run the Temperature Alert Agent:
```bash
python hackathon.py
```The agent will start fetching the current temperature for the specified location and send alerts if the temperature goes outside the preferred range.
## Special Considerations
- Make sure you have a valid OpenWeatherMap API key. You can obtain one by signing up on the [OpenWeatherMap website](https://openweathermap.org/).
- The agent fetches temperature data every 30 minutes by default. You can adjust the update interval by changing the `period` parameter in the `check_temperature` method in the `hackathon.py` script.
- Ensure that your environment allows outbound internet connections for API requests.Feel free to reach out for any questions or assistance with running the Temperature Alert Agent.