Link Search Menu Expand Document

Sonos2mqtt

Sonos2mqtt npm Sonos api documentation Sonos typescript this library Sonos cli

github issues docker pulls Downloads/week License Support me on Github All Contributors

This node application is a bridge between the Sonos and a mqtt server. The status of all your sonos devices will be published to mqtt and you can control the sonos speakers over mqtt.

This library is in no way connected to Sonos. It’s just a library to control their speakers from your mqtt server.

Key features

  • Using local push for immediate state changes.
  • Talking straight to the sonos device (no cloud involved).
  • Supporting all sonos actions

Documentation


Sonos library (typescript/node)

This app uses node-sonos-ts to talk to the sonos speakers. And can easily be integrated in all kind of other apps.

Text-to-speech server

sonos-tts-polly is a perfect companion for this library. It will act as a text-to-speech server. Generating mp3s for some text and playing it on all your speakers.

All sponsors get a hosted TTS endpoint, for instant text to speech support.

Sonos CLI

Not really an mqtt guy/girl? I also created a small sonos cli to control your speakers from the command line.

npm i -g @svrooij/sonos-cli
sonos control office next

Beer or Coffee

I’m a big fan of beer and coffee. To provide something extra to everybody who is sponsoring me, I’ll provide a hosted TTS server for all my sponsors.

This bridge and the sonos package took me a lot of hours to build, so I invite everyone using it to at least have a look at my Sponsor page. Even though the sponsoring tiers are monthly you can also cancel anytime :wink:

Special thanks

The latest version of this bridge is inspired on hue2mqtt.js by Sabastian Raff. That was a great sample on how to create a globally installed, command-line, something2mqtt bridge.

Contributors ✨

Thanks goes to these wonderful people (emoji key):

This project follows the all-contributors specification. Contributions of any kind welcome!