Skip to main content

Control a Libratone Zipp speaker with a Python library

Project description

Libratone Zipp controller library in Python

This aims to control a 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.

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

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
    • 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-3.0.0.tar.gz (14.7 kB view details)

Uploaded Source

Built Distribution

python_libratone_zipp-3.0.0-py3-none-any.whl (13.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: python_libratone_zipp-3.0.0.tar.gz
  • Upload date:
  • Size: 14.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.5

File hashes

Hashes for python_libratone_zipp-3.0.0.tar.gz
Algorithm Hash digest
SHA256 0a0176e5f90f6d4fdc2d2ded1b7d21389fcfd09a7f11c5c52d2c5c4f3d51e5a5
MD5 18ac4e98a5ff6b679841389e98830c56
BLAKE2b-256 831a64d8e4ad57c080f3b7e237b10f4b8ba560701cc2f28e276082635bfa05df

See more details on using hashes here.

File details

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

File metadata

  • Download URL: python_libratone_zipp-3.0.0-py3-none-any.whl
  • Upload date:
  • Size: 13.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.5

File hashes

Hashes for python_libratone_zipp-3.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9745fbed4f8a517edf117eacf9f8ba0b3076b1f13ef53e68d2d29d15c9f4fa3f
MD5 be0c12665f4b3d82f3bc9da72c25d1ed
BLAKE2b-256 4b76100836588a401ac78b843b6171d3647fc4e71872b93ba1127056652ed97c

See more details on using hashes here.

Supported by

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