---
title: "Greenhouse monitoring and alerting"
canonical: "https://help.scopious.co.nz/space/KB/13631498/Greenhouse%20monitoring%20and%20alerting"
format: markdown
---
> Macro (toc)

## Brief overview

This use case walks you through setting up LoRaWAN IoT sensors to monitor the ambient temperature and soil moisture in a greenhouse, and then alert when the air temperature and/or soil moisture drops below or rises above an acceptable range.

## Equipment needed

We will need a [gateway](https://scopious.atlassian.net/wiki/spaces/KB/pages/85917701/Glossary+of+Terms#Gateway) and two [devices](https://scopious.atlassian.net/wiki/spaces/KB/pages/85917701/Glossary+of+Terms#Device).

- LoRaWAN gateway: Milesight UG65
- LoRaWAN Temperature and Humidity sensor: Milesight EM300-TH
- LoRaWAN Soil moisture, temperature and conductivity sensor: Milesight EM500-SMTC-MEC20

## Setup Gateway

Identify an appropriate location for your gateway that will provide coverage to the sensors. Your gateway will need access to a reliable power source and internet connection.

Follow the [https://scopious.atlassian.net/wiki/spaces/KB/pages/75169790](https://scopious.atlassian.net/wiki/spaces/KB/pages/75169790) steps to configure and install the gateway.

## Setup Devices

Now the gateway has been setup we can setup and install the sensors.

Before installing the sensors, we want to add them to the network to ensure they can connect successfully, as it’s easier to do this now rather than once they are installed.

### Add the devices

To add the sensors, follow these steps *(note these steps can also be found in *[https://scopious.atlassian.net/wiki/spaces/KB/pages/75165460](https://scopious.atlassian.net/wiki/spaces/KB/pages/75165460)*).*

For each sensor:

1. Navigate to the **Devices** page on the Scopious app.
2. Click **Add Device**.
3. We will select the **QR code** method to add the device as this is quick and easy:
  1. Select the **Default Scopious Device Pool** so the data can be stored and viewed in the Scopious platform.
  2. Scan the QR code on the back of the sensor. The application will automatically recognise the sensor and populate all the fields.
  3. Give the sensor a useful name and description to easily identify it and click the **Add Device** button at the bottom of the form.
4. You will see the device appear in the list but reported as **‘Not Seen’**.
5. Click on the device. You will notice the **Device Metadata** section is empty as the device has not connected to the network yet.
6. Turn on the device, or if the device was already on then restart it. Within a minute it should connect to the network, and you will see the **Device Metadata** section showing signal strength information.

 The device is now ready to be installed!

### Install the devices

Locating the devices is the most important factor in obtaining accurate data. As these sensors are battery powered you can mount it anywhere within the glasshouse but take into consideration the following points for optimal results.

- The EM300-TH sensor provides air temperature and air humidity readings. Avoid locations where it may get wet from watering or close to ventilation openings as the readings may get distorted.
- The EM500-SMTC-MEC20 sensor provides soil moisture, temperature, and electrical conductivity readings. Embed the senor probes into the soil at the location you wish to measure and mount the enclosure case up off the ground to maximise RF reliability between the device and gateway.

The devices should now be installed and sending reliable and accurate data!

## Setup Dashboards

When the devices were added, [dashboards](https://scopious.atlassian.net/wiki/spaces/KB/pages/85917701/Glossary+of+Terms#Dashboard) were created automatically.

We can view these dashboards by navigating to the **Dashboards** page. Here, we can select the dashboard that we want to view.

![image-20241203-210326.png](media://4f92c398-8e49-445a-abed-fd3733a614f5)

## Setup Alarms

Create two [alarms](https://scopious.atlassian.net/wiki/spaces/KB/pages/85917701/Glossary+of+Terms#Alarm) to alert us when the greenhouse ambient temperature is too cold or too warm and when the soil moistures Relative Humidity (RH) is outside the optimal range.

Follow the [https://scopious.atlassian.net/wiki/spaces/KB/pages/75137688](https://scopious.atlassian.net/wiki/spaces/KB/pages/75137688) steps to create the alarms:

1. Create an alarm that will trigger a warning if the greenhouse ambient temperature goes below 18°C or above 24°C. Note you may want to adjust these thresholds to suit your growing environment.
2. Create a second alarm that will trigger a warning if the soil moistures Relative Humidity (RH) % falls below 20% RH and exceeds 60% RH. Note you may want to adjust these thresholds to suit the soil composition and plants you are growing.

Once created, visit the Control Centre page to view the current status of the alarms:

![image-20241203-205929.png](media://031c732b-b606-4922-bc85-24214ed28f29)