pywam
pywam is an fast and lightweight python asyncio library without external dependencies for communicating with Samsung Wireless Audio (R) speakers (WAM). It was developed to be used for integrating the speakers in Home Assistant with the Samsung Wireless Audio Integration
[!IMPORTANT] This library only supports speakers that can be controlled by the Wireless Audio-Multiroom (Android) or Wireless Audio : Multiroom (iOS). This library will never support speakers not supported by the native Multiroom App. Check src/pywam/device.py to see which speakers are tested and which are believed to work.
Features
- Control Samsung Multiroom speakers.
- Keep track of the state of Samsung Multiroom speakers.
Limitations
The SetUrlPlayback API used to get the speakers playing url streams is only partially implemented in the speakers. I have found information that not all speakers accept it, and the one that does will only play the url. The speaker will not report that it is playing a url. This means that as soon as the speakers is asked for current state it will report that it is not playing anything, which this library will pick up and believe to be true.
Installation
pip install pywam
Usage
Set the speaker volume to 50% with python context manager:
from pywam.speaker import Speaker
async with Speaker('192.168.1.100') as speaker:
await speaker.update()
await speaker.set_volume(50)
Example of controlling media playback:
# Play
await speaker.cmd_play()
# Pause
await speaker.cmd_pause()
# Shuffle mode
await speaker.set_shuffle(True)
Example of playing a url stream:
from pywam.lib.url import UrlMediaItem
item = UrlMediaItem('http://live-bauerse-fm.sharp-stream.com/retrofm_mp3')
await speaker.play_url(item)
Example of group handling:
from pywam.speaker import Speaker
kitchen = Speaker('192.168.1.50')
await kitchen.connect()
await kitchen.update()
bedroom = Speaker('192.168.1.51')
await bedroom.connect()
await bedroom.update()
bathroom = Speaker('192.168.1.52')
await bathroom.connect()
await bathroom.update()
# Group bathroom with kitchen as master
await kitchen.group([], [bathroom])
# Add bedroom to the group
await kitchen.group([bathroom], [bathroom, bedroom])
# Remove bathroom from group
await kitchen.group([bathroom, bedroom], [bedroom])
# Ungroup
await kitchen.group([bedroom], [])
Get notifications about speakers state changes:
from pywam.speaker import Speaker
def state_receiver(event):
print(event)
speaker = Speaker('192.168.1.150')
speaker.events.register_subscriber(state_receiver, 2)
await speaker.connect()
await speaker.update()
For more examples please check the Samsung Wireless Audio Integration
Contribute
- Find a bug or something to improve? Please file a issue at https://github.com/Strixx76/pywam/issues
- Want to contribute with code? Check the source at https://github.com/Strixx76/pywam
Roadmap
- There are some TODO's in the source that should be fixed.
- Better workaround for play_url to show correct state when url streams are played.
- I would also like to change all the API keys and values strings in both the event receiver and the state machine to string enums.
- Make the code less complex.
- Add more API calls.
Style guide
PEP8 and Google styled PEP257. But none of them is strictly enforced.
License
The project is licensed under the MIT License.
Disclaimer Notice
I have tested all functions in this library on all of my Samsung Multiroom speakers, and the worst that has happened is that speakers froze when receiving faulty calls. A simple power cycle would solve it. But I CAN’T guarantee that your speaker is compatible with this library, and you can’t hold me responsible if you brick your speaker when using this library.
Versioning and Changelog
This project uses Semantic Versioning. The changelog format is based on Keep a Changelog
Credits
This project would not have been possible without, but not limited to, the following projects:
- Samsung Wireless Audio Multiroom (WAM) Research, Moosy Research
- WAM_API_DOC, Bruno Lopes
- com.samsung.wam, Bjørnar Almli
- Hubitat-Samsung-WiFi-Audio, David Gutheinz
- Samsung Multiroom (WIP), Krystian Galutowski
- SamsungNotify, Moengiant
Support the work
If you find this library useful please consider a small donation to show your appreciation.
Release files for pywam 0.2.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pywam-0.2.2.tar.gz | 45.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pywam-0.2.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 97.7 kB
Release files / pywam-0.2.2.tar.gz
| Download URL | pywam-0.2.2.tar.gz |
|---|---|
| Size | 45.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9ba322af530089b8b4dda886620e0fe63658f5320e609d1421c242a3474737eb
|
|
BLAKE2b-256 checksum How to use checksums |
570e2aa3d12f903b623c6765e1ca7c9fbaa27fb123442308f01c4b673f5e7167
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 10, 2026.
Transparency logRelease files / pywam-0.2.2-py3-none-any.whl
| Download URL | pywam-0.2.2-py3-none-any.whl |
|---|---|
| Size | 51.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9657f336511ef239af8dedc6109d8ce82642a77fa502f83e83273e957c098cfb
|
|
BLAKE2b-256 checksum How to use checksums |
234e726d56b9f16351a1310ad3af7cf3c8fef8e918a5d17fd874d7f63a709f71
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 10, 2026.
Transparency log