Door sensor with Shelly Plus Uni + reed switch, free over MQTT

Know from your phone whether the cold-room door or the warehouse gate was left open, with an email alert. Free on EzGYM.

The Shelly Plus Uni + reed switch reads a magnetic sensor (reed switch) on the door and publishes over MQTT when it opens and closes. EzGYM gives you the server for free, with a username and password for each device.

You set how many minutes it can stay open: if the cold-room door is still open after 5 minutes, we email you, and again when it closes.

Depending on how the sensor is wired, the device may report “on” with the door closed. The sensor page has an “Invert” switch so it says Open and Closed correctly.

How to set it up

  1. 1 Create your free EzGYM account, go to Sensors and add a “Door or gate” with the minutes it may stay open.
  2. 2 Write down the server, username, password and topic the app gives you.
  3. 3 Wire the magnetic sensor between IN1 and GND of the Shelly Plus Uni (a dry-contact input, no mains voltage).
  4. 4 Enable Settings › MQTT: in Server enter devices.ezdis.net:1883; in Username and Password, the sensor ones; in MQTT prefix, the topic; Connection type: no TLS. Keep “RPC status notifications over MQTT” on.
  5. 5 Open the door and check that EzGYM says Open; if it says Closed, turn on Invert in the sensor page.

Frequently asked questions

Which door sensor do I use?

Any two-wire magnetic sensor (reed switch), like the ones used in alarms. It goes between an input of the device and GND.

Which username and password do I enter in the Shelly Plus Uni + reed switch?

The sensor ones, not your account ones: when you add the door in Sensors, EzGYM shows its username (it starts with “sn”) and its password. The password is shown only once.

Does it warn me if the device disconnects?

Yes, if you turn it on in the sensor page. It works well with ESPHome and Tasmota from this guide, because they send a signal every minute even if the door does not move.

How much does it cost?

Nothing: the broker and the email alerts are free, up to 30 sensors per account.

More guides

Create a free account