Your server can send you emails from your rules: warning you that an alarm went off, that a door was left open, that a temperature is abnormal, or sending a picture taken by a camera.
For that, you must tell it which sending service to use: this is called an SMTP server. In practice, the one from your Internet provider or your mail service.
These settings are not available from the touchscreen: connect over SSH (see SSH access).
Before you start, gather the information provided by your mail service:
smtp.example.com;This information is in your provider’s help pages, often under a heading such as “configure a mail client”.
The settings are defined with the calaos_config tool:
calaos_config set smtp_server smtp://smtp.example.com
calaos_config set smtp_port 587
calaos_config set smtp_auth true
calaos_config set smtp_tls true
calaos_config set smtp_username my_user
calaos_config set smtp_password my_password
Here is what each setting does:
| Setting | Purpose |
|---|---|
smtp_server | Address of the sending server, prefixed with smtp:// |
smtp_port | Port of the sending server |
smtp_auth | true if the server requires a user name and a password |
smtp_tls | true for an encrypted connection |
smtp_username | Your user name |
smtp_password | Your password |
To check what has been saved:
calaos_config list
Many mail services now refuse your usual password for this kind of use and require an application password, to be generated from your account. If sending fails while your credentials are correct, this is very likely the cause.
The calaos_mail tool sends a test message. First prepare a file containing the message text, then send it:
echo "This is a test from my Calaos server." > /tmp/test.txt
calaos_mail --from me@example.com --to me@example.com --subject "Calaos test" --body /tmp/test.txt
If the message arrives, the configuration is correct.
If it fails, run the command again adding --verbose: the details of the exchange with the sending server are displayed, which usually shows which setting is at fault.
calaos_mail --from me@example.com --to me@example.com --subject "Calaos test" --body /tmp/test.txt --verbose
Remember to check your junk mail folder: messages sent by a home server often land there the first time.
The --attach option attaches a file, and can be repeated to attach several:
calaos_mail --from me@example.com --to me@example.com --subject "Picture" --body /tmp/test.txt --attach /tmp/photo.jpg
This is the mechanism that lets you receive a camera picture by email.
Once sending is configured, you can trigger emails from your automation rules. Creating rules is described in Rules, in the Calaos Installer chapter.
Independently of your rules, the server can alert you on its own about two events concerning your wireless devices:
# Low battery on a device
calaos_config set notif/battery_mail_enabled true
calaos_config set notif/battery_push_enabled true
# Device connecting or disconnecting
calaos_config set notif/io_connected_mail_enabled true
calaos_config set notif/io_connected_push_enabled true
The _mail_ settings send an email — and therefore assume the configuration above — while the _push_ settings send a notification to your phone. You can enable either, or both.
The low-battery alert is the most useful one: it warns you before a sensor stops working, rather than letting you find out on the day you need it.
See Zigbee for the devices concerned.