KEF Wireless Speakers Smart-Home-Integration, kostenlos und Open Source

KEF wireless speakers (LS50 Wireless II, LSX II, LS60), local: power, volume, source, playback.
Die Dokumentation dieser Integration wird von ihrem Autor geschrieben und ist bisher nur auf Englisch verfügbar.
Control your KEF wireless speakers (LS50 Wireless II, LSX II, LSX II LT, LS60) from Gladys, locally, without any cloud: power on, standby, volume, mute, source, play, pause, next, previous and the title playing.
Important. This integration has never been tested with a real speaker: it was written from the
pykefcontrollibrary, and the KEF API it uses is not documented by KEF. It was tested against a fake speaker only. Your feedback is welcome. Unofficial integration, not affiliated with KEF. The XIO soundbar is not confirmed (pykefcontrol does not list it).
Setup
- Give each speaker a fixed IP address in your router (reserved DHCP lease).
- In Gladys, install the KEF Wireless Speakers integration, then open its configuration.
- Type the IP addresses, separated by commas (for example
192.168.1.50, 192.168.1.51). - Choose the volume cap (40 % by default) and the refresh interval (10 s by default, 5 to 300 s).
- The speakers appear in the Discovery tab: create them.
The integration reads each speaker over its HTTP API (http://<ip>/api/…,
port 80) at the refresh interval. A change made on the speaker, its remote or
the KEF Connect app shows in Gladys at the next read.
What you get
| Feature | Gladys type | Note |
|---|---|---|
| Power | binary state (read only) | 1 on, 0 in standby or not answering |
| Power on | button | wakes the speaker up |
| Standby | button | puts the speaker in standby; never waits, never blocked |
| Volume | music / volume (0 to 100) | capped |
| Mute | button (television / mute) | mutes (volume 0), or unmutes at most at the cap |
| Play, pause | music buttons | through the play/pause toggle, only when it is needed |
| Next, previous | music buttons | refused in standby |
| Playback | music state (read only) | 1 playing, 0 otherwise |
| Source | dropdown | Wi-Fi, Bluetooth, TV, optical, coaxial, analog |
| Now playing | text (read only) | "Artist - Title"; "—" when nothing plays or in standby |
On purpose, no switch: an "everything off" or "everything on" from a voice assistant or a scene neither wakes nor cuts your speakers.
Volume cap
The volume asked from Gladys (dashboard, scene, voice assistant) never goes above the cap of the configuration: a higher volume is set to the cap. The cap is read again just before sending: a new value saved applies at once. The volume set on the speaker itself (remote, app) is not changed, except when Gladys would make it heard:
- Power on, or a source chosen while the speaker is in standby (it wakes it up): the volume is read after the wake-up and lowered to the cap when above it; the check is made again every 2.5 s for about 15 s, and a volume turned up above the cap during those 15 s is lowered too.
- A lowering ignored: a volume sent and not read back (the speaker accepted it and ignored it) is "sent, without confirmation", and the same checks follow for about 15 s.
- Unmute: the mute of this integration is a volume set to 0 (as pykefcontrol does); unmuting sets back the previous volume, at most the cap. A speaker muted by its own remote or app is left alone (the command is refused): unmute it there.
Commands
Every command is answered within 4 seconds (Gladys waits 5 seconds).
- Before each command, the MAC address of the speaker at the address is read again: when another speaker answers there (address changed), nothing is sent and the address is forgotten (type the new one in the configuration). An unreadable answer refuses the command, nothing sent, the address kept.
- A command is confirmed only when the speaker gives back the value asked (power, volume, source, play state); otherwise it is reported "sent, without confirmation". A command that could not leave is reported "nothing sent", and a command still waiting at the end of its 4 seconds is dropped, never sent late.
- Standby and Pause never wait behind another command. Standby cancels the commands still waiting that could wake the speaker (power on, source, play, next, previous); Pause cancels play, next and previous ("cancelled by Standby / Pause, nothing sent"). A Standby not confirmed (for example while the speaker is still waking up from a Power on) is asserted again for about 20 s whenever the speaker reads "on"; a Power on from Gladys ends it.
- Play acts only when paused, Pause only when playing (the KEF API has a toggle only), one toggle at a time per speaker: two Pause presses, or a Pause right after a Play, end paused. Pause waits, within its 4 seconds, for a settled state (buffering ends); Play in another state is refused, nothing sent.
- The order of the requests decides: a Power on asked after a Standby wins (the Standby is no longer asserted again), a Standby asked after a Power on wins. A Mute cancels the volumes asked before it and still waiting.
Reads
- A speaker is read every refresh interval, never sooner: neither the
buttons, nor a Discovery scan, nor a reconnection to Gladys, nor a
configuration saved again, nor a restart of the integration (the time of
the last read is kept in
/data) make it read sooner. - A speaker that does not answer twice in a row shows as off and is named in the integration status; it is then read at spaced intervals (doubled up to 5 minutes).
Configuration buttons
- Find the speakers: reads the addresses whose read is due, then publishes the Discovery list.
- Check the speakers: the last read of each speaker (power, volume, source, how long ago) and the cap in force. It reads nothing.
Data and privacy
The integration asks for no account and no password: the KEF API has none.
It keeps in /data/kef.json the known speakers (MAC address, address, name,
model, the volume replaced by a mute) and the time of the last read of each
address. Nothing leaves your local network.
Known limits
- The KEF API is not documented: its answers may differ on a real speaker or after a firmware update.
- No automatic search on the network yet: type the addresses.
- No equalizer, presets, playlists, repeat or shuffle.
- Never tested with a real device: no real KEF speaker was tried.
Konfigurationseinstellungen
Diese Einstellungen fragt KEF Wireless Speakers in seinem Konfigurationsbildschirm in Gladys ab.
| Einstellung | Typ | Pflichtfeld | Beschreibung |
|---|---|---|---|
| Your KEF speakers, on your local network | section | Nein | Power on, standby, volume, mute, source, play, pause, next, previous and the title playing of each KEF wireless speaker (LS50 Wireless II, LSX II, LSX II LT, LS60; XIO not confirmed), through its local HTTP API, without any cloud. Give each speaker a fixed IP address in your router and type it below: the speakers then appear in the Discovery tab. The volume set from Gladys never goes above the cap below, also when a speaker wakes up or is unmuted. The KEF API is not documented: never tested with a real speaker. Unofficial integration, not affiliated with KEF. |
| IP addresses of the speakers | string | Nein | Separated by commas, for example 192.168.1.50, 192.168.1.51. |
| Volume cap (%) | number | Nein | The highest volume Gladys may set, from 1 to 100 % (100: no cap). A higher volume asked by a scene, a voice assistant or the dashboard is set to this cap; a speaker woken up or unmuted by Gladys is brought back under it. The volume set on the speaker itself (remote, app) is not changed. |
| Refresh interval (s) | number | Nein | How often each speaker is read, from 5 to 300 seconds. A speaker is never read sooner, whatever the buttons or a restart. |
So installierst du KEF Wireless Speakers in Gladys
- Öffne in Gladys Integrationen: KEF Wireless Speakers erscheint im Katalog neben den nativen Integrationen, mit einem Community-Badge.
- Klicke auf Installieren. Gladys lädt das Docker-Image (
ghcr.io/lm1lc3n7/gladys-kef:0.1.2) herunter, startet es in einer vom Kern isolierten Sandbox und erzeugt die Oberfläche der Integration (Geräte, Erkennung und Konfiguration). - Öffne den Bildschirm Konfiguration der Integration, fülle die Einstellungen aus und speichere.
- Du kannst sie auch direkt über die URL ihres Repositorys installieren: https://github.com/LM1LC3N7/gladys-kef.
KEF Wireless Speakers benötigt Gladys >=5.1.0. Der Katalog in Gladys wird stündlich aktualisiert, eine neue Version ist also spätestens eine Stunde nach ihrer Veröffentlichung verfügbar.
Du nutzt Gladys noch nicht? Es ist kostenlos und Open Source: folge der Installationsanleitung, um loszulegen.
Über externe Integrationen
KEF Wireless Speakers ist eine externe Integration: eine Community-Integration, die als Docker-Container verpackt und auf GitHub veröffentlicht wird. Gladys installiert sie mit einem Klick und führt sie in einer vom Kern isolierten Sandbox aus. Sie wird von LM1LC3N7 veröffentlicht und gepflegt, nicht vom Gladys-Kernteam.
- Alle Integrationen durchsuchen, native und aus der Community
- Deine eigene externe Integration bauen und veröffentlichen
- Quellcode auf GitHub — Quelle dieser Dokumentation