<!-- Canonical: https://www.ezdis.net/en/manual/1.0/guides/sensors | Language: en -->

# Temperature sensors (cold chain)

---

Monitor the temperature of your cold rooms, fridges and freezers from the app. The sensor sends its readings on its own to our MQTT server (Mosquitto) and EzDIS emails you if it goes out of range, when it recovers and if the sensor stops sending (for example, a power cut at night). It is free, up to 30 sensors per account.

## Which sensors work

WiFi sensors that let you choose the MQTT server:

- **Shelly** H&T, Plus H&T or Plus 1 with the Add-on and a DS18B20 probe.
- **ESP32 or ESP8266 with ESPHome**, with DS18B20, DHT22, SHT31 or BME280 probes.
- Devices running **Tasmota** (Sonoff, NodeMCU).

> {warning} Stock Tuya and Sonoff devices send their data to the manufacturer's cloud and cannot be redirected: flash them with Tasmota or ESPHome.

## 1. Add the sensor

1. In the app, go to **Menu → Sensors** and tap **Add sensor**.
2. Enter a name (for example "Freezer room"), choose **temperature** or **humidity** and the allowed **minimum** and **maximum** (for example -25 and -18 °C).
3. **Alert after**: the minutes in a row out of range before alerting, so you don't get an alert every time the door opens. Default: 15.
4. Save. The app shows the **server**, **port**, **username**, **password** and **topic**.

> {primary} The password is shown **only once**. If you lose it, tap **New password** on the sensor page.

## 2. Set up the sensor

> {warning} **The username and password belong to the sensor, not to your EzDIS account.** Each sensor has its own: the app shows them when you add it, under **Settings for the sensor** (the username starts with `sn`, for example `sn4k2p9x7q1m`). The password is shown **only once**: write it down. If you lost it, open the sensor page and tap **New password**.

![The settings for the sensor](/docs/ezdis/screenshots/en/sensor-connection.webp)

<ol class="docs-shot-legend"><li><strong>Server, port, username, password and topic:</strong> what you enter on the sensor</li><li><strong>How to set it up:</strong> the steps for Shelly, ESPHome and Tasmota</li></ol>

- **Shelly:** in the Shelly app or web UI, go to **Settings → MQTT** and enable it. Fill it in like this:
  - **Server:** server and port together, for example `devices.ezdis.net:1883`.
  - **Username** and **Password:** the sensor's username and password from the app.
  - **MQTT prefix:** the topic, for example `s/sn4k2p9x7q1m`.
  - **Connection type:** No TLS. **Client ID:** leave the default.
  - Save and reboot the Shelly.
- **ESPHome:** the app gives you the `mqtt:` block ready to paste into the device YAML.
- **Tasmota:** the app gives you a line to paste into the console.

Within a few minutes the sensor shows its current temperature.

## 3. See readings and get alerts

![A sensor page](/docs/ezdis/screenshots/en/sensor-detail.webp)

<ol class="docs-shot-legend"><li><strong>Current value:</strong> green in range, red out of range</li><li><strong>Period:</strong> from 6 hours to 30 days</li><li><strong>Chart:</strong> the green band is the allowed range</li></ol>

![A sensor's alerts](/docs/ezdis/screenshots/en/sensor-settings.webp)

<ol class="docs-shot-legend"><li><strong>Minimum and maximum:</strong> the allowed range</li><li><strong>Alert after:</strong> minutes in a row out of range before alerting</li></ol>

- **Sensors** shows each sensor with its current value: green if in range, red if out of range and alerted, yellow if out of range or without data.
- The sensor page has the **chart** from 6 hours to 30 days, with the allowed range band, and the settings.
- Alerts are emailed to people who can see the sensors: when it goes out of range, when it recovers and when it stops sending for longer than the minutes you choose (60 by default).

Readings are kept for **90 days** (average, minimum and maximum of each minute).

> {info} This is a monitoring tool. Records required by health authorities depend on each location.

### WhatsApp alerts

Besides email, the same alerts (out of range, back in range, stopped sending data) can arrive by WhatsApp on up to 3 numbers. Enter them in **Sensors → WhatsApp alerts**, comma-separated, and tap **Save**. Each message counts toward your monthly usage. If the screen says it is not available yet, WhatsApp is reviewing the alert message: you can save the numbers now and alerts start as soon as it is approved.

## Power use

Measures the power use in watts of one appliance or the whole shop, and warns you if it goes out of range. For example, to know whether a freezer stopped working: if it uses less than 20 W for more than 30 minutes, the power or its breaker is off.

1. In **Sensors**, tap **Add sensor** and choose **Power use (W)**.
2. Enter the allowed **minimum** and **maximum** in watts, and how many minutes to wait before warning.
3. Set up the device with the details the app gives you (as in step 2):
   - **Shelly with metering** (Plus Plug S, Plus 1PM, PM Mini Gen3, Pro 3EM): **Settings › MQTT**, with the server, username, password and topic. Keep **RPC status notifications over MQTT** on. On the Pro 3EM the total of the three phases is used.
   - **Sonoff POW with Tasmota**: the same console line as in step 2. Power use is sent on its own, every minute.
   - **ESP32 with ESPHome and a PZEM-004T**: the YAML the app shows already includes the meter. The sensor must be named `consumo`.

> {info} A Shelly only sends power when it changes. If it does not change, we still know the device is connected.

## Doors and gates

A magnetic sensor (reed switch) on the door tells you whether it is open or closed, and warns you if it stays open longer than the minutes you choose. For example, a cold-room door or the warehouse gate.

1. In **Sensors**, tap **Add sensor**, choose **Door or gate** and enter how many minutes it may stay open.
2. Wire the sensor and set up the device:
   - **Shelly Plus Uni**: the sensor goes between **IN1** and **GND** (a dry-contact input, no mains voltage). MQTT as in step 2, with **RPC status notifications over MQTT** on.
   - **Tasmota**: set the sensor pin as **Switch1** and paste the line from the app, which already includes `SwitchMode1 16`.
   - **ESP32 with ESPHome**: the sensor goes between **GPIO4** and **GND**. The YAML from the app includes the door and a WiFi signal every minute.
3. **Test it:** open the door and check that the app says **Open**. If it says **Closed**, turn on **Invert** in the sensor page.

We email you (and send a WhatsApp, if you set it up) when it is left open too long, and again when it closes.

> {info} A door only sends when it opens or closes. That is why the “stopped sending” alert starts off: turn it on in the sensor page if your device sends a periodic signal (ESPHome and Tasmota do, with the setup from the app).

## WiFi plugs and relays

Besides measuring, you can **turn on and off** a WiFi plug or relay running **Tasmota** or **Shelly** (Plus or Pro) firmware: a backup cooling unit, a light, a sign.

1. In **Sensors**, tap **Add** and choose **Plug or relay**, with its firmware (Tasmota or Shelly). The app gives you its user and password.
2. Set it up like a sensor: in Tasmota, paste the `Backlog` command the app shows into the console (it keeps the topic under `s/<user>/…`); in Shelly, under **MQTT**, enter the server, user, password and the **prefix** the app shows, and turn on **Generic status update over MQTT**.
3. It shows up in the list with its state (**On**, **Off** or **No state yet**) and a button to turn it on or off. The command reaches the device in a few seconds, and the state changes when the device confirms it.

**Automation:** on the relay’s page, under **Automation**, pick a sensor and what to do when it goes out of range (**Turn on** or **Turn off**). When the sensor is back in range, it does the opposite. For example: if the cold room goes above −18 °C, turn on the backup unit.

Which sensors work, the server and its ports, on one page: [Free MQTT broker](https://www.ezdis.net/en/free-mqtt-broker).
