Release v1.0.11: Pause-Fix, OAuth-Assistent, Docs, Cleanup
Pause-Fix (Silence-Injektor): - Python-Skript zwischen librespot und ffmpeg - Bei Pause füllt der Injektor die Stille mit Null-Bytes - Icecast bleibt verbunden, Stream reißt nicht ab OAuth-Einrichtungs-Assistent (Port 5589): - oauth_helper.py: HTTP-Server mit geführtem Anmelde-Prozess - Zeigt Spotify-Auth-Link automatisch sobald librespot ihn ausgibt - URL-Fixer: Nutzer fügt 127.0.0.1-URL ein, Assistent korrigiert auf HA-IP - Erkennt bereits vorhandene Credentials und zeigt Hinweis Dokumentation: - DOCS.md für die HA Add-on Detailseite erstellt - README.md vollständig überarbeitet und aktualisiert Cleanup: - Leere Testdatei entfernt - Veraltete example-config.yaml entfernt - manifest.json der Custom Component auf v1.0.11 gebracht Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
125
README.md
125
README.md
@@ -16,10 +16,7 @@ Das **Busch-Jäger Unterputz-Internetradio** kann nur Internetradio-Streams absp
|
||||
|
||||
## Lösung
|
||||
|
||||
Dieses Projekt besteht aus zwei Teilen:
|
||||
|
||||
1. **Home Assistant Add-on** – startet ein virtuelles Spotify Connect-Gerät ([librespot](https://github.com/librespot-org/librespot)) und stellt das Audio als MP3-Stream über Icecast bereit
|
||||
2. **Custom Component** (optional) – zeigt den Stream-Status als Media-Player-Entity in HA an
|
||||
Dieses Home Assistant Add-on erstellt ein virtuelles Spotify Connect-Gerät ([librespot](https://github.com/librespot-org/librespot)) und stellt das Audio als MP3- oder AAC-Stream über Icecast bereit.
|
||||
|
||||
### Funktionsweise
|
||||
|
||||
@@ -53,46 +50,39 @@ Spotify-App → [Spotify Connect] → librespot → PCM → ffmpeg → Icecast2
|
||||
|
||||
```yaml
|
||||
device_name: "Busch-Radio" # Name in der Spotify-App
|
||||
bitrate: 320 # 96 / 160 / 320 kbps
|
||||
bitrate: 160 # 96 / 128 / 160 / 192 kbps
|
||||
stream_format: "mp3" # mp3 oder aac
|
||||
stream_port: 8000 # HTTP-Port des Streams
|
||||
stream_mount: "/stream.mp3" # URL-Pfad
|
||||
stream_mount: "/stream" # URL-Pfad
|
||||
icecast_password: "geheim" # Icecast-Passwort (bitte ändern)
|
||||
```
|
||||
|
||||
### 3. Add-on starten & Spotify autorisieren
|
||||
|
||||
Beim **ersten Start** erscheint im Log eine Anleitung. Folge diesen Schritten:
|
||||
Beim **ersten Start** erscheint im Log:
|
||||
|
||||
1. Im Log erscheint eine Zeile wie:
|
||||
```
|
||||
Browse to: https://accounts.spotify.com/authorize?...
|
||||
```
|
||||
Kopiere diese URL vollständig und öffne sie im Browser.
|
||||
```
|
||||
Öffne die Einrichtungs-Seite im Browser:
|
||||
http://<homeassistant-ip>:5589
|
||||
```
|
||||
|
||||
2. Melde dich mit deinem Spotify-Konto an und erteile die Berechtigung.
|
||||
Öffne diese Adresse im Browser. Der **Einrichtungs-Assistent** führt dich durch die Spotify-Anmeldung:
|
||||
|
||||
3. Dein Browser wird danach weitergeleitet auf eine URL wie:
|
||||
```
|
||||
http://127.0.0.1:5588/login?code=...
|
||||
```
|
||||
Diese Seite schlägt fehl – **das ist normal**.
|
||||
1. Klicke auf **„Mit Spotify anmelden"**
|
||||
2. Melde dich mit deinem Spotify-Konto an und bestätige die Berechtigung
|
||||
3. Dein Browser wird auf `http://127.0.0.1:5588/login?code=...` weitergeleitet – diese Seite ist nicht erreichbar
|
||||
4. Kopiere die URL aus der Adressleiste und füge sie auf der Einrichtungs-Seite ein
|
||||
5. Klicke **„Weiter"** – der Assistent leitet die URL korrekt weiter
|
||||
6. Bei Erfolg erscheint: **Autorisierung erfolgreich!**
|
||||
|
||||
4. **Ersetze** in der Adressleiste `127.0.0.1` durch die IP deines Home-Assistant-Servers und drücke Enter:
|
||||
```
|
||||
http://<homeassistant-ip>:5588/login?code=...
|
||||
```
|
||||
|
||||
5. Bei Erfolg zeigt der Browser: `Autorisierung erfolgreich!`
|
||||
Das Add-on startet danach automatisch durch.
|
||||
|
||||
Die Credentials werden dauerhaft unter `/data/librespot-cache/` gespeichert — **dieser Schritt ist nur einmalig nötig**.
|
||||
Die Credentials werden dauerhaft gespeichert – **dieser Schritt ist nur einmalig nötig**.
|
||||
|
||||
### 4. Stream im Radio eintragen
|
||||
|
||||
Trage folgende URL im Busch-Jäger Radio ein:
|
||||
|
||||
```
|
||||
http://<homeassistant-ip>:8000/stream.mp3
|
||||
http://<homeassistant-ip>:8000/stream
|
||||
```
|
||||
|
||||
### 5. Musik abspielen
|
||||
@@ -126,21 +116,32 @@ Dann unter **Einstellungen → Integrationen → Busch-Radio Spotify Bridge** ei
|
||||
|
||||
---
|
||||
|
||||
## Nützliche URLs
|
||||
|
||||
| URL | Funktion |
|
||||
|---|---|
|
||||
| `http://<ha-ip>:5589` | Einrichtungs-Assistent (OAuth) |
|
||||
| `http://<ha-ip>:8000/stream` | Stream-URL für das Radio |
|
||||
| `http://<ha-ip>:8000` | Icecast-Statusseite |
|
||||
|
||||
---
|
||||
|
||||
## Technische Details
|
||||
|
||||
### Komponenten
|
||||
|
||||
| Komponente | Funktion |
|
||||
|---|---|
|
||||
| [librespot](https://github.com/librespot-org/librespot) v0.7.0 | Spotify Connect Client (PCM-Ausgabe via Pipe) |
|
||||
| [ffmpeg](https://ffmpeg.org) | PCM → MP3 Transkodierung |
|
||||
| [librespot](https://github.com/librespot-org/librespot) main | Spotify Connect Client (PCM-Ausgabe via Pipe) |
|
||||
| [ffmpeg](https://ffmpeg.org) | PCM → MP3/AAC Transkodierung |
|
||||
| [Icecast](https://icecast.org) | HTTP-Stream-Server |
|
||||
|
||||
### Signalfluss
|
||||
|
||||
```
|
||||
Spotify CDN → librespot (dekodiert, PCM auf stdout)
|
||||
→ ffmpeg (44100 Hz / S16LE / Stereo → MP3 320k)
|
||||
→ silence-injector (hält Stream bei Pause aufrecht)
|
||||
→ ffmpeg -re (Echtzeit-Encoding → MP3/AAC)
|
||||
→ Icecast (HTTP-Stream)
|
||||
→ Busch-Jäger Radio
|
||||
```
|
||||
@@ -148,7 +149,7 @@ Spotify CDN → librespot (dekodiert, PCM auf stdout)
|
||||
### Hinweise zum Build
|
||||
|
||||
- librespot wird aus dem Quellcode kompiliert (Rust, ~10–15 Min.)
|
||||
- Der OAuth-Server wird beim Build gepatcht: bindet an `0.0.0.0` statt `127.0.0.1`, damit der Browser-Login aus dem Heimnetz funktioniert
|
||||
- Der OAuth-Callback-Server bindet an `0.0.0.0` statt `127.0.0.1`, damit der Browser-Login aus dem Heimnetz funktioniert
|
||||
- Credentials werden in `/data/librespot-cache/` persistent gespeichert
|
||||
|
||||
---
|
||||
@@ -157,14 +158,41 @@ Spotify CDN → librespot (dekodiert, PCM auf stdout)
|
||||
|
||||
| Problem | Lösung |
|
||||
|---|---|
|
||||
| „Busch-Radio" erscheint nicht in Spotify | OAuth-Autorisierung abschließen (Logs prüfen) |
|
||||
| Stream-Seite nicht erreichbar | Icecast-Status: `http://ha-ip:8000` |
|
||||
| OAuth-Weiterleitung schlägt fehl | Normal – `127.0.0.1` in Adressleiste durch HA-IP ersetzen |
|
||||
| Stream bricht bei Pause ab | Normal – Radio nach Fortsetzen neu verbinden |
|
||||
| „Busch-Radio" erscheint nicht in Spotify | Einrichtungs-Seite öffnen: `http://<ha-ip>:5589` |
|
||||
| Stream nicht erreichbar | Icecast-Status prüfen: `http://<ha-ip>:8000` |
|
||||
| Stream bricht bei Pause ab | Auf Version 1.0.11+ aktualisieren |
|
||||
| Songs wechseln zu schnell | Auf Version 1.0.10+ aktualisieren |
|
||||
| Neu autorisieren | Add-on stoppen → `/data/librespot-cache/credentials.json` löschen → neu starten |
|
||||
| Build schlägt fehl | Logs im Add-on Store prüfen |
|
||||
|
||||
---
|
||||
|
||||
## Projektstruktur
|
||||
|
||||
```
|
||||
busch-radio-spotify/
|
||||
├── busch_radio_spotify/ # Home Assistant Add-on
|
||||
│ ├── Dockerfile # Multi-Stage Build (Rust + Alpine)
|
||||
│ ├── config.yaml # Add-on Manifest & Optionen
|
||||
│ ├── build.yaml # Multi-Arch Konfiguration
|
||||
│ ├── DOCS.md # Add-on Dokumentation (in HA angezeigt)
|
||||
│ ├── run.sh # Startup-Script
|
||||
│ ├── oauth_helper.py # OAuth-Einrichtungs-Assistent (Port 5589)
|
||||
│ ├── icon.png # Add-on Icon (Store)
|
||||
│ └── logo.png # Add-on Logo (Detailseite)
|
||||
├── custom_components/ # Optionale HA Integration
|
||||
│ └── busch_radio_spotify/
|
||||
│ ├── __init__.py
|
||||
│ ├── manifest.json
|
||||
│ ├── media_player.py
|
||||
│ ├── config_flow.py
|
||||
│ └── translations/
|
||||
├── repository.yaml # HA Repository-Manifest
|
||||
└── README.md
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Rechtliche Hinweise
|
||||
|
||||
- Dieses Projekt nutzt **librespot**, eine Open-Source-Reimplementierung des Spotify-Clients
|
||||
@@ -174,31 +202,6 @@ Spotify CDN → librespot (dekodiert, PCM auf stdout)
|
||||
|
||||
---
|
||||
|
||||
## Projektstruktur
|
||||
|
||||
```
|
||||
busch-radio-spotify/
|
||||
├── busch_radio_spotify/ # Home Assistant Add-on
|
||||
│ ├── Dockerfile # Multi-Stage Build (Rust + Alpine)
|
||||
│ ├── config.yaml # Add-on Manifest & Optionen
|
||||
│ ├── build.yaml # Multi-Arch Konfiguration
|
||||
│ ├── run.sh # Startup-Script
|
||||
│ ├── icon.png # Add-on Icon (Store)
|
||||
│ └── logo.png # Add-on Logo (Detailseite)
|
||||
├── custom_components/ # Optionale HA Integration
|
||||
│ └── busch_radio_spotify/
|
||||
│ ├── __init__.py
|
||||
│ ├── manifest.json
|
||||
│ ├── media_player.py
|
||||
│ ├── config_flow.py
|
||||
│ └── translations/
|
||||
├── example-config.yaml # Beispielkonfiguration
|
||||
├── repository.yaml # HA Repository-Manifest
|
||||
└── README.md
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Lizenz
|
||||
|
||||
MIT License
|
||||
|
||||
Reference in New Issue
Block a user