So following the thread I tried the 2 methods ( optocoupler and mosfet) that could acheive the result wanted. But both does no seem to work. Here’s the wiring i’ve tried. For the mosfet version the onboard LED does not light up (tried 2 boards) could be DOA’s so i ordered others just in case (if it happen to be the parts used i’ll update the post)
UPDATE:
1- The octocoupler i had in my possession were DOA
2- There’s no 2 method, the octocoupler is on the Esp32 side and the Mosfet is on the Fan controller box !
Does your fan have the molex connector or the newer style? Sounds like on the op linked forum some internal stuff to the fan changed perhaps.
Have one on order so it will be the newer style.
A friend of mine who knows far more about electrical engineering than I do kept trying to dissuade me from using any of the earlier proposed options because the fan risks leaking full line voltage over a shared ground connection. He was in the process of designing something to better isolate everything when he realized that the Shelly RGBW2 does all of this and doesn’t require any special setup besides some ESPHome config.
I then took things a bit overboard because the Shelly provides additional PWM connections for some LEDs.
If you’re interested, you can find instructions and 3 versions of ESPHome config here:
The basic version just needs a molex connection and 3 wires going to the Shelly (DC, GND, and W).
The other two include support for a pushbutton so you can still control the fan manually, and different combinations of 3 LEDs.
I also have 3D printed enclosures for all 3 versions.