When a friend paid $13K last year to have a 24kW Generac whole house standby generator installed, I was jealous. I had, and still have a Predator 8750/7000W inverter generator. I paid just under $1,00 for this as mine had a damaged packing box. This was connected to my house via a 50A outdoor receptacle and then into my load center via an interlock plate and 2 x 50A breakers. This worked well but my wife could never seem to master it. I resolved to try and improve things without breaking the bank. It has cost me just under $4K including the inverter generator and it works fine. I can run anything I want but not everything at once.
What I wanted was a fully automatic changeover system to generator from utility power in the event of utility failure. I also wished to have it return to utility power and stop the generator when utility power was restored. Obviously it had to be connected to HA but, I wanted it to work anyway even if HA was down. I now have this and here are all the schematics, yaml and Lovelace files to make it work. Please note that this was designed by me, for me, at my home, with my generator. I do not know if this will work with any other generator. I suspect some could possibly be modified but I have no idea how to do that so, please do not ask.
I had a licensed and bonded electrician install the Automatic Transfer Switch and he pulled a permit from the city. It has now been inspected and has passed that.
THIS PROJECT REQUIES REWIRING THE MAIN POWER FEED(s) FROM YOUR ELECTRICITY COMPANY TO YOUR HOUSE. DO NOT, REPEAT DO NOT ATTEMPT THIS WORK UNLESS YOU ARE TRAINED AND ARE COMPETENT IN THIS WORK. IT CAN BE DANGEROUS AND COULD KILL YOU. I ACCEPT ABSOLUTELY NO RESPONSIBILITY FOR ANY USE OF THIS PROJECT AND I POST IT HERE SIMPLY FOR YOUR INTEREST.
I used:
- USB C 30pins CP2102 ESP-WROOM-32 ESP32
- 8-Channel I2C IIC Relay Board XL9535, USB-C
- NOCO GENIUS2X2: 4A 2-Bank Smart Battery Charger (2A/Bank)
- JQX-13FL AC 220V Coil 8 Pin 10A DPDT LED Indicator Electromagnetic Power Relay, with Base, with DIN Rail Slotted Aluminum
- JQX-13FL DC 12V Coil 8 Pin 10A DPDT LED Indicator Electromagnetic Power Relay, with Base, with DIN Rail Slotted Aluminum
- 12V 5A 60W Power Supply Adapter Regulated Switching Transformer AC110V to DC 12V 5amp Power Converter
- Outdoor Electrical Box 16 x 12 x 6''D NEMA 4X Enclosure Steel Box, Waterproof & Dustproof Outdoor/Indoor Lockable Electrical Junction Box, with Mounting Plate
- 200 Amp Automatic Transfer Switch w/Power Management for Generac RXSW200A3
- DC 3-5V MAX6675 Module +K Type Thermocouple Temperature Sensor with Cable Cord
- INA226 IIC I2C Bi-Directional Current Monitoring Sensor Power Monitor Sensor Module
- LM2596 DC to DC Buck Converter 3.0-40V to 1.5-35V DIY Power Supply Step Down Module Adjustable Voltage Regulator
- A number of plugs, components, connectors and lengths of multi-core cable and bits of wire.
I had the initial idea and worked out the schematic. I wrote the initial yaml and it grew considerably in complexity during development. Claude (claude.ai) by Anthropic was an invaluable coding partner throughout, handling the more complex ESPHome automation logic while I designed and tested the hardware.
The heart of this system is the Automatic Transfer Switch (ATS). Mine is a two phase 200 Amp device that seems to have been originally made to work with a Generac generator. These are retailed for about $1,200. I bought mine on eBay for just under $500 shipped. It is a two-pole, two-way relay (DPDT). A grown up 8 contact relay. Under normal power conditions it takes the incoming utility power feeds coming from the meter and passes them to the house load center (breaker box). It also supplies the Generac generator with various feeds. For it to switch to generator power, the utility power needs to fail, the generator needs to be supplying 2 x 120VAC, 12VDC needs to be supplied to the ATS and lastly a quick pulse of about half a second needs to be applied between tag 23 and GND. At that point, it will switch to generator power which is passed to the house.
Return to utility power is automatic and instant upon power being present. The generator now needs to be shut down.
The system has a number of features:
- Automatic detection of utility power failure and generator startup.
- Automatic shutdown of generator upon utility power restoration.
- Umbilical cable connection status between HA and generator
- Session and total generator runtime stats.
- Hours remaining until next generator service.
- Automatic shutdown (optional) of generator at predetermined times with bypass.
- Settable (optional) Quiet Hours when the generator will not start.
- Overload shutdown after 20 seconds per phase (3,500 Watts + 5%).
- Inrush current overload shutdown protection at 4375 Watts per phase.
- Weekly or daily settable test schedule.
- Generator functions (Start, Stop, Choke, etc.) in HA as switches.
- Internal battery (9Ah SLA) to cover periods of no power to ESP32.
- Two battery charges. One for the SLA battery in the controller. The other for the LiFePO4 battery on the generator. This is disconnected when the generator starts.
- Optional generator battery charge current monitor via INA226
- Optional external temperature monitor via MAX6675
This post is getting huge. Too long. I’ll stop now and try to answer questions as they come.
So here are the files and drawings which are in the next post due to size limitations.
Here is a link to Google Drive that has all the files.
https://drive.google.com/drive/folders/1QjLLpkDmho2loheWRxG_znKDYQaVos72?usp=drive_link




