Back-end server that handles outgoing communications. Main functions are:
- It sends emails using Mailgun if garage door is left open, garage door is opening or motion is detected while alarm is armed.
- It sends text messages using Twilio if one of the previous conditions are met.
- It makes phone calls using Twilio if one of the previous conditions are met.
I suggest you first read about the different components of the home automation application.
This will help you understand better the general architecture and different functions of the system.
Click here and follow the installation instructions for the server micro-service, before moving to the next step.
AUTH_PUBLIC_KEY (required): content of auth server's publickey.
DATABASE_URL (required): url to postgres database. Default: postgres://postgres:@localhost/home_automation
KEEP_HISTORY_IN_DAYS (required): days to keep history in database. Default: 30
NODE_ENV (required): set up the running environment. Default: production
. production
will enforce encryption using SSL and other security mechanisms.
POSTGRESPOOLMIN (required): postgres pool minimum size. Default: 2
POSTGRESPOOLMAX (required): postgres pool maximum size. Default: 10
POSTGRESPOOLLOG (required): postgres pool log. Values: true
/false
. Default: true
Mailgun integration - this integration is optional. In order to activate it, all the required environment variables below must be set.
* MAILGUN_API_KEY (required): mailgun api key.
* MAILGUN_DOMAIN (required): domain name validated and used by mailgun. Example: my-website.com
* EMAIL_ALERT_SENDER (required): Alert sender's email. Example: sender@mydomain.com
* SEND_EMAIL (required): defines whether email alerts should be sent. Values: true
/ false
. Default: true
Twilio integration - this integration is optional. In order to activate it, all the required environment variables below must be set.
* TWILIO_ACCOUNT_SID (required): twilio account sid.
* TWILIO_AUTH_TOKEN (required): twilio auth token.
* TWILIO_FROM (required): phone number that will be used to send SMS or make phone calls.
* SEND_SMS (required): defines whether sms alerts should be sent. Values: true
/ false
. Default: true
* MAKE_CALL (required): defines whether phone call alerts should be made. Values: true
/ false
. Default: true