-
Notifications
You must be signed in to change notification settings - Fork 8
4. Remote Monitoring Alarm Email
This script runs on the greenhouse Raspberry Pi and sends email/SMS notifications when temperature values are too high or low or soil moisture values are too high.
$ sudo crontab -e
*/30 * * * * python /home/pi/Greenhouse/greenhousealarmemail.py
The greenhousealarmemail.py script requires configuration of the minimum and maximum alarm values located in the script header. The greenhousealarmemail.py script also requires a valid SMTP server address and valid account credentials before an alarm notification may be sent.
$ nano /home/pi/Greenhouse/Greenhousealarmemail/greenhousealarmemail.py
# Minimum temperature to trigger an email/sms alarm notification
MINIMUM_TEMPERATURE_ALARM = 32.05
# Maximum temperature to trigger an email/sms alarm notification
MAXIMUM_TEMPERATURE_ALARM = 101.99
# Maximum soil moisture to trigger an email/sms alarm notification
MAXIMUM_SOIL_MOISTURE_ALARM = 3.1
# Email message from address value
FROM_EMAIL_ADDRESS_VALUE = '[email protected]'
# Email message recipients destination address values
RECIPIENTS_EMAIL_ADDRESS_VALUES = ['[email protected]', '[email protected]']
# SMTP email servers host name
EMAIL_SMTP_SERVER_HOST_NAME = 'smtp.email.example'
# SMTP server user name
SMTP_SERVER_LOGIN_NAME = '[email protected]'
# SMTP server password
SMTP_SERVER_LOGIN_PASSWORD = 'shhhhaplaintextpasswordvalue'
Proceed to next section: Section 5. Remote Monitoring Report Email
Understand well as I may, my comprehension can only be an infinitesimal fraction of all I want to understand. - Ada Lovelace
Home 🌸
4. Remote Monitoring Alarm Email
5. Remote Monitoring Report Email
6. Remote Monitoring Radio Frequency Broadcast
7. Remote Monitoring Radio Frequency Reception
8. Remote Monitoring POTS (Plain Old Telephone Service) Landline
9. Ubuntu Desktop Alarm Notifications