3D Printer Enclosure, Home Assistant and Fan Control

Hi,

I have a 3D Printer and build an enclosure for it. I also have sensor from the Printer and Enclosure in HASS. No i want to control my Fans I added to the enclosure from HASS. So I can hold the temp inside the enclosure on a set level.

Does anyone now about a fan control that has an API I can add to HASS to get and set Fan speed? Or if there is nothing like that has an idea how to build one? I have an Raspi with Octoprint running near the Printer so maybe that can be used?

My immediate thought is an ESP32 with a temperature sensor controlling a few relays to turn the fans on and off between a range of high/low temperatures. To be fair, an ESP8266 could do this as well, and the Wemos D1 Mini is extremely affordable.

I have a fan in my enclosure and used to use ESP32 running ESPHOME connected to MOSFET board to control a 12V PC fan.
Now I use the Sinilink XY-WFMS ESP8266 Board with MOSFET as it combines the ESP and the MOSFET

See here. If you have more than one fan, it’ll be better to use the ESP32 and multiple MOSFET boards:

1 Like

Can you link the hardware I would need? I have 2 pwm fans here. But not sure about the power supply for the esp8266 and the Fans.

That post I also found and also asked for hardware list/links :blush:

MOSFET boards, can work with up top 24V DC fans

The ESP32 can run on a USB supply and the fans can run on whatever they are running on now, you just connect the power supply and the fan to the MOSFET board

The image at the top of the thread shows the connections

Will this work as power supply for 2-3 fans on the mosfet board?

Depends on the fans, what are they ?

2 of this

They are only 1.44W / 0.12A each so a 1A supply would be fine

Then heres my solution: I dont remember which pin, but connect a GPIO of your pi to the speed setting pin of the fan and use pwm on the raspi to control it. To control the raspi a python script via mqtt would do the trick to let HA control the fans. SOmething like this could fullfill your needs: https://gist.github.com/SqyD/a927ab612df767a0cc892bcde23d025c maybe a bit modifiyng of the code is needed, but with this route you can save the esp.

@Holdestmade hey, so I got all part from AliExpress and build them together. So far it is working, I can switch the fan on and off from Home Assistant. But there is no difference in speed as far as I can see so I think the PWM does only switch on and of but not change the speed. Do you have any idea what I need to check?

Same here, think it has something to do with the new HA fan speed slider and ESPHOME has not updated to it yet ?

Good news! I’m building a smart enclosure for my Prusa MK4!