Connect a Shelly relay to open doors and lockers
7 min read
A Shelly relay lets Rentalbuddy open any door or locker that opens on an electric signal: an electric strike, a maglock or a solenoid lock. You wire the lock to a Shelly Pro relay, connect your Shelly Cloud account to Rentalbuddy, and add the relay to a location. From then on:
- your renter presses Unlock product on their unlock page, and the relay opens the door for a few seconds;
- you and your staff can open it from the admin with Open on the location's Locks tab.
There are no codes: the door opens remotely, through the Shelly Cloud, so the relay needs a working internet connection.
Shelly relay locks are by invitation. The Shelly relay locks card under Settings → Integrations and the Shelly relay choice in Add lock appear only for accounts Rentalbuddy has invited. If you don't see them, email info@rentalbuddy.io with your account name to be invited.
What you need
- A Shelly Pro relay, such as the Pro 1, Pro 2 or Pro 4PM, added to your account in the Shelly app and online.
- A lock that opens on power, wired to the relay (see Wiring the lock).
- A Self-service location. Staffed locations take no locks.
- Room in your plan's lock limit. Every relay that becomes a lock counts, like any other lock.
- Permission to change settings. Account owners and account members connect Shelly and add devices.
Connect your Shelly Cloud account
- In the Shelly app, open User settings → Authorization cloud key. It shows a server (for example
shelly-49-eu.shelly.cloud) and a key. The menus belong to Shelly and can change. - In Rentalbuddy, open Settings in the left menu, then the Integrations tab, and scroll to the Shelly relay locks card.
- Press Connect Shelly.
- Paste the Server and the Authorization cloud key, and press Save.
The server must be the Shelly Cloud address exactly as the app shows it. Something else is refused with "Enter the server as it appears in the Shelly app, for example shelly-49-eu.shelly.cloud."
Saving doesn't contact Shelly yet. The card shows Not checked yet with "The key is checked when you add your first Shelly device." After that, the card shows:
- Connected: Shelly accepted the key.
- Key refused: Shelly no longer accepts the key. Make a new one in the Shelly app, press Edit connection and paste it.
Edit connection changes the server or the key. Leave the key field empty to keep the saved key. Rentalbuddy never shows a saved key again, not even to you.
Add a Shelly device
- In the Shelly app, find the device's ID under the device → Settings → Device information. It has 12 characters, digits and the letters a–f, for example
a8032ab12345. - Open Locations, open the location and choose the Locks tab.
- Press Add lock, choose Shelly relay and press Continue. If Shelly isn't connected yet, the dialog takes you to Connect Shelly instead.
- Enter the Device ID and a Device name, check the Open time (seconds), and press Add Shelly device.
Rentalbuddy asks the Shelly Cloud about the device before it adds it, so the device must be online and on the Shelly account you connected. The first device you add also checks your key.
How many locks you get depends on the model:
- A model with one relay (such as the Pro 1) becomes one lock, named after the device.
- A model with several relays (such as the Pro 2 or Pro 4PM) becomes one lock per relay, numbered after the device: Gate 1, Gate 2 and so on.
The first device makes a new Shelly station on the location, named after the device. A station can hold several devices: press Add Shelly device on the station's table to add the next one to the same station.
Open time (seconds) is how long the relay stays on each time the lock is opened: a whole number from 1 to 30, 3 by default. The relay switches itself off again afterwards.
The new locks are switched on but have no product yet. Pick each lock's Product on the Locks tab, as with any other lock, before renters can book it.
When adding fails
- "Shelly Cloud reports the device as offline. Check its power and Wi-Fi, then try again." An offline device can't be added.
- "The connected Shelly account has no device with this ID. Check the ID, and that the device is added to that account in the Shelly app."
- "This Shelly device is already registered in Rentalbuddy, on this account or another one." A device can only be added once.
- "Shelly refused the authorization cloud key. Update it under Settings → Integrations." Press Edit connection under Settings → Integrations and paste a new key.
- "This Shelly device has no relay, so it can't open a lock."
- "Shelly Cloud didn't answer. Try again in a moment." The connection card keeps the status it had.
The Shelly devices table
Each Shelly station on the Locks tab shows its devices with Device name, Device ID, Model, how many Locks each became, and a Status:
- Online or Offline, as the Shelly Cloud reports it;
- No signal: Shelly Cloud didn't answer, so the device's state is unknown.
Below it, the station's locks are listed like other locks, with the Product, the active switch and Open / Open all. Rentalbuddy checks Shelly stations every hour, like other connected lock units, and warns you with Lock units offline when one stops reporting while its locks can be booked.
Remove a device, a station or the connection
- A device: press Remove device on its row. "Its 1 lock is removed with it. The relay itself is not changed." (or its locks, for a multi-relay device). This is refused while a lock on the device has upcoming bookings: "A lock on this device still has 1 upcoming booking. Move or cancel it first."
- A station: in the station's menu, choose Remove unit: "Remove {{name}} and all its locks? This cannot be undone." It removes the station with all its devices and locks. The relays themselves are not changed, and the devices can be added again later. It is refused while its locks have active or upcoming bookings.
- The connection: press Remove connection on the Shelly relay locks card. "The saved key is deleted. Shelly devices can't be added until you connect again." While devices are still added, it says "Remove the Shelly devices from your stations first."
If your invitation is withdrawn, locks already set up keep opening for renters and staff.
Wiring the lock
Rentalbuddy opens a lock by switching the relay on for the open time. Relay on means unlocked. Wire the lock so that holds:
- A fail-secure electric strike (locked without power) goes on the relay's NO (normally open) contact: the relay closes, the strike gets power and unlocks.
- A maglock (locked while powered) gets its power through the relay's NC (normally closed) contact: the relay opens, the power is cut and the door releases.
Not every model has an NC contact, so check the wiring diagram in the relay's manual. Have an electrician do the wiring, and follow the lock maker's instructions for the power supply.
Recommended device settings
These are recommendations. They haven't been confirmed on every model yet, so test the door after setting them.
- Auto off as a safety net. Rentalbuddy already tells the relay to switch off after the open time, but switching on auto off (
auto_off) in the device's settings, with a delay a little longer than your open time, makes sure the door can't stay unlocked if something goes wrong. - Power-on state: off (
initial_state: off). After a power cut the relay starts off, so the door stays locked. - Ethernet on Pro models that have a LAN port. A cable is steadier than Wi-Fi, and the relay only opens the door while it is connected.
What the renter sees
A booking on a Shelly lock has no code. The renter opens their unlock page from the booking and, once access starts, presses Unlock product. The relay opens the door for the open time.
If the Shelly Cloud or the device can't be reached, the door stays locked: the open fails rather than being reported as done. Check the device's Status on the Locks tab, and make sure renters know how to reach you.
Common questions
Where do I find the authorization cloud key? In the Shelly app under User settings → Authorization cloud key, together with the server. See Connect your Shelly Cloud account.
Why does the connection say Not checked yet? The key is only checked when you add your first Shelly device. Add one, and the card turns Connected or Key refused.
My Shelly Pro 2 became two locks. Is that right? Yes. A model with several relays becomes one lock per relay, so each relay can open its own door or locker.
Why can't I add my Shelly device? It must be online, on the Shelly account you connected, and not already added in Rentalbuddy. The message in the dialog says which; see When adding fails.
How long does the door stay open? For the Open time (seconds) set when you added the device: 1 to 30 seconds, 3 by default.
Should my electric strike go on NO or NC? A fail-secure electric strike goes on NO; a maglock's power goes through NC. See Wiring the lock.
I don't see Shelly under Settings → Integrations. Shelly relay locks are by invitation. Email info@rentalbuddy.io with your account name to be invited.
Related guides
Add and manage your locks on the Locks tab (add, sync, replace, move, switch off)
Everything about locks lives on each location's Locks tab: add a manual lock, sync Igloohome locks, give each lock a product, keep locks for staff at chosen times, switch a broken one off, replace it with a spare, move or delete it, read the red PIN code and offline warnings, and print its QR code.
Connect an ESPHome relay board to open doors and lockers
ESPHome relay locks are by invitation. Add an ESP32 or ESP8266 (such as a WEMOS D1 Mini) relay board running ESPHome to a location, copy the configuration and the secret line Rentalbuddy gives you into ESPHome, flash the board, and renters open the door with Unlock product on their unlock page. Covers requirements, a D1 Mini step by step, one lock per relay, the pulse length, wiring an electric strike or maglock, testing the relay, keeping the board secure, regenerating the token and troubleshooting.
GPS tracking: see where a rented boat, kayak or trailer is
GPS tracking is a beta for invited accounts. Connect Lonestar Tracking (FleetONE) or Mapon with an API key, attach each GPS tracker to a lock or to a product with 1 unit, and follow the item on a map on the booking. Covers the last known position, trails during a booking, who can set it up, the paid-subscription requirement, how often trackers report, and how trails are deleted after 30 days.
Harvia sauna heaters (beta): connect, start before bookings, and fix a cold sauna
Harvia heater control is in beta. Which control panel you need (Harvia Fenix with Wi-Fi), connect MyHarvia under Settings, link each heater to a lock, start the sauna before each booking with a one-time email button (the default) or, at your own risk, with Automatic start, read the heater check and warnings before a booking, and find out why a heater did not start.
