MIT License Stargazers

Plant logo

Table of Contents
  1. About The Project
  2. Getting Started

About The Project

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.

Implemented Endpoints:

Login

Register

System temperature

  • The user can set a temperature for the system
  • The user can receive information about the system temperature

Soil Moisture

  • The user can set the soil moisture
  • The user can receive information about the soil moisture

Water

  • The user can water a plant
  • The user can receive information about watering the plants

Weather API

  • The user can receive detailed information about the weather

Full API documentation can be found here

(back to top)

Built With

(back to top)

Getting Started

You should have python3 installed and pip3. In order to run the project locally you should go through the following steps:

Installation

  1. cd into this project

  2. Install venv if not already installed:

pip install virtualenv
  1. Create an environment:
python3 -m venv ./

Windows:

python -m venv venv
  1. Activate environment

macOS/Linux:

source venv/bin/activate

Windows:

venv\Scripts\activate.bat
  1. Install libraries
pip install -r requirements.txt
  1. Set environment value for development:
export FLASK_ENV=development

CMD:

set FLASK_ENV=development

PowerShell:

$env:FLASK_ENV = "development"
  1. Initialize (or reinitialize) database:
flask init-db
  1. Run
flask run

(back to top)

Mosquitto

Install and run mosquitto.

Mac

brew install mosquitto
  1. If restarting the service is needed:
brew services restart mosquitto

(back to top)

Storm Glass API

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

(back to top)

Testing

To run the tests:

python -m pytest -v -W ignore::DeprecationWarning

(back to top)