Compare commits

..

1 Commits

Author SHA1 Message Date
76d88dd77f Add dev install docs
Some checks failed
quality / test (3.11) (pull_request) Has been cancelled
quality / test (3.13) (pull_request) Has been cancelled
2026-06-16 21:23:08 +02:00
2 changed files with 102 additions and 6 deletions

View File

@@ -285,15 +285,14 @@ function optionGroups(entities, selectedIds = new Set()) {
async function loadOverview() { async function loadOverview() {
const status = document.getElementById("status"); const status = document.getElementById("status");
const chips = document.getElementById("status-chips"); const chips = document.getElementById("status-chips");
let reconciliation = null;
try { try {
const [health, websocket, ml] = await Promise.all([ const [health, websocket, ml, reconciliation, actuators] = await Promise.all([
api("health"), api("health"),
api("health/websocket"), api("health/websocket"),
api("ml/health"), api("ml/health"),
api("v1/actuators/reconciliation/state"),
api("v1/actuators"),
]); ]);
reconciliation = await api("v1/actuators/reconciliation/state");
const actuators = await api("v1/actuators");
status.innerHTML = `<p class="ok">System bereit</p><p>Letzte automatische Prüfung: ${escapeHtml(reconciliation.last_completed_at || "noch nie")}</p>`; status.innerHTML = `<p class="ok">System bereit</p><p>Letzte automatische Prüfung: ${escapeHtml(reconciliation.last_completed_at || "noch nie")}</p>`;
chips.innerHTML = [ chips.innerHTML = [
`<span class="chip">API: ${escapeHtml(health.status)}</span>`, `<span class="chip">API: ${escapeHtml(health.status)}</span>`,
@@ -314,8 +313,12 @@ async function loadActuatorDiscovery() {
const options = document.getElementById("actuator-options"); const options = document.getElementById("actuator-options");
const select = document.getElementById("actuator-select"); const select = document.getElementById("actuator-select");
try { try {
const available = await api("v1/actuators/discovery"); const [available, configured] = await Promise.all([
actuatorChoices = available; api("v1/actuators/discovery"),
api("v1/actuators"),
]);
const configuredIds = new Set(configured.map(record => record.actuator_entity_id));
actuatorChoices = available.filter(entity => !configuredIds.has(entity.entity_id));
options.innerHTML = actuatorChoices.slice(0, 120).map(entity => options.innerHTML = actuatorChoices.slice(0, 120).map(entity =>
`<option value="${escapeHtml(entity.entity_id)}">${escapeHtml(entity.friendly_name || entity.entity_id)}${entity.area_name ? ` (${escapeHtml(entity.area_name)})` : ""}</option>` `<option value="${escapeHtml(entity.entity_id)}">${escapeHtml(entity.friendly_name || entity.entity_id)}${entity.area_name ? ` (${escapeHtml(entity.area_name)})` : ""}</option>`
).join(""); ).join("");

View File

@@ -0,0 +1,93 @@
# Locale Dev-Umgebung — sillyhome-next-dev
Ziel: Repo lokal klonen, Backend starten und Änderungen entwickeln, ohne das produktive Add-on direkt zu beeinflussen.
## Voraussetzungen
- Git
- Python 3.10+
- `pip`
- Optional: Nginx als Reverse-Proxy
## 1. Repo klonen
```bash
git clone http://192.168.6.31:3000/Otto/sillyhome-next-dev.git
cd sillyhome-next-dev
```
## 2. Abhängigkeiten installieren
```bash
sudo apt-get update
sudo apt-get install -y git python3 python3-pip uvicorn
pip3 install -r requirements.txt
```
## 3. Backend starten (temporär)
```bash
uvicorn app.main:app --reload
```
## 4. Backend dauerhaft per systemd starten
Datei `/etc/systemd/system/sillyhome-dev.service`:
```ini
[Unit]
Description=Sillyhome Next Dev
After=network.target
[Service]
WorkingDirectory=/home/otto/sillyhome-next-dev
Environment="PATH=/home/otto/.local/bin:/usr/local/bin:/usr/bin:/bin"
ExecStart=/usr/local/bin/uvicorn app.main:app --host 0.0.0.0 --port 8000
Restart=on-failure
[Install]
WantedBy=multi-user.target
```
Aktivieren:
```bash
sudo systemctl daemon-reload
sudo systemctl enable --now sillyhome-dev.service
```
## 5. Optional: Nginx Reverse-Proxy
Datei `/etc/nginx/sites-available/sillyhome-dev`:
```nginx
server {
listen 8080;
server_name sillyhome-dev.local;
location / {
proxy_pass http://127.0.0.1:8000/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
}
```
Aktivieren:
```bash
sudo ln -sf /etc/nginx/sites-available/sillyhome-dev /etc/nginx/sites-enabled/
sudo nginx -t && sudo systemctl reload nginx
```
## 6. Nur Frontend testen
```bash
cd /home/otto/sillyhome-next-dev/app/static
python3 -m http.server 8080 --directory .
```
Danach im Browser `http://127.0.0.1:8080` öffnen.
## Hinweis für Weiterentwicklung
Dieser Branch ist für lokale Entwicklungsiterationen gedacht. Änderungen hier sollen einzeln reviewt und danach in den passenden Produktiv-Branch übernommen werden.