This is the forum archive of Homey. For more information about Homey, visit the Official Homey website.
The Homey Community has been moved to https://community.athom.com.
This forum is now read-only for archive purposes.
The Homey Community has been moved to https://community.athom.com.
This forum is now read-only for archive purposes.
Better Sonos support for Homey through raspberry pi
Jschuetz
Member
Hey everyone,
homeys Sonos support is very limited. But i find a good solution to control my sonos speakers with homey and node-sonos-http-api. Now i can set playlists, favourites or let my sonos speakers say something in many languages. It's very cool!
Cause now i can turn my sonos speakers completely off without loosing the favourites. Or i can use all my speakers in my house to remind me. Here you can use the remind tags.
homeys Sonos support is very limited. But i find a good solution to control my sonos speakers with homey and node-sonos-http-api. Now i can set playlists, favourites or let my sonos speakers say something in many languages. It's very cool!
Cause now i can turn my sonos speakers completely off without loosing the favourites. Or i can use all my speakers in my house to remind me. Here you can use the remind tags.
Comments
On my PI
git clone https://github.com/jishi/node-sonos-http-api node-sonos-http-api
cd node-sonos-http-api
npm install --production
npm start
Now you can control your system by invoking the following commands:
The actions supported as of today:
After that you have to choose your TTS Provider.
Experimental support for TTS. Today the following providers are available:
I am using the voicerss. For this you have to register for the free api key. Then you create a settings.json in your node-http path.
Change your API key in the json file.
After that you can use the http app of homey.
One example flow for music in my bath room:
For the play part i have set an delay of 1 second. This is necessary to give the sonos first the playlist. Cause it was powered off and if this happens the speaker will loose the last position. This is default you can try it with your own speaker, turn the power complete off and then connect it again with the socket and push play. Nothing will happens cause the speaker must have a queue. And a queue will only saved in the speaker standby modus.
But with the http get command i give him a radio station. Attention: You must have favourites in your sonos app.
http://192.168.10.110:5005/bad/favorite/Hellweg Radio
I have many sonos speakers and the standby power consumption should not be underestimated. Thats the reason why i turn some of them complete off.
But thats not all, you can use the commands sayall for textspeech on all zones or clipall (own mp3 file) without to group them first. If you wanna use one of this commands only on one zone you can use:
http://192.168.10.110:5005/Wohnzimmer/say/Essen ist fertig /de-de
http://192.168.10.110:5005/Büro/say/Essen ist fertig /de-de
for voicerss:
hostname:5005/roomName/say/Text to speech or with tag/languageCode
I don't testet the json part of the http homey app. But normaly you should be able to ask homey about the song in room xxx and with the http homey app you can ask the node-http-api for the current track.
Documentation:
https://github.com/jishi/node-sonos-http-api
And do I understand it right, that it makes it possible to play radio? Not only favourites/playlists?
on my rasp 3 i did the following
To somebody with absolutely no experience in raspberry and coding in general it is a bit of a challenge and rather timeconsuming to get an overview and figure out what to do (even with all the help everybody provide - and thank you for that!).
I'm running "Telmore Music" (part of my cellphone subscription...)
i would love to control my Sonos like my otter devices, without the Homey Sonos app which takes over the control of the Sonos media manager (what because of multiple reasons I don’t want).
There is the HTTP app and the Homeyscript app. Did someone test if you can control Sonos with it, without using the raspberry pi setup?
That would be perfect and give much more control with Sonos