PHPackages                             hubware-house/sonos - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. hubware-house/sonos

ActiveLibrary[API Development](/categories/api)

hubware-house/sonos
===================

SONOS library

201PHP

Since Sep 26Pushed 7y ago1 watchersCompare

[ Source](https://github.com/hubwareHouse/sonos)[ Packagist](https://packagist.org/packages/hubware-house/sonos)[ RSS](/packages/hubware-house-sonos/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependenciesVersions (2)Used By (0)

SONOS Cloud API
===============

[](#sonos-cloud-api)

SONOS Control API implementation for PHP ( see  fore more information)

powered by [hubware](http://hubware.house) smart home factory

Please note: This library is work in progress. Some parts of the API are already implemented, some are pending. The authentication is using the new cloud-based redirect and callback urls. You need to have public reachable urls to get the necessary OAuth2 tokens.

License: MIT

Feel free to clone, improve and create pull requests. All code submitted to the project must be licensed under MIT license.

Preparation
-----------

[](#preparation)

- Register yourself an account at
- Add a new integration and a new the client credential using a key.

Using it
--------

[](#using-it)

In the tests/web directory are some files to get started

- Copy \_\_config.php.dist to \_\_config.php and fill in all-ready known values (oauth client id + secret).
- Copy the \_\_api.php and \_\_api\_receiver.php to a public available url and configure them in the SONOS api console. They must be reachable when you call them in your browser! Localhost is not accepted by SONOS.
- Run api\_auth\_1\_create\_access.php - login to the SONOS account using OAuth2 and be redirected to the \_\_api.php script. Fill in the necessary information into your \_\_config.php script.
- Run api\_auth\_2\_create\_token.php - same here, you are redirected to \_\_api\_receiver.php and see in your browser the access and refresh token. Copy + paste into \_\_config.php again.
- Now you can play with your SONOS devices:
    - test\_player.php to control some player + group devices over the SONOS cloud (quite fast)
    - test\_callback.php to receive event callbacks by the SONOS cloud to your system (e.g. change volume on the player, or using the SONOS app); the latency of these callbacks is quite slow and really usable (5-10 seconds on average during the evaluation time in September 2018).

Hacking it
----------

[](#hacking-it)

- A lot of stuff is not yet finished. Please have a look at the src/ directory to see the code and improve it.
- The cloud event callbacks are not implemented yet.
- The OAuth2 registration process with the registered, public reachable callback urls are really a pain. If you can improve it, please do so. :-)
- Create a pull request with clean code, added automated tests and logs that can be used to test against (without your private information).
- Spread the word.

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2651934?v=4)[Tobias Kluge](/maintainers/tobiaskluge)[@tobiaskluge](https://github.com/tobiaskluge)

---

Top Contributors

[![tobiaskluge](https://avatars.githubusercontent.com/u/2651934?v=4)](https://github.com/tobiaskluge "tobiaskluge (4 commits)")

---

Tags

apiphpsonossonos-apisonos-connectsonos-controller

### Embed Badge

![Health badge](/badges/hubware-house-sonos/health.svg)

```
[![Health](https://phpackages.com/badges/hubware-house-sonos/health.svg)](https://phpackages.com/packages/hubware-house-sonos)
```

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M187](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

263103.1M454](/packages/google-gax)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
