Major updates to data storage using MySQL and InfluxDB and away from flat files. Please see the bottom of this readme for more updates!
Raspberry Pi / Arduino / Python / Alexa Project to automate pump management and filling of swimming pool along with tracking of various temperature and humidity sensors, smart water meters and more. Includes Flask based Web Interface and Alexa Skill.
This software is not really intended to be "plug-and-play" but rather sharing of code, hardware and sensor ideas that you can use as a starting point in your own pool management and/or home automation system. Enjoy!
While this readme is pretty specific to the code portion of the project, an in-depth writeup of the entire project from start to finish is available on Hackster.io with tons more detail and pictures! I have tried to include the different parts of the system in this readme, and over time I will expand this readme to include more about the project.
Updated Web Interface created and managed with Flask

This pool control software system was designed to automate and manage some everyday pool management tasks. It started out with just filling the pool, hence the name of the repo: pool_fill_control. It grew into far more than that and now is integrated into a variety of systems around our home. Here is a current (as of V3.5.0) list of items managed or monitored by the system:
Over time I added temperature monitoring, pH and ORP monitoring (but not control), Acid tank level monitoring, pool filter pressure monitoring, electrical (including solar) monitoring and pool pump management utilizing Russell Goldin's poolController Software. Because much of our house has other sensors I included monitoring of battery levels of various temperature and humidity sensors around the house that have nothing to do with the pool, but since I had the system in place to monitor and alert for these I went ahead and added them anyway. This is the same for overall power utilization and solar production.
I have also been working on adding in Alexa integration and learning how to build Alexa skills around the house. I have created a skill that allows you to query the system for all of the pool stats as well as to start and stop filling of the pool. The kids can also ask it if it is ok to go swimming and Alexa will ask them for the temperature they like the water, compare that to the current water temperature and then let them know if it is ok to go swimming. More a programming challenge than anything else. The Alexa interface is coded using the Flask-Ask python framework, but as I understand it, Flask-Ask is no longer being maintained so I may have to move to the much more difficult Pythin Alexa SDK in the future.
Alexa Echo Show Display


We utilize the EmonPi as our wireless hub:

V2.4 now includes 5 different system status LEDs. These include:
V2.5 (2016-06-04)
V2.6 (2016-06-05)
V2.8 (2016-06-13)
V2.9 (2016-06-18)
V3.0 (2016-09-04)
V3.1 (2016-10-08)
Added new sensor checking function to check that our temp and pool level sensors are responding as required and included notifications if they exceed a certain number of timeouts or their battery voltage drops too low. Also updated pool fill to stop automatically if we lose communication with with our pool level sensor.
Updated pool_fill() to include calls to differnt functions to streamline that particular function. Also cuts down on a couple of global variables. Need to continue to clean this up as I go through and optimize the code.
Changed the way we get the pool level. We used to have a 0 or a 1 programmed to be sent directly from the sensor. We would then make a decision to fill the pool based on the reading from the sensor. Now I output the actual resistance from the sensor to the database and using these values we can change the level of when we want to fill the pool within pooldb.py instead of having to physically reflash the pool_level arduino sensor.
V3.2 (Unpublished)
V3.3.03.01 (2018-02-22)
Major rewrite of code. Instead of a very large, nearly monolithic threaded application, I rewrote the code into various parts. The first part is a threaded application that does nothing more than to watch for physical button presses on the pool control console and does an action based on what button has been pressed. The second part is a cron based application that does all of the sensor checking and data gathering and fills the pool when necessary.
Flask web frontend (V1) completed. Basic implementation of a Flask framework and web frontend that allows viewing of all of the pool parameters like temperature, pool water level, pH, Orp, pump watts in use, battery conditions for the various sensors and more. It also allows for the manual filling of the pool as well as the stopping of an automatic fill that is already running. Includes ability to toggle all notifications (email, sms & pushbullet) as well as debug and logging setting via the web interface.
Added Acid level sensor and associated functions to watch the acid level in tank and notify us when the acid level get too low.
Added email and twilio (SMS) notifications to pushbullet. Requires (free) pushbullet an/or paid Twilio account.
V3.3.05 (2018-02-27)
V3.4 (2018-03-16)
V3.4.6 (2018-09-23)
V3.5.0 (2019-02-16)
V3.5.1 (2019-03-02)
Richard J. Sears - richardjsears@gmail.com - The RS Technical Group, Inc.
This project is licensed under the MIT License - see the MIT License for details
While there are a lot of people that deserve acknowledgments because they wrote amazing code, these folks went out of their way to help me out on this project and I want to call them out:
Russell Goldin (tagyoureit) - Thank you for all the extra time you spent helping to get my pool pump under control of my software.
Felix over at LowPowerLabs - Not only did Felix design the Moteinos that I use throughout my project, but he (and others in the LPL forums) put up with all of my questions trying to understand how to get the most out of my battery life.
The great community over at Openenergymonitor.org including @Paul, @Robert.Wall and @TrystanLea (among others).
My Amazing and loving family! My wonderful wife and kids who put up with all of my coding and automation projects and who encourage me in all things. Without them this project would not be possible and I will still be filling our pool with a hose.
And last but not least, my brother James who is a continual source of inspiration to me and to others. Everyone should have a brother as awesome as mine!
2 commits
Python
52.5%
C++
31.4%
HTML
15.3%
Major updates to data storage using MySQL and InfluxDB and away from flat files. Please see the bottom of this readme for more updates!
Raspberry Pi / Arduino / Python / Alexa Project to automate pump management and filling of swimming pool along with tracking of various temperature and humidity sensors, smart water meters and more. Includes Flask based Web Interface and Alexa Skill.
This software is not really intended to be "plug-and-play" but rather sharing of code, hardware and sensor ideas that you can use as a starting point in your own pool management and/or home automation system. Enjoy!
While this readme is pretty specific to the code portion of the project, an in-depth writeup of the entire project from start to finish is available on Hackster.io with tons more detail and pictures! I have tried to include the different parts of the system in this readme, and over time I will expand this readme to include more about the project.
Updated Web Interface created and managed with Flask

This pool control software system was designed to automate and manage some everyday pool management tasks. It started out with just filling the pool, hence the name of the repo: pool_fill_control. It grew into far more than that and now is integrated into a variety of systems around our home. Here is a current (as of V3.5.0) list of items managed or monitored by the system:
Over time I added temperature monitoring, pH and ORP monitoring (but not control), Acid tank level monitoring, pool filter pressure monitoring, electrical (including solar) monitoring and pool pump management utilizing Russell Goldin's poolController Software. Because much of our house has other sensors I included monitoring of battery levels of various temperature and humidity sensors around the house that have nothing to do with the pool, but since I had the system in place to monitor and alert for these I went ahead and added them anyway. This is the same for overall power utilization and solar production.
I have also been working on adding in Alexa integration and learning how to build Alexa skills around the house. I have created a skill that allows you to query the system for all of the pool stats as well as to start and stop filling of the pool. The kids can also ask it if it is ok to go swimming and Alexa will ask them for the temperature they like the water, compare that to the current water temperature and then let them know if it is ok to go swimming. More a programming challenge than anything else. The Alexa interface is coded using the Flask-Ask python framework, but as I understand it, Flask-Ask is no longer being maintained so I may have to move to the much more difficult Pythin Alexa SDK in the future.
Alexa Echo Show Display


We utilize the EmonPi as our wireless hub:

V2.4 now includes 5 different system status LEDs. These include:
V2.5 (2016-06-04)
V2.6 (2016-06-05)
V2.8 (2016-06-13)
V2.9 (2016-06-18)
V3.0 (2016-09-04)
V3.1 (2016-10-08)
Added new sensor checking function to check that our temp and pool level sensors are responding as required and included notifications if they exceed a certain number of timeouts or their battery voltage drops too low. Also updated pool fill to stop automatically if we lose communication with with our pool level sensor.
Updated pool_fill() to include calls to differnt functions to streamline that particular function. Also cuts down on a couple of global variables. Need to continue to clean this up as I go through and optimize the code.
Changed the way we get the pool level. We used to have a 0 or a 1 programmed to be sent directly from the sensor. We would then make a decision to fill the pool based on the reading from the sensor. Now I output the actual resistance from the sensor to the database and using these values we can change the level of when we want to fill the pool within pooldb.py instead of having to physically reflash the pool_level arduino sensor.
V3.2 (Unpublished)
V3.3.03.01 (2018-02-22)
Major rewrite of code. Instead of a very large, nearly monolithic threaded application, I rewrote the code into various parts. The first part is a threaded application that does nothing more than to watch for physical button presses on the pool control console and does an action based on what button has been pressed. The second part is a cron based application that does all of the sensor checking and data gathering and fills the pool when necessary.
Flask web frontend (V1) completed. Basic implementation of a Flask framework and web frontend that allows viewing of all of the pool parameters like temperature, pool water level, pH, Orp, pump watts in use, battery conditions for the various sensors and more. It also allows for the manual filling of the pool as well as the stopping of an automatic fill that is already running. Includes ability to toggle all notifications (email, sms & pushbullet) as well as debug and logging setting via the web interface.
Added Acid level sensor and associated functions to watch the acid level in tank and notify us when the acid level get too low.
Added email and twilio (SMS) notifications to pushbullet. Requires (free) pushbullet an/or paid Twilio account.
V3.3.05 (2018-02-27)
V3.4 (2018-03-16)
V3.4.6 (2018-09-23)
V3.5.0 (2019-02-16)
V3.5.1 (2019-03-02)
Richard J. Sears - richardjsears@gmail.com - The RS Technical Group, Inc.
This project is licensed under the MIT License - see the MIT License for details
While there are a lot of people that deserve acknowledgments because they wrote amazing code, these folks went out of their way to help me out on this project and I want to call them out:
Russell Goldin (tagyoureit) - Thank you for all the extra time you spent helping to get my pool pump under control of my software.
Felix over at LowPowerLabs - Not only did Felix design the Moteinos that I use throughout my project, but he (and others in the LPL forums) put up with all of my questions trying to understand how to get the most out of my battery life.
The great community over at Openenergymonitor.org including @Paul, @Robert.Wall and @TrystanLea (among others).
My Amazing and loving family! My wonderful wife and kids who put up with all of my coding and automation projects and who encourage me in all things. Without them this project would not be possible and I will still be filling our pool with a hose.
And last but not least, my brother James who is a continual source of inspiration to me and to others. Everyone should have a brother as awesome as mine!
2 commits
Python
52.5%
C++
31.4%
HTML
15.3%