How it works
The Shelly 1 Gen4 switches the fan, and the Shelly Plus Add-on clips onto it and reads a DS18B20 temperature probe. The relay stays below the ceiling, behind the fan's wall switch, and only the probe's 3 m lead runs up into the roof space.
Two actions on the relay do the switching. Every minute it reads the probe: above 35 °C it turns the fan on, and below 30 °C it turns it off. The 5 °C gap stops the fan from flicking on and off around one temperature. Both actions run on the relay itself, so the fan keeps working if the internet drops out.
The Shelly 1 Gen4 switches the fan, and the Shelly Plus Add-on clips onto it and reads a DS18B20 temperature probe hung in the roof space. Home Assistant adds the relay through its Shelly integration and sees the probe as a temperature sensor.
Two automations do the switching: above 35 °C the fan turns on, and below 30 °C it turns off. You can graph the roof temperature in Home Assistant, or use it in your other automations.
-
01
The probe
Hangs in the roof space and reads the air temperature every minute.
-
02
Shelly relay
Turns the fan on above 35 °C and off below 30 °C.
-
03
Your roof-space fan
Runs when the roof is hot, and stays off when it isn't.
What it looks like on your phone
-
Running. The roof space passed 35 °C, so the relay switched the fan on.
-
The two actions. On above 35 °C and off below 30 °C, both running on the relay itself.
-
Two automations. Fan on when hot and Fan off when cool keep the roof fan following the temperature.
Step by step
How you'll set it up
Add the device to Wi-Fi from your phone, or straight from a browser.
Every Shelly has its own built-in web interface, so there's nothing to install. Once it's on your Wi-Fi, type its IP address into a browser on the same network. Before it joins your Wi-Fi, connect your computer to the Shelly's own hotspot and open `192.168.33.1`.
-
Fit the Shelly below the ceiling
The relay goes behind the fan's wall switch, not in the roof space. Mains comes in on L and N, a short bridge feeds I, O runs to the fan, and the wall switch lands on SW, so it still turns the fan on and off.
Wire map 1 Gen4- Active (supply) L
- Neutral N
- Bridge from L I
- Exhaust fan O
- Wall switch SW
Wire map 1PM Gen4- Active (supply) L
- Neutral N
- Exhaust fan O
- Wall switch SW
Circuit overview1Exhaust fan2Wall 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 overview1Exhaust fan2Wall 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.
-
Clip the Add-on onto the relay
With the power off, line the Shelly Plus Add-on's pins up with the port on the relay and press it home until the brackets lock. Take care not to bend a pin: a bent pin stops the Add-on reading anything.
-
Wire the probe to the Add-on
On the probe, the red wire goes to VCC, yellow to DATA and black to GND, all on the Add-on's 1-Wire side.
Wire map Plus Add-on- Red (power) VCC
- Yellow (data) DATA
- Black (ground) GND
Circuit overviewRed: power (VCC)Yellow: data (DATA)Black: ground (GND)In 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.
-
Run the probe into the roof space
Feed the probe up through the top of the wall into the roof space. Let it hang in the open air, clear of the roof sheet and the insulation, so it reads the air the fan moves.
-
Add the Shelly in the app
Add the relay in the Shelly Smart Control app and name it Roof fan.
-
Turn on the Sensor Add-on
Open Add-on peripherals, expand Manage add-on feature, choose Sensor Add-on, then tap Save and reboot. In the web interface, open Add-on, choose Sensor Add-on and click Save and reboot.
-
Add the probe
Tap Add peripheral, choose Temperature (DS18B20), tick the probe it finds and tap Add peripheral. The Shelly reboots once more. Name the reading Roof space. In the web interface, click +, choose Temperature (DS18B20), tick the probe and click Add and reboot.
-
Turn the fan on when it's hot
In Add-on peripherals, open Actions and tap Add action. Choose Roof space, name the action Fan on when hot and leave Set active time off. For When, choose Temperature measurement, then More than and 35, and tap Next. Under Local Actions, tap Add local action, set the output to on and tap Save. In the web interface, open Actions, click Create action and pick Roof space. Set Event to Temperature measurement every 60s, add the condition New temperature in Celsius greater than 35, add an action to execute that sets Roof fan on, and click Save.
-
Turn it off when it cools
Add a second action the same way, named Fan off when cool, with Less than and 30 and the output set to off. In the web interface, the condition is New temperature in Celsius less than 30.
-
Check it's set
Add-on peripherals now shows Roof space with its reading, and Actions lists Fan on when hot, above 35 °C, and Fan off when cool, below 30 °C. The fan starts the next time the roof space passes 35 °C.
-
Fit the Shelly below the ceiling
The relay goes behind the fan's wall switch, not in the roof space. Mains comes in on L and N, a short bridge feeds I, O runs to the fan, and the wall switch lands on SW, so it still turns the fan on and off.
Wire map 1 Gen4- Active (supply) L
- Neutral N
- Bridge from L I
- Exhaust fan O
- Wall switch SW
Wire map 1PM Gen4- Active (supply) L
- Neutral N
- Exhaust fan O
- Wall switch SW
Circuit overview1Exhaust fan2Wall 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 overview1Exhaust fan2Wall 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.
-
Clip the Add-on onto the relay
With the power off, line the Shelly Plus Add-on's pins up with the port on the relay and press it home until the brackets lock. Take care not to bend a pin: a bent pin stops the Add-on reading anything.
-
Wire the probe to the Add-on
On the probe, the red wire goes to VCC, yellow to DATA and black to GND, all on the Add-on's 1-Wire side.
Wire map Plus Add-on- Red (power) VCC
- Yellow (data) DATA
- Black (ground) GND
Circuit overviewRed: power (VCC)Yellow: data (DATA)Black: ground (GND)In 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.
-
Run the probe into the roof space
Feed the probe up through the top of the wall into the roof space. Let it hang in the open air, clear of the roof sheet and the insulation, so it reads the air the fan moves.
-
Set up the probe in the Shelly app
The Add-on is set up on the Shelly itself, so add the relay in the Shelly Smart Control app first and name it Roof fan. Open Add-on peripherals, choose Sensor Add-on and tap Save and reboot. Then tap Add peripheral, choose Temperature (DS18B20), tick the probe and tap Add peripheral. Name the reading Roof space.
-
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 brings in the fan switch and the Roof space temperature.
-
Turn the fan on when it's hot
Go to Settings, then Automations & scenes, and select Create automation. Select Add trigger, choose Numeric state, pick Roof space temperature and set Above to 35. Add the action turn on Roof fan, select Save and name it Fan on when hot.
-
Turn it off when it cools
Create a second automation the same way, with Below set to 30 and the action turn off Roof fan. Select Save and name it Fan off when cool.
-
Check it's there
Automations & scenes now lists Fan on when hot and Fan off when cool. They're on as soon as you save them.
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 actions run on the relay. If Home Assistant already runs your home, put the fan there, so the roof temperature sits alongside your other automations.
Why can't the relay go in the roof space?
The Shelly 1 Gen4 and the Plus Add-on are rated to 40 °C, and a roof space gets well past that on a summer afternoon. That's why the probe comes on a 3 m lead: the relay stays below the ceiling and only the probe goes up.
Do I need an electrician?
Yes. The fan runs from 240 V mains, and connecting anything to fixed wiring is licensed electrical work in Australia.
Will it work with my existing fan?
If the fan runs from 240 V mains through a switch, yes. The relay switches up to 16 A. Shelly lists fans as inductive loads that need an RC snubber, so ask your electrician to fit one with the relay.
Can I use a Shelly Plus Uni instead?
It reads the same probe, but its outputs are limited to 30 V and 300 mA, so it can't switch a 240 V fan itself. You'd still need a relay for the fan, so the Shelly 1 Gen4 and Add-on is the simpler kit.
What temperatures should I use?
35 °C on and 30 °C off is a starting point. Change the two numbers to suit your roof, and keep a few degrees between them so the fan doesn't switch on and off around one temperature.
What happens if the internet drops out?
Nothing changes. The two actions run on the relay itself, so the fan still follows the roof temperature. You just can't check it from outside the house until the connection is back.
Why does the Shelly 1PM Gen4 help?
It measures the power the fan draws. Open it in the app on a hot day: if the fan is switched on but drawing nothing, it has stopped.
Does it still run if Home Assistant is off?
No. The two automations live in Home Assistant, so the fan won't follow the temperature while it's down. The wall switch still works, because it's 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 us