Skip to content

Home Assistant integrated WiFi Power Strip for your HomeLAB

One of the things the lazy side of me hates, is physically having to go to my HomeLAB to hard reset any device.  While this has been happening less and less, it’s still something I dread.  My solution to the problem is to make a poor man’s rack PDU that’s integrated into Home Assistant. This how-to will outline how you can do the same for less than $7 per controlled socket using ESPHome firmware.

Hardware

I have used a Teckin and Tunbox (white or black), but there are many manufacturers that seem to brand label the same physical product.  The key is that the description needs to mention the “Smart Life” app as that means it’s using the Tuya WiFi module.

Teckin WiFi Power Strip

Firmware

The overall process is to flash this unit with custom firmware that tightly integrated to Home Assistant.  To get the unit converted from the original firmware, I used Tuya Convert combined with ESPHome to get this accomplished.  If you are not familiar with these, digiblurDIY and DrZzs both have extensive videos on how to get started with these.  I will cover the detailed configuration for these power strips.

The configuration I’ve set up for this device is focused on keeping the power on, as typically you do not want to shut it off accidentally. So, the physical button on the unit only toggles the USB power and all power sockets default to being ON when it’s plugged in or power is restored.  The only way to control the power sockets is through the device’s webpage or Home Assistant.

Follow the guides linked above to flash your power strip via the tuya convert method.  Then create a new device in ESPHome and load the YAML below to this device.

Home Assistant UI (Lovelace)

At first, I did not want to display these in my lovelace UI because I was worried about fat fingering something by accident.  Then, I discovered the Toggle Lock Entity Row plugin developed by Thomas Loven.  The easiest method for installing this is to utilize HACS (Home Assistant Community Store) – if you don’t have it, get it…now.  This plugin prevents accidental switching by requiring a secondary click within 5 seconds in order to turn off the device.

In my instance, I have chosen to name the entities generically via the firmware and add the label in lovelace.

 

Concerns

One of the concerns I initially had with this setup was the relays.  Since these are going to be on 99.9% of their life, the coil will be energized all of that time.  I couldn’t find a coil life listed anywhere from the manufacturer of the Y3F-SS-105DM.  After some googling, it appears for DC coils, this is a somewhat negligible concern as they will run very cool.  My power strip has been on since April 2018 without issues.

 

If you’ve got any questions, feel free to ping me below.

Published inESPHomeHome AssistantHome AutomationHomeLAB