--- id: python-songpal version: "0.16.2" license: GPL-3.0 license_treatment: copyleft maintenance: dormant --- # python-songpal — Python library for interfacing with Sony's Songpal devices License: copyleft · Maintenance: dormant · Downloads: 87.5K/mo ## What it is and what it does python-songpal is a Python 3 library that implements Sony's SongPal protocol, allowing programmatic control of Sony audio devices like soundbars, receivers, and speakers over a network. It uses UPnP discovery to locate devices and communicates via HTTP to their ScalarWebAPI endpoints. The library is built on async I/O (aiohttp and async_upnp_client) and provides both a Python API for integration into scripts or applications and a command-line tool (songpal) for direct device control. The library supports a range of Sony devices including the HT-XT3, HT-ZF9, HT-ST5000, and STR-series receivers. It can control power, volume, input selection, sound settings (night mode, subwoofer level), zones, and grouping. The project is in alpha stage and dormant—last release was 2024-03-31 with a recent commit in December 2024—meaning it works but receives infrequent updates and may not cover all newer Sony devices. Use it for: - Automate power on/off and volume control for a Sony soundbar or receiver from a home automation script. - Switch audio inputs and manage multi-zone playback programmatically in a networked audio setup. - Query device status (power state, volume, active input) from a monitoring or dashboard application. - Create a CLI tool to control Sony audio devices without a remote or mobile app. - Integrate Sony device control into a larger home theater automation system. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Python library for controlling Sony audio devices (soundbars, receivers, speakers) that implement the SongPal protocol over UPnP, with both programmatic and command-line interfaces. Yes, if you own a supported Sony audio device and need programmatic control. The library is stable, has no known vulnerabilities, and low install friction. However, maintenance is dormant—expect no active support for new Sony models or breaking changes in dependencies. Verify your device is in the supported list before committing; if it is, the library is reliable for automation and CLI use. ## Install pip install python-songpal uv add python-songpal poetry add python-songpal ## Installing python-songpal Before you install: Low install friction with a pure-Python wheel. Maintenance is dormant (last release 2024-03-31, last commit 2024-12-17); the project remains functional but receives infrequent updates. Supports Python 3.8 through 3.12. License in practice: GPL-3.0 copyleft license. Any software that uses this library must also be distributed under a compatible open-source license; proprietary or closed-source applications cannot incorporate it. Quickstart: pip install python-songpal from songpal import Device import asyncio async def main(): device = Device('http://192.168.1.1:10000/sony') await device.power.set_power(True) asyncio.run(main()) Requires the device's SongPal endpoint URL (typically discovered via UPnP); device must be on the same network and support the SongPal protocol. Verify before relying: - Whether all listed Sony device models (BDV-N9200W, HT-XT3, STR-DN1080, etc.) are still actively supported or if support has regressed. - Current state of async/await stability and error handling in dormant maintenance state. - Whether aiohttp and async_upnp_client versions are pinned or have known compatibility issues with modern releases. ## Package facts - License: GPL-3.0 (copyleft) - Python support: supports_current - Install friction: low - Maintenance: dormant - Downloads: 87.5K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags sony soundbar control python, songpal protocol library, sony audio device api, upnp device control, sony receiver remote control, home-automation, device-control, async-io [View on SkillFed](https://skillfed.io/packages/python-songpal) · [View on PyPI](https://pypi.org/project/python-songpal/)