We have all the controller code installed for Alerts, we just need to configure some values and settings.
Here is my sensor landscape:
Choose a suitable sensor to add some alerts and enter values for High Alert, Low Alert & Email Recipient.
In order for the hub to send email notifications, it needs to know some details about the Mail Server, Email From address and Email Sender. These are Settings that need to be configured in the Organisation | Settings tab.
The Mail Server field needs to be populated with the name of your mail server, and the Email Sender with a valid email address. The Email From field is just the value displayed in the email, and could potentially be any text. I was able to send emails through my ISP with this simple arrangement, however, it should be fairly straightforward to modify the send_email function in helpers.py, and add any additional user settings required.
If you have a working temperature sensor, then all that remains is to warm it up to generate the alert. The value will need to exceed the limit for 3 cycles in order to trigger the alert. This is to prevent erroneous readings from causing unnecessary messages.
If you do not have a real sensor, you can place the alert on the virtual sensor to confirm your code and email configuration is working. In the next post we will look at SMS alerts.