Independent external fan (to lower Raspberry Pi / Home Assistant system temperature) - maybe ESPHome?

I have among few others two Pi 4, both running in a FLIRC case so with passive cooling:

  • one is running a full Raspberry Pi OS and can therefore run scripts and stuff
  • the other is running Home Assistant OS

For the first one I have an external USB fan (like this) attached to a separate USB hub. Depending on the current system temperature I regulate the fan with a script (simply turns the USB port and therefore the fan on or off). This solution works perfectly for I think more than two years by only gives some extra cooling when really needed. :white_check_mark:

For this “USB powered, USB hub attached fan control” I need

  • USB hub
  • external USB fan
  • controlling logic (on the system to be cooled): script and uhubctl to switch USB ports on and off

Now I’m thinking of implementing the very same solution for the Home Assistant Pi 4.

At least that would be my #2 favorite solution, open questions:

  1. :question: How to install (and keep permanently) uhubctl when running Home Assistant OS?
  2. :question: How to permanently (start at host OS boot) run a shell/bash script when running Home Assistant OS?

Of course those are mainly HA OS questions. As this is the hardware section, here’s my #1 favorite solution: Have a complete separate system maybe consisting at least of

  • a (USB or otherwise powered/connected) fan
  • a network interface to interact with the device, e. g. via WiFi

As I’m completely not :x: in the electronics business (soldering and stuff - also not into the ESP game (yet)), I was wondering if you guys know a solution for such a “WiFi accessable fan device”. Pretty much “plug and play” if possible.

In the end this device should only offer a switch to turn the fan on and off to Home Assistant. The logic (script / fan control) shall be implemented within an automation directly in HA (as the current system temperature is only known by HA and I think it makes no sense to push that temperature to the fan device which then does the fan on/off logic). The logic part is no problem for me.

So to sum all this up:
:question: What’s the best way to get/build such a “WiFi accessable fan device” (for someone with no expertise in electronics)?

  • What hardware is needed?
  • What programming/software (ESPHome addon?) is needed?

If I could buy something like that (fan controlled by a ESPHome or similar) “ready to use” that would be just perfect… if someone is capable of building such a device I would also be interested.

Does uhubctl install via

apk add uhubctl

I have a Sonoff USB “switch” - I use it with my RPI4 to turn on some non-smart LED lighting that is near it. Works perfectly.

All you would need to do is make an automation that reacts to the RPI4 CPU temp :slight_smile: Easy.

1 Like

I use the Sonoff integration. Had zero issues with it for the 12 months it’s been working.

Mine is set for LOCAL control - no cloud needed.

I guess it’s all about plug and play or play and hope :slight_smile:

1 Like

Thank you guys, you are awesome!

The Sinilink definitely looks very interesting. „Only“ issue (and that’s a big one for me) is the need for the initial flashing which needs the connecting of a serial programming interface. That’s neither equipment nor experience I have. Looking at how „difficult“ it is even for pro‘s (like that Swiss expert in the YT video) I tend to say: great device, I would instantly get it - but only if pre-flashed already.

Therefore the Sonoff USB Micro Mini seems to be my current way to go. This device seems to suite my „plug and play“ approach a lot better. Anyway, few questions are open:

  1. I read bout connection issues once the WiFi is gone (repeater/router restart etc.) which does not sound very promising. Can you confirm those @Neil_Brownlee ?

  2. I don’t use Sonoff hardware yet so never integrated one in HA. (How) Can it be used 100 % locally without any cloud dependency?

What I did not think about yet is: I could also use such device with a ZigBee interface. That would probably be even better in terms of interference (I would need to connect the Sonoff USB device by an USB extension cable anyway). I searched for such „ZigBee powered USB switches“ but couldn’t find one unfortunately…

HI,

No issues at all with router restarts etc. I have a Unifi system and it updates the AP’s overnight and I’ve never ever had an issue with the USB socket not connecting.

Have a look at the integration documents - it’s pretty easy and requires no messing about.

Sounds good. But do I need an account as stated in the installation section?

You can setup multiple integrations with different ewelink accounts.

Important. If you use the same account in different smart home systems, you will be constantly unlogged from everywhere.

Nice integration though. Even allows to convert switches to fans… exactly what I‘m looking for.

I have an an account as I needed one to do the initial pair to my network.

So I can’t use Sonoff devices (with Home Assistant) without creating an ewelink account?

That’s the moment I realize there‘s an even smarter solution, which only requires a power socket:

  • smart plug (any ZigBee or a Shelly Plug S etc.)
  • USB plug (regular charging adapter) plugged into that
  • fan into USB plug - done

It’s so basic I even didn’t think about it. And I already use exactly that e. g. for my wall panel tablet (scheduled battery charging).

I‘ll probably go that way.

  • No new hardware needed.
  • No account needed.
  • No additional integration needed.
  • No flashing needed.
  • Less complexity.
  • Only a power socket required.
1 Like