Shelly 1 & ESPHome - Bathroom Fan Control

Hi All,

I’ve hooked up a Shelly 1 to my bathroom extractor fan - previously it ran whenever the bathroom lights were on, which seemed unnecessary, so now I have a humidity sensor in there and use HA to turn it on when needed.
I had hoped to make use of the switched live signal that came from the light switch (previously going to the fan to turn it on with the lights) as a signal to the Shelly, so that I could also identify if the bathroom lights were on or off - this part however does not seem to be functioning… and I can’t work out why!

The circuit in use:

I should note the ‘3 pole switch’ before the fan/shelly is just an isolator switch - so assume that isn’t even there for this purpose :slight_smile:

I was hoping that the SW port of the Shelly could be used to detect 240v live when the light gets turned on, but this doesn’t appear to be the case - I get no output at all from the Shelly when the light it toggled. (Manual relay control of the fan works fine though)

My code (simplified to just toggle the fan on/off with the light switch signal):

# Device Specific Config
  - platform: gpio
    pin: GPIO4
    name: "Ensuite Extractor Fan"
    restore_mode: ALWAYS_OFF
    id: shelly_relay
  - platform: gpio
    internal: true
      number: GPIO5
    # small delay to prevent debouncing
      - delayed_on_off: 50ms
    # config for state change of input button
          - switch.toggle: shelly_relay
    id: button

Can anyone see any reason why this setup wouldn’t work ?

Thinking of doing something similar - did you find out why this didn’t work?

Hey, unfortunately not - I ended up disconnecting the SW wire since I noticed that the lights gave a dim glow even when the switch was off at the wall… so clearly something wasn’t right and I didn’t want to burn the place down :stuck_out_tongue:

1 Like

I am also planning something like this…

I think you have to use a shelly 2.5 or two Shelly 1’s. You need two separate toggled outputs. Because the Shelly has to be installed after the switch. It seems that you put the shelly in between the light and the fan in your wiring.