Skip to content
Michael Hrivnak edited this page Apr 15, 2018 · 2 revisions

Installing

Binary

Build a binary and put in at /usr/local/bin/stataway

systemd

Unit File

Create /etc/systemd/system/stataway.service with the following contents:

[Unit]
Description=stataway: sets home thermostats to away/home automatically
After=network.target

[Service]
ExecStart=/usr/local/bin/stataway
Type=simple
EnvironmentFile=/etc/sysconfig/stataway
Restart=always
RestartSec=120
# instead use DynamicUser=yes if on systemd >= 235 
User=nobody
# security best practices below
PrivateTmp=true
ProtectSystem=true
ProtectHome=true

[Install]
WantedBy=default.target

Environment File

Create /etc/sysconfig/stataway with mode 640, owned by root, and the following contents adjusted for your own settings:

GOOGLE_USERNAME=
GOOGLE_PASSWORD=

GOOGLE_INNER_KM=.5
GOOGLE_OUTER_KM=.7

HOME_LATITUDE=35.775356
HOME_LONGITUDE=-78.638030

VENSTAR_URL=http://<IP here>

Enable

Run:

systemctl daemon-reload
systemctl enable --now stataway
Clone this wiki locally