Python script for raspberry pi, script must read 2 level switches connected on gpio pins,
when they are in high or low position both switches have a different job.
Step A: When switch_1 is in high position, send one time mail with message: volume of tank is now ok.
Keep this one time logged in a database using mysql, with message: volume tank is refilled. When switch_1 is high then a green led must turn on. When this switch is low then green led goes off.
When switch_1 is low, do nothing.
When switch_1 is high again for first time then repeat step A.
When swith_2 is low send directly a mail with message: tank volume is low! And a red led must turn on.
And when switch_2 is staying low, repeat every 60 minutes sending a mail for warning tank volume is low!
When switch_2 is high again then red led must go off.
The script must be continuously running and act directly when a switch is changed as described above.
Script should not run as a cronjob to avoid problems.
Database must contains when switch_1 is one time high; date and time the tank is reffiled
Second database contains date and time when switch_2 is low; date and time tank is empty
The mail script should run on an secondary server were the
raspberry pi send the commands to, so that server will do the mailing work.
This secondary server handles only php.
Main script must be adjustable for extra tanks in future, add this in comments of script.
Have worked before with raspberry pis to create home automation systems so i have a very good knowledge of the system of raspis, have 1year+ of python experience
Stay tuned, I'm is still working on this proposal.