Skip to main content

Control one or multiple Libratone Zipp speakers with a Python library

Project description

Libratone Zipp controller library in Python

This aims to control one or multiple Libratone Zipp speaker with a Python library, potentially usable in Home Assistant with this module.

Install it with pip install python-libratone-zipp - pip page

Tested with Libratone Zipp 1, firmware 809, 879.

Usage

See example in CLI.py. You have to be able to listen to 3333/udp and 7778/udp!

Other files:

  • Test_SendCommandReceiveMessage.py is used to shoot one command for tests purposes.
  • Test_LibratoneMessage.py is to check LibratoneMessage class against a real message
  • Test_Sockethub.py is to check if you can recieve information from multiple speakers at once

Functionality coverage

I'm currently happy with this coverage, so don't expect any updates other than maintenance.
The only thing I'm very interested is defining Favorites!

  • Module
    • Clean text variables, declare variable on top instead of using text like "play"
    • Create a Command Line Interface - CLI client
    • Publish on PyPi
    • Handle exit properly - but need max _KEEPALIVE_CHECK_PERIOD seconds to exit
    • Make the module usable with multiple speaker
    • Use discovery method instead of fixed IP
    • Make the module compatible with async from Home Assistant
  • Playback status with Spotify & Radio
    • Retrieve basic playback status: play, pause, stop
    • Retrieve volume
    • Retrieve current playback source
    • Retrieve current title
    • Retrieve mute status - but no logic implemented!
  • Playback with Bluetooth or USB
    • Retrieve basic playback status: play, pause, stop
    • Retrieve media type: Bluetooth, aux, radio, ...
    • Retrieve extended playback status: shuffle, repeat
    • Set extended playback status: shuffle, repeat
  • Playback control
    • Set basic playback status: play, pause, stop, next, prev
    • Set volume
  • Standby
    • Retrieve actual speaker state
    • Calculate actual speaker state: UNKOWN, SLEEPING, ON, PLAYING, PAUSED, STOPPED
    • Set to immediate standby and wakeup
    • Set a standby timer
    • Retrieve the defined duration of the standby timer
    • Calculate the actual standby timer
  • Voicing & Room Setting
    • Set a Voicing
    • Retrieve active Voicing
    • Retrieve all Voicing
    • Set Room Setting
    • Retrieve current Room Setting
    • Retrieve all Room
  • Favorites
    • Play a Favorite
    • List configured favorite but no processing (_channel_json)
    • Set a Favorite
  • Extended current playback info
    • Set Source
    • Retrieve current source
  • Speaker configuration
    • Retrieve current firmware
    • Retrieve speaker name
    • Retrieve speaker color
    • Set speaker name
    • Map out color codes + Set speaker color
    • Retrieve current serial number
    • Retrieve current battery level
    • Retrieve AC information
  • Network
    • Retrieve current IP
    • Retrieve current Wi-Fi configuration
    • Retrieve current Wi-Fi information
    • Set Wi-Fi configuration
  • Multi-room
    • Implement SoundSpace Link

Unimplemented commands

Following commands where identified but not implemented and/or implemented but not processed due to lack on data investigation. The list is not exhaustive!

From Android application, com.libratone.model.LSSDPNode:

command function notes
10 fetchSourceInfo
103 fetchDeviceState
152 fetchSource
281 fetchMusicServiceCapability Answer a JSON
304 fetchLimitedFunctionList Answer 3 bytes
520 fetchMuteStatus Implemented but not processed
530 fetchOtaAutoDownLoadStatus
537 fetchWifiLinein
1284 fetchChargingStatus Implemented but not processed
1285 fetchPrivateMode
1536 fetchUsbCurrentPlayId
1537 fetchUsbPlayMode
1538 fetchUsbSongInfo

Acknowledgment

This work is based on the following:

License

See LICENSE file

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

python_libratone_zipp-4.1.0.tar.gz (16.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

python_libratone_zipp-4.1.0-py3-none-any.whl (16.0 kB view details)

Uploaded Python 3

File details

Details for the file python_libratone_zipp-4.1.0.tar.gz.

File metadata

  • Download URL: python_libratone_zipp-4.1.0.tar.gz
  • Upload date:
  • Size: 16.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for python_libratone_zipp-4.1.0.tar.gz
Algorithm Hash digest
SHA256 96f61fda33586df6a9337e825bcaf7f2a86678d799d4de3fb8abe528ab37404c
MD5 74cef7a69f02f90fd1c877efabfcbef3
BLAKE2b-256 1b2ab0053db288aeefbc50ccb5d9324342ffe84732ca442bdf7bf3ed8684e499

See more details on using hashes here.

File details

Details for the file python_libratone_zipp-4.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for python_libratone_zipp-4.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f9f7ea5550daa9ea363598733befcab3eee9e8334a3427a1c0691bf196b7dac8
MD5 695e2884ed90e0f8f8754b29845b9f1b
BLAKE2b-256 863891f1486972e1267059bd0a8ce3c0530d7d3cc4f782effd9e949b7d886181

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page