install instructions

This commit is contained in:
2026-09-06 15:57:14 +02:00
parent 1e18920ec6
commit 57b5e2f2f5
4 changed files with 22 additions and 16 deletions
+18 -13
View File
@@ -15,11 +15,16 @@ approximately five-minute averages for 90 days, and hourly averages for two year
## Install on Raspberry Pi OS or Debian
Install the native RRDtool binding and Python dependencies:
Install Python's virtual-environment support and the native headers needed to build
the RRDtool package, then install every Python dependency into `.venv`:
```bash
sudo apt update
sudo apt install python3 python3-flask python3-requests python3-rrdtool fonts-dejavu-core
sudo apt install python3 python3-venv python3-dev build-essential librrd-dev fonts-dejavu-core
python3 -m venv .venv
. .venv/bin/activate
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
```
Create the Hue application key if you do not have one yet. Press the bridge link
@@ -41,7 +46,7 @@ cp .env.example .env
set -a
. ./.env
set +a
python3 -m hue_collector
python -m hue_collector
```
Open `http://PI_ADDRESS:8000`. The RRD files are written to `DATA_DIR`, which defaults
@@ -49,13 +54,11 @@ to the project's `data/` directory.
## Run continuously with systemd
Install the project and environment file:
The included unit expects this repository at `/srv/service_hue_collector`, including
its `.venv` and `.env` files:
```bash
sudo install -d /opt/hue-collector
sudo cp -r hue_collector /opt/hue-collector/
sudo cp .env /etc/hue-collector
sudo chmod 600 /etc/hue-collector
sudo chmod 600 /srv/service_hue_collector/.env
sudo cp hue-collector.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable --now hue-collector
@@ -93,11 +96,13 @@ trusted.
## Development
On a Debian-based machine, install `python3-rrdtool` through apt. Flask and Requests
can alternatively be installed from `requirements.txt`. When using a virtual
environment, create it with `--system-site-packages` so it can see the apt-installed
RRDtool module.
Create the virtual environment and install all application dependencies from the
requirements file:
```bash
python3 -m unittest discover -s tests
sudo apt install python3-venv python3-dev build-essential librrd-dev fonts-dejavu-core
python3 -m venv .venv
. .venv/bin/activate
python -m pip install -r requirements.txt
python -m unittest discover -s tests
```