Table of Contents
Our application is a prototype for an IoT device, which implements a smart plant care system.The system aims to adjust the water, light, or temperature of the plants, depending on certain parameters set by the user or parameters that are updated based on weather-related information.
- The user can set a temperature for the system
- The user can receive information about the system temperature
- The user can set the soil moisture
- The user can receive information about the soil moisture
- The user can water a plant
- The user can receive information about watering the plants
- The user can receive detailed information about the weather
Full API documentation can be found here
You should have python3 installed and pip3. In order to run the project locally you should go through the following steps:
-
cd into this project
-
Install venv if not already installed:
pip install virtualenv
- Create an environment:
python3 -m venv ./
Windows:
python -m venv venv
- Activate environment
macOS/Linux:
source venv/bin/activate
Windows:
venv\Scripts\activate.bat
- Install libraries
pip install -r requirements.txt
- Set environment value for development:
export FLASK_ENV=development
CMD:
set FLASK_ENV=development
PowerShell:
$env:FLASK_ENV = "development"
- Initialize (or reinitialize) database:
flask init-db
- Run
flask run
Install and run mosquitto.
Mac
brew install mosquitto
- If restarting the service is needed:
brew services restart mosquitto
In order to collect data about weather, we used The Storm Glass API, which allows you to fetch weather data for any coordinate on the globe in a simple, programmatic way using conventional HTTP requests. When a request is successful, a response will be sent back in the form of a JSON object. The weather request is used to fetch weather data for a point. The Storm Glass API provides marine weather as well as global weather for land and lakes.
Point Requests are used to retrieve data for a single coordinate.
https://api.stormglass.io/v2/weather/point
You can read more about the required parameters and the response format here
To run the tests:
python -m pytest -v -W ignore::DeprecationWarning