Status Page Updated with Graphs

I also changed the HESA status web page to have a simple table with the high, low, average, and current readings for each sensor. There are links to bring up the last 48 readings for each sensor. In the future, I would like to make graphs for monthly and yearly data.

Basic Design Failed. Design Changed. Backup Pump Added.
Recently, I was replacing the sump pump in my basement. While the pump was out, the water softener turned on and started dumping water into the crock. When the crock filled up, the HESA detected the water and shut off power to the water softener -- exactly as designed. What I found out, is that the water softener continues dumping water into the sink without electricity. In other words, shutting off power to the water softener does nothing. Yar!
added it to the crock. The submersible pump will move water from the crock for the basement sink to the crock for the drain tiles. The sump pump in the second crock will then move the water outside. This will help when the first sump pump fails for some reason. I still have a problem when the power in the basement fails. Yes, I could have a
Finally, I changed the programming on the HESA so the Power Switch Tail is normally off. When the HESA detects water, it sends a signal to the PST to turn it on and provide power to the submersible pump. This is the opposite of the way the HESA provided power to the PST originally but it fixes the design flaw.
Send All Clear Message
One small improvement I made is to send an "all clear" message to the email address if the water goes away. Now, when I am doing some testing, people will get a follow-up email when all is well.
HESA Not Transmitting
I have been having problems with the HESA not transmitting.
First, There were some bugs in the code that would stop the program if it could not reach the internet. I fixed those.
That GFCI outlet has a freezer plugged in to it, plus the sump pump, and a power strip with my network hub and a small clock. For some reason, the outlet would trip when the sump pump tried to run sometimes. Perhaps it was when the freezer motor was also kicking on. I solved this problem by adding a bigger outlet and a second GFCI outlet. Now, the freezer has its own 20 amp GFCI outlet. The sump pump and power strip share the other 20 amp GFCI outlet. I have not had any more problems with the GFCI outlets tripping since I made this change.
Even after these changes, once or twice a week, the HESA still stops transmitting. When I check the processes that are running, there is no HESA program. It appears that some kind of run-time bug causes the program to stop. I need to start recording everything that happens in a log file so I can see where it stops. Then, I can fix the code to handle the errors.
Until then, I made a change the /etc/rc.local file to hopefully restart the program if it fails. Here is the code.
until sudo python /home/pi/python/hesa.py; do
echo "HESA crashed with exit code $?. Respawning.." >&2
sleep 1
done
The HESA rebooted and started just fine. We'll see if this change to the rc.local file fixes the HESA from stopping or not.