First some background on what I am doing: I have somewhat unreliable power and have put together a Diesel backup generator. This would be fairly simple to set up with an Arduino, but I am trying to wrap my head around how to achieve it with ESPHome. I am going to eventually move this to it’s own controller but currently I am abusing the load shedding relays on my transfer switch to control the generator. I have been able to successfully start the generator my manually toggling the load shedding relays which I have attached to the power and starter (and soon the glowplugs), so the hardware is ready. I also have an input that is mostly able to tell if the engine is running by pulse counting the output of the W terminal of the alternator. The ATS has the ability to tell if power is present on the output, the power from the power company, and the generator. The final unit will be able to read the coolant temp sensor of the generator as well as oil pressure
My end-goal is to:
detect loss of power from the power company
check the current temp
run the glowplugs for a time based on temp
activate power to the fuel solenoid and alternator regulator
activate the starter and monitor the pulses from the alternator until they rise above a threshold or we have been cranking too long (in which case we wait for a while and try again)
give the generator some time to warm up
verify power is still out and if so cut power over using the transfer switch
monitor power and if it comes back verify it is stable before cutting back over
let the generator cool down before shutting it down
I would like this to live on the ESP. Home assistant should be able to override initiating the transfer as well as overriding cutting back to grid power, but I want this to be fully autonomous if HA is unavailable.
Yes, It has successfully been working, it has also stepped in for a couple of outages. The one tweak I had to make was to make the controls invisible to google assistant, as my young son told google to “turn everything on” and ran the generator for 6 hours while I was at work
Here is the current version of YAML:
For the engine, I just found a diesel engine on my local classifieds. I bought a KDW1003 out of one of the light towers that are used in construction sites. After confirming it was working (Mechanical diesel engines are dead simple. Give them fuel, and they will run).
Next, I went to https://www.centralgagenerator.com/ and ordered a powerhead that was matched to my engine. If you look up the manufacturer spec sheet for the engine they will usually list the standard/dimensions of the output shaft and housing. You can call up a rep or use the website to find the correct generator head for your engine.
The one issue I had was ordering too big of a powerhead for my engine. The powerheads will list an ideal horsepower to run them, but the engine has to put out that horsepower at 1,820 RPM, which is usually less than the peak horsepower of the engine. in my case, the peak HP is 23.7, but at 1820 RPM it is more like 12. I am currently working on a supercharger to get the engine closer to matching the powerhead, but it does work as it is (I just can’t run the HVAC and electric ovens at the same time)
As for the electronics, I am using one of my Universal Controller Module v1.2 boards with 3 automotive relays in a sealed box to control the engine.
The transfer switch is a frankenstien’d kohler transfer switch (I de-soldered the microcontroller and bodged an ESP32 into it’s place, though I should just make a full replacement)
this is amazing! Im working on a generator project myself. My setup is an MEP-803 Military surplus generator, a control board made from a member of another forum, and a generac ATS. Im working on pulling data from the 8266 board on the controller. i contacted the creator of the controll board and he modified the source code to output data Via ESP-NOW. Im working on getting the data to play nicely with HA/ESP-HOME