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 hashes)

Uploaded Source

Built Distribution

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

Uploaded Python 3

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