1. prereqs

yum -y install python3 python3-devel gcc-c++

2. installation

pip3 install -U soco-cli

3. usage

3.1. discover

sonos-discover --subnets 10.1.2.0/24
Sonos Household: Sonos_M1jQTihRoGUIP9EXsaXivFSL27

Room/Zone Name    IP Address    Device Model    Visibility    SW Version
----------------  ------------  --------------  ------------  ------------
91-keuken         10.1.2.91     Play:1          Visible       11.2.13
92/93-living      10.1.2.92     Play:5          Visible       11.2.13
92/93-living      10.1.2.93     Play:5          Hidden        11.2.13
94-veranda        10.1.2.94     Connect         Visible       11.2.13

1 Sonos Household(s) found
4 Sonos device(s) found

Saved speaker data at: /root/.soco-cli/speakers_v2.pickle

3.2. info

sonos keuken info
  balance = (100, 100)
  bass = 10
  cross_fade = True
  display_version = 11.2.13
  grouped_or_paired = True
  hardware_version = 1.8.3.7-2.0
  household_id = Sonos_M1jQTihRoGUIP9EXsaXivFSL27
  ip_address = 10.1.2.91
  is_coordinator = True
  is_playing_line_in = False
  is_playing_radio = False
  is_playing_tv = False
  is_soundbar = False
  is_visible = True
  loudness = True
  mac_address = B8-E9-37-E9-FE-E4
  model_name = Sonos Play:1
  model_number = S1
  mute = False
  night_mode = None
  player_icon = /img/icon-S1.png
  player_name = 91-keuken
  serial_number = B8-E9-37-E9-FE-E4:5
  software_version = 57.9-23290
  state = PAUSED_PLAYBACK
  status_light = True
  title = The good, the bad & the ugly
  treble = 10
  uid = RINCON_B8E937E9FEE401400
  volume = 8
  zone_name = 91-keuken
sonos living info
  balance = (100, 100)
  bass = 10
  cross_fade = True
  display_version = 11.2.13
  grouped_or_paired = True
  hardware_version = 1.16.4.1-2.0
  household_id = Sonos_M1jQTihRoGUIP9EXsaXivFSL27
  ip_address = 10.1.2.92
  is_coordinator = False
  is_playing_line_in = False
  is_playing_radio = False
  is_playing_tv = False
  is_soundbar = False
  is_visible = True
  loudness = True
  mac_address = 00-0E-58-84-1E-08
  model_name = Sonos Play:5
  model_number = S5
  mute = False
  night_mode = None
  player_icon = /img/icon-S5.png
  player_name = 92/93-living
  serial_number = 00-0E-58-84-1E-08:3
  software_version = 57.9-23290
  state = PAUSED_PLAYBACK
  status_light = True
  title =
  treble = 10
  uid = RINCON_000E58841E0801400
  volume = 9
  zone_name = 92/93-living
sonos veranda info
  balance = (100, 100)
  bass = 0
  cross_fade = True
  display_version = 11.2.13
  grouped_or_paired = True
  hardware_version = 1.16.5.5-2.0
  household_id = Sonos_M1jQTihRoGUIP9EXsaXivFSL27
  ip_address = 10.1.2.94
  is_coordinator = False
  is_playing_line_in = False
  is_playing_radio = False
  is_playing_tv = False
  is_soundbar = False
  is_visible = True
  loudness = False
  mac_address = 00-0E-58-A0-02-D4
  model_name = Sonos Connect
  model_number = ZP90
  mute = False
  night_mode = None
  player_icon = /img/icon-ZP90.png
  player_name = 94-veranda
  serial_number = 00-0E-58-A0-02-D4:3
  software_version = 57.9-23290
  state = PAUSED_PLAYBACK
  status_light = True
  title =
  treble = 0
  uid = RINCON_000E58A002D401400
  volume = 100
  zone_name = 94-veranda

3.3. play

sonos keuken pauseplay

4. http

sonos-http-api-server
SoCo-CLI: Starting SoCo-CLI HTTP API Server v0.4.26
SoCo-CLI: Finding speakers ... []
INFO:     Started server process [7505]
INFO:     Waiting for application startup.
INFO:     Application startup complete.
INFO:     Uvicorn running on http://0.0.0.0:8000 (Press CTRL+C to quit)

5. others

http://10.1.2.91:1400/img/icon-S1.png

6. references