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.
- Control Samsung Multiroom speakers.
- Keep track of the state of Samsung Multiroom speakers.
pip install pywam
Set the speaker volume to 50% with python context manager:
from pywam.speaker import Speaker
async with Speaker('192.168.1.100') as speaker:
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)
Get notifications about speakers state:
from pywam.speaker import Speaker
def state_receiver(event):
print(event)
speaker = Speaker('192.168.1.150')
speaker.events.register_subscriber(state_receiver, 2)
speaker.connect()
speaker.update()
- Issue Tracker: https://github.com/Strixx76/pywam/issues
- Source Code: https://github.com/Strixx76/pywam
PEP8 and Google styled PEP257. But none of them is strictly enforced.
The project is licensed under the MIT License.
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, and needed a hard reset. 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.
This project uses Semantic Versioning. The changelog format is based on Keep a Changelog
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