Commit Graph

71 Commits

Author SHA1 Message Date
retr0 aac95c2eef Rename: Repository → shinebridge
URLs auf https://gitea.bitfire.work/retr0/shinebridge aktualisiert.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-27 11:55:24 +02:00
retr0 a3e87da943 Feature: Persistente History via SQLite (v1.3.0)
Sensorwerte werden in /data/history.db (SQLite, WAL-Modus) persistiert
und überleben damit Add-on-Neustarts. Beim Start werden die letzten 300
Messpunkte pro Sensor in die In-Memory-Deque geladen, sodass Sparklines
sofort Daten zeigen. Retention: 7 Tage. Neue API: GET /api/history.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-27 11:44:11 +02:00
retr0 9913dccfa9 Fix: SDM-630 Gesamtwirkleistung aus Phasensumme berechnet (v1.2.1)
Register 0x0030 liefert je nach SDM-630-Firmware-Variante den Phasenwinkel
statt der Gesamtwirkleistung. total_power wird jetzt zuverlässig aus
power_l1 + power_l2 + power_l3 berechnet und überschreibt den Hardware-Wert.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-27 11:27:00 +02:00
retr0 456bfb34d6 Feature: Aggregat-Gerät + Energie-Dashboard Sensoren (v1.2.0)
- main.py: AGG_SENSOR_IDS/AGGREGATE_META — Mapping sensor_id → Aggregat-Bucket
  _compute_aggregates() summiert alle online Geräte nach jedem Poll
  /api/data liefert jetzt auch "aggregates" Schlüssel
- mqtt_publisher.py: publish_aggregates() + _publish_aggregate_discovery()
  Eigenes HA-Gerät "ShineBridge Gesamt" (device_id: shinebridge_aggregate)
  MQTT Topic: shinebridge/aggregate/state
- index.html: renderAggregates() — "Gesamt"-Sektion oben im Live-Tab

Aggregierte Sensoren (alle kompatibel mit HA Energie-Dashboard):
  PV: total_pv_power, total_ac_power, total_energy_today, total_energy_total
  Netz (SDM-630): grid_power, grid_import_kwh, grid_export_kwh
  Batterie (SPH): bat_charge/discharge_power/total, bat_soc (Ø)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-26 21:40:01 +02:00
retr0 33c6a15644 Feature: Eastron SDM-630 Support + Float32 Decode (v1.1.5)
- inverters.py: data_type Feld in Sensor (uint16/uint32/float32)
  + SDM-630 Definition (16 Sensoren: U/I/P L1-L3, PF, Freq, kWh)
  + read_ranges: [(0, 76)] — alle Sensoren in einem Batch
- modbus_client.py: Float32 IEEE 754 Decode via struct.unpack
  (SDM-630 liefert Floats, Growatt liefert skalierte Integer)
- index.html: "Wechselrichter" → "Gerät" — Add-on unterstützt
  jetzt beliebige Modbus-Geräte, nicht nur Wechselrichter

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-26 17:07:14 +02:00
retr0 fd5625b99a Fix: Flask zurück auf 0.0.0.0 — HA Ingress braucht es (v1.1.4)
127.0.0.1-Binding verursacht 502 Bad Gateway weil HA Supervisor Ingress
nicht von localhost aus verbindet. host_network: true + 0.0.0.0 ist die
korrekte Konfiguration für HAOS Add-ons.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-26 16:37:48 +02:00
retr0 2197e981b2 Rename: Growatt ShineLAN-X Add-on → ShineBridge
Add-on heißt jetzt ShineBridge (slug: shinebridge). Hardware-Name
"Growatt ShineLAN-X" im README und in der Dokumentation unverändert.

WICHTIG: Slug-Änderung erfordert Neuinstallation des Add-ons in HA
(altes Add-on deinstallieren, ShineBridge neu installieren).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-26 13:30:23 +02:00
retr0 5b490c0aea Security: XSS-Fix, localhost-Binding, API-Validierung (v1.1.3)
- Flask bindet auf 127.0.0.1 statt 0.0.0.0 — Port 8099 nicht mehr
  direkt im LAN erreichbar (host_network: true umgeht sonst HA-Auth)
- XSS: esc() Funktion + HTML-Escaping für alle user-controlled Werte
  in innerHTML (inv.name, modbus_ip, mqtt_topic_prefix, s.name, s.unit)
- API: POST /api/inverters-config validiert inverter_model, Port (1-65535),
  Modbus-Adresse (1-247) vor dem Speichern
- _poll_loop: int()-Aufrufe in try/except — kein Thread-Crash bei
  ungültiger Config

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-26 12:34:21 +02:00
retr0 c74fafa6c0 HAOS Add-on v1.1.2: HA-Gerätename = benutzerdefinierter Wechselrichtername
Statt Modell-Name ("Growatt MIC 1500 TL-X") wird der vom User vergebene
Name ("Dach Süd") als HA-Gerätename in MQTT Discovery verwendet.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-26 12:24:55 +02:00
retr0 12586fa383 HAOS Add-on v1.1.1: Sparkline-Graphen (letzte 5 Minuten)
- SVG-Sparkline pro Sensor-Karte, farbkodiert nach device_class
- Backend: (timestamp, value) deque pro Sensor, API filtert auf 300s
- Kein Datenverlust bei Neustart (In-Memory, reicht für Trendanzeige)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-26 12:14:24 +02:00
retr0 35a3c01e36 HAOS Add-on v1.1.0: Multi-Wechselrichter Support
- Unbegrenzt viele Wechselrichter über Web UI verwaltbar (Add/Edit/Delete)
- Pro Wechselrichter: eigener Poll-Thread, MQTT-Topic-Präfix, HA Device
- Shared MQTT-Publisher: eine Verbindung für alle Wechselrichter
- Migration: bestehende Single-Inverter-Config wird automatisch übernommen
- Live-Daten: pro Wechselrichter mit Online/Offline-Badge
- config.yaml: nur noch MQTT global, Wechselrichter über /data/config.json

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-26 11:17:06 +02:00
retr0 4fd54025ad HAOS Add-on v1.0.5: Fehlerzähler aus Info-Row entfernt
Fehlerzähler zeigte kumulierte Timeouts vor dem NuttX-Flash (4282)
was wie ein Growatt-Fehlercode aussah. Status-Pills zeigen Verbindung.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-26 10:55:39 +02:00
retr0 b890121d32 HAOS Add-on: Version 1.0.4 (triggert Update in HA) 2026-04-24 23:08:10 +02:00
retr0 e2d67f3447 HAOS Add-on: Ingress-Pfad-Fix im Web UI
Fetches verwendeten absolute Pfade (/api/...) → gingen an HA REST API statt Add-on.
Hinter HA Ingress-Proxy muss der Pfad relativ zur Seiten-URL sein.
Fix: BASE = window.location.href + "./" → apiUrl() für alle fetch-Aufrufe.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-24 23:07:15 +02:00
retr0 c146df2ec9 HAOS Add-on: host_network für Modbus TCP Zugriff
Container-Netz 172.30.33.x kann ShineLAN-X (10.10.20.190) nicht erreichen.
host_network: true gibt Zugriff auf das lokale Netzwerk.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-24 23:04:16 +02:00
retr0 5423b4d809 HAOS Add-on: s6-overlay Fix
- init: false in config.yaml → s6-overlay deaktiviert, CMD läuft als PID 1
- CMD: python3 /app/main.py direkt (kein run.sh + bashio mehr nötig)
- main.py: liest /data/options.json (HA Add-on Options) statt Env-Vars via bashio

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-24 22:56:29 +02:00
retr0 c33db75208 HAOS Add-on: Dockerfile Fix - COPY src/ direkt, pip3 inline
- COPY src/ /app/ statt zweistufig (vermeidet src/requirements.txt not found)
- pip3 inline statt requirements.txt (kein separater COPY-Schritt nötig)
- ARG BUILD_FROM mit amd64 Default (build.yaml Deprecation umgangen)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-24 22:52:57 +02:00
retr0 c1fc3a080a HAOS Add-on: Schema-Fix + Arch bereinigt
- inverter_model schema: str statt Pipe-Enum (HA kennt keinen Pipe-Syntax)
- arch: nur aarch64 + amd64 (armhf/armv7/i386 deprecated)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-24 22:50:07 +02:00
retr0 8adc7573e3 HAOS Add-on: config.yaml Fix für Add-on Store
- panel_title entfernt (kein gültiges HA-Feld, blockt Parser)
- init: false entfernt (nicht kompatibel mit HA Alpine Base)
- description: Pfeil-Unicode entfernt
- mqtt_pass schema: password (statt str, maskiert im UI)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-24 22:36:43 +02:00
retr0 af6ff398e8 HAOS Add-on: repository.yaml + Slug-Fix für HA Add-on Store
- repository.yaml im Root → Repo als HA Add-on-Quelle nutzbar
- slug: growatt_shinelan_x (Unterstriche statt Bindestriche, HA-konform)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-24 22:32:29 +02:00
retr0 0d6b860664 HAOS Add-on: MVP + NuttX Binary + .gitignore
- haos-addon/: vollständiges HA Add-on (config.yaml, Dockerfile, build.yaml)
  - Python Backend: pymodbus Modbus TCP → paho-mqtt MQTT Discovery
  - Unterstützte Modelle: MIC 1500/2000 TL-X, SPH 5000 TL3, MOD 6000 TL3
  - Web UI: Wechselrichter-Auswahl, Modbus/MQTT-Konfig, Live-Sensor-Grid (dark theme)
  - MQTT HA Discovery für alle Sensoren mit device_class, state_class, icon
- ShineLAN-X/releases/nuttx-mbusd-shinelanx.bin: NuttX Firmware (ohne DFU, 0x08000000)
- .gitignore: Logs, MQTT-JSON, shinelanx-modbus/ ausgeschlossen

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-24 22:30:45 +02:00