aboutsummaryrefslogtreecommitdiffstats
path: root/esphomeapi@.service
diff options
context:
space:
mode:
authorDennis Eriksen <d@ennis.no>2023-04-03 10:40:15 +0200
committerDennis Eriksen <d@ennis.no>2023-04-03 10:40:15 +0200
commite55821f20e6b8d52b23c5bcd2ecaa585ac99e095 (patch)
treee0670846e60b3aec26319ce5af321551195214ed /esphomeapi@.service
parentrewriting script (diff)
downloadenergyscripts-e55821f20e6b8d52b23c5bcd2ecaa585ac99e095.tar.gz
adding service for esphomeapi, and allowing run.sh to take arguments
Diffstat (limited to 'esphomeapi@.service')
-rw-r--r--esphomeapi@.service17
1 files changed, 17 insertions, 0 deletions
diff --git a/esphomeapi@.service b/esphomeapi@.service
new file mode 100644
index 0000000..d10f8b4
--- /dev/null
+++ b/esphomeapi@.service
@@ -0,0 +1,17 @@
+[Unit]
+Description=Simple service to start esphomeapi
+StartLimitIntervalSec=100
+StartLimitBurst=5
+
+[Service]
+Type=simple
+EnvironmentFile=%h/energyscripts/.env
+WorkingDirectory=%h/energyscripts
+ExecStart=%h/energyscripts/venv/bin/python3 -u scripts/esphomeapi.py -a %i
+Restart=on-failure
+TimeoutStopSec=70
+RestartSec=30
+SyslogIdentifier=%N
+
+[Install]
+WantedBy=default.target