How it works
The Shelly 2PM Gen4 has two channels, and each one switches its own circuit. The bathroom light goes on the first and the exhaust fan on the second, and your existing wall switches keep working through the relay's two switch inputs.
Because one relay runs both, it knows when the light goes off. A scene in the Shelly app starts the fan at that moment, and an auto-off timer on the fan channel stops it after the time you choose. Fifteen minutes is a good place to start.
The Shelly 2PM Gen4 has two channels: the bathroom light goes on the first and the exhaust fan on the second, and your wall switches keep working through its two inputs. Home Assistant adds both channels through its Shelly integration.
An automation watches the light. When it turns off, the fan turns on, runs for 15 minutes, then turns off.
-
01
Your wall switches
Work as they do now. The relay sees the light go off.
-
02
Shelly relay
Starts the fan when the light goes off, then stops it on a timer.
-
03
Your exhaust fan
Clears the steam, then shuts itself down.
What it looks like on your phone
-
Timer. Auto off stops the fan 15 minutes after it starts.
-
The run-on scene. When the light turns off, the fan turns on.
-
Running. The countdown shows how long the fan has left.
-
Fan run-on. When the light goes off, the fan runs for 15 minutes, then stops.
Step by step
How you'll set it up
Add the device to Wi-Fi from your phone, or straight from a browser.
You can set up the Shelly relay on its own built-in web interface: once it's on your Wi-Fi, type its IP address into a browser on the same network, or before that, join the Shelly's own hotspot and open `192.168.33.1`. The run-on scene in step 4, and the optional humidity scene, only run in the Shelly app, so you'll need the app for those either way.
-
Fit the Shelly behind the switches
The relay goes behind the wall plate with the light and fan switches. The light connects to O1, the fan to O2, and the two switches to S1 and S2, so they work as they did before.
Wire map 2PM Gen4- Active, to both L L
- Neutral N
- Light O1
- Exhaust fan O2
- Light switch S1
- Fan switch S2
Wire map 2PM Gen3- Active, to both L L
- Neutral N
- Light O1
- Exhaust fan O2
- Light switch S1
- Fan switch S2
Circuit overview1Light2Exhaust fan3Light switch4Fan switchActive (supply)Neutral / 0 VSwitched loadSwitch signal / dry contactIn Australia, fixed 230 V wiring is licensed-electrician work. Use these diagrams to plan the job and brief your electrician.
Showing the whole circuitCircuit overview1Light2Exhaust fan3Light switch4Fan switchActive (supply)Neutral / 0 VSwitched loadSwitch signal / dry contactIn Australia, fixed 230 V wiring is licensed-electrician work. Use these diagrams to plan the job and brief your electrician.
Showing the whole circuitThere's no wiring diagram for the here yet. Its installation guide has the manufacturer's wiring diagram. Wire it from the diagram in its manual.
-
Add it to the Shelly app and name the channels
Add the relay in the Shelly app, then name the two channels Bathroom light and Bathroom fan, tapping Save after each, so the scene in step 4 is easy to read.
-
Give the fan an auto-off timer
Open Bathroom fan and go to Timer. Tick Auto off, set it to 00:15:00 and tap Save. The fan now switches itself off 15 minutes after it comes on, however it was turned on. In the web interface, open Bathroom fan, choose Timers under Automations, enter 900 in Auto OFF and click Save.
-
Start the fan when the light goes off
In the Shelly app, open the room's Scenes and add a scene. For When, choose Device based, then Bathroom light, Output State and Turn off, and watch it as a Trigger. For Do, choose Device action, Bathroom fan and turn on. Name it Fan run-on and save it.
-
Check the scene
Fan run-on now shows When Bathroom light turns off, as a trigger, and Do Bathroom fan on. The fan starts as you leave, runs for its 15 minutes and stops.
-
Add it to your home app over Matter
Matter is on by default on the Gen4, so scan the QR code on the device label with Apple Home, Google Home or SmartThings.
-
Fit the Shelly behind the switches
The relay goes behind the wall plate with the light and fan switches. The light connects to O1, the fan to O2, and the two switches to S1 and S2, so they work as they did before.
Wire map 2PM Gen4- Active, to both L L
- Neutral N
- Light O1
- Exhaust fan O2
- Light switch S1
- Fan switch S2
Wire map 2PM Gen3- Active, to both L L
- Neutral N
- Light O1
- Exhaust fan O2
- Light switch S1
- Fan switch S2
Circuit overview1Light2Exhaust fan3Light switch4Fan switchActive (supply)Neutral / 0 VSwitched loadSwitch signal / dry contactIn Australia, fixed 230 V wiring is licensed-electrician work. Use these diagrams to plan the job and brief your electrician.
Showing the whole circuitCircuit overview1Light2Exhaust fan3Light switch4Fan switchActive (supply)Neutral / 0 VSwitched loadSwitch signal / dry contactIn Australia, fixed 230 V wiring is licensed-electrician work. Use these diagrams to plan the job and brief your electrician.
Showing the whole circuitThere's no wiring diagram for the here yet. Its installation guide has the manufacturer's wiring diagram. Wire it from the diagram in its manual.
-
Add it to Home Assistant
In Home Assistant, go to Settings, then Devices & services, select Add integration and choose Shelly. Enter the relay's IP address, which your router lists, and select Submit. Home Assistant talks to the relay directly over your home network. Name the two channels Bathroom light and Bathroom fan.
-
Start the fan when the light goes off
Go to Settings, then Automations & scenes, and select Create automation. Select Add trigger, search for State and pick it. Choose Bathroom light, set From to On and To to Off. Then add three actions: turn on Bathroom fan, a Delay of 15:00, and turn off Bathroom fan. Check them, select Save and name it Fan run-on.
-
Check it's there
Automations & scenes now lists Fan run-on. It's on as soon as you save it, so the next time you turn the light off, the fan runs for 15 minutes and stops.
Optional: run it on humidity
The run-on scene only starts the fan when the light goes off. A Shelly BLU H&T on the bathroom wall measures the humidity, so the fan also starts when the room fills with steam, whether the light is on or not.
-
Add the sensor in the Shelly app
Tap the plus sign, choose Add via Bluetooth and pick the BLU H&T. When the app asks, press the sensor's button once. Put it in the same room as the fan and tick the Shelly 2PM Gen4 as its Bluetooth gateway. The relay passes the sensor's readings on, so you don't need a separate hub.
-
Fit it in the bathroom
Fix the sensor to a flat wall in the bathroom, out of the shower's direct spray.
-
Start the fan when it gets steamy
Add a second scene with the sensor's humidity as the trigger, set to above 70 per cent, and Bathroom fan turn on as the action. The fan's 15-minute auto-off still stops it, so it clears the steam without running all day.
Frequently asked questions
Should I use the Shelly app or Home Assistant?
If you don't run Home Assistant, use the Shelly app: it needs no hub, and the fan's timer is stored on the relay. If Home Assistant already runs your home, put the fan there, so it sits alongside your other automations.
Do I need an electrician?
Yes. The light and fan run from 240 V mains, and connecting anything to fixed wiring is licensed electrical work in Australia.
Will my wall switches still work?
Yes. They connect to the relay's switch inputs, so the light switch still runs the light and the fan switch still runs the fan.
Will it work with my existing fan?
If the fan has its own switch, yes. Each channel switches up to 10 A. Shelly lists fans as inductive loads that need an RC snubber, so ask your electrician to fit one with the relay.
Can I make the fan run longer?
Change the auto-off time in the Shelly app. The fan switch still turns the fan on whenever you like, and it stops after the same time.
What happens if the internet drops out?
The wall switches and the fan's auto-off timer run on the relay itself, so they keep working. The run-on scene runs in Shelly's cloud, so it won't start the fan until the connection is back.
Can it turn the fan on when the room gets steamy?
Yes, with a Shelly BLU H&T on the bathroom wall. The relay can't measure humidity itself, but it is a Bluetooth gateway for Shelly BLU sensors, so a scene can start the fan when the reading climbs.
Does it still run if Home Assistant is off?
No. The run-on is an automation in Home Assistant, so the fan won't start by itself while Home Assistant is down. The wall switches still work: they're wired to the relay.
Still need a hand?
We answer most messages within one business day. If your question is about an existing order, have your order number ready. It speeds things up.
Contact usThe kit
Choose your relay
Each of these does the job. The steps on this page are written for the recommended one.