-
Notifications
You must be signed in to change notification settings - Fork 23
Installation & Autostart
spacemanspiff2007 edited this page Apr 9, 2019
·
4 revisions
- Install required dependencies
sudo apt install python3-dev python3-venv
and navigate to folder where HABApp shall be installed (e.g. /opt/)
cd /opt
- Create virtual environment (this will create a new folder "habapp")
python3 -m venv habapp
- Go into folder of virtual environment
cd habapp
- Activate the virtual environment:
source bin/activate
- Upgrade pip
python3 -m pip install --upgrade pip
- Install HABApp
python3 -m pip install habapp
- Run (or configure it to autostart) PATH_TO_CONFIGURATION_FOLDER
habapp -c PATH_TO_CONFIGURATION_FOLDER
To automatically start HABApp after a reboot call
nano /etc/systemd/system/habapp.service
cand copy paste the following contents. If the user which is running openhab is not "openhab" replace accordingly.
[Unit]
Description=HABApp
After=network-online.target
[Service]
Type=simple
User=openhab
Group=openhab
ExecStart=/opt/habapp/bin/habapp -c PATH_TO_CONFIGURATION_FOLDER
[Install]
WantedBy=multi-user.target
Press Ctrl + x to save.
Now execute the following commands to enable autostart
sudo systemctl --system daemon-reload
sudo systemctl enable habapp.service
It is now possible to start and check the status of HABApp with
sudo systemctl start habapp.service
sudo systemctl status habapp.service