Step by step guide: Sonos integration
Moderator: leecollings
- leecollings
- Posts: 167
- Joined: Tuesday 30 June 2015 18:09
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: United Kingdom
- Contact:
Re: Step by step guide: Sonos integration
Yes, you can select just one speaker. Check out the documentation for the full list of commands you can use: https://github.com/jishi/node-sonos-http-api
E.g.
/{Room name}/clip/{filename}[/{announce volume}]
/clipall/{filename}[/{announce volume}]
Examples:
/clipall/sample_clip.mp3
/clipall/sample_clip.mp3/80
/Office/clip/sample_clip.mp3
/Office/clip/sample_clip.mp3/30
E.g.
/{Room name}/clip/{filename}[/{announce volume}]
/clipall/{filename}[/{announce volume}]
Examples:
/clipall/sample_clip.mp3
/clipall/sample_clip.mp3/80
/Office/clip/sample_clip.mp3
/Office/clip/sample_clip.mp3/30
-
- Posts: 18
- Joined: Sunday 20 March 2016 14:31
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Step by step guide: Sonos integration
Works awesome, thanks!!!!leecollings wrote:Hey, you can already do this with the clipall command (if you want to play the announcement through all Sonos devices on your network).Heursqem wrote:This is what I would love to achieve
#1 - Someone pushes my doorbell
#2 - I capture the current state of my sonos player (medium, song, volume etc) and save this for later
#3 - I play my own sound through the sonos player (ding-dong)
#4 - I go back to to captured/saved state and listen to original music again
Would all of this be possible with this solution?
You can handle all of the above by using:(store your mp3 file in /static/clips/)Code: Select all
http://localhost:5005/clipall/name-of-your-mp3.mp3
-
- Posts: 6
- Joined: Tuesday 07 June 2016 23:02
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: Netherlands
- Contact:
Re: Step by step guide: Sonos integration
Sven,ironrider wrote:Hi,
i have to start server.js after a Domoticz reset.
Is ist possible to make the server.js running as a service.
Thanx
Sven
Go to the api directory
Code: Select all
cd node-sonos-http-api
Code: Select all
sudo pm2 start server.js
Code: Select all
sudo pm2 save
Code: Select all
Sudo reboot
Greetz JUNR
RFXcom | Toon | Zware | Sonos |
-
- Posts: 9
- Joined: Friday 15 September 2017 17:33
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Step by step guide: Sonos integration
Hi guys, I'm trying to get this working for my sonos system and got the api working.
problem now is to create that dummy device and switch:
I can create new hardware (1-Wire (System)) but it will not create any devices I can use for the selector.
What am I missing?
problem now is to create that dummy device and switch:
How do I create a dummy device? The device page doesn't allow me to create devices..9. Create a selector switch (create a dummy device and pick selector switch in the list of virtual devices ) according to the below images;
I can create new hardware (1-Wire (System)) but it will not create any devices I can use for the selector.
What am I missing?
-
- Posts: 6
- Joined: Tuesday 07 June 2016 23:02
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: Netherlands
- Contact:
Re: Step by step guide: Sonos integration
RezzZ
Create a Dummy switch in the hardware tab
Make a virtual sensor with Selector Switch.
in the device tab you select the dummy with
Hope it helps.
Greetz Junr
Create a Dummy switch in the hardware tab
Make a virtual sensor with Selector Switch.
in the device tab you select the dummy with
Hope it helps.
Greetz Junr
RFXcom | Toon | Zware | Sonos |
-
- Posts: 9
- Joined: Friday 15 September 2017 17:33
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Step by step guide: Sonos integration
thanks Junr! I totally missed the dummy switch as a hardware device but it is really in the list...
thanks again!
thanks again!
-
- Posts: 9
- Joined: Friday 15 September 2017 17:33
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Step by step guide: Sonos integration
any chance someone has already created a transparant icon set for sonos?
the file from dhanjel (posted 8-6-2016) has white corners, not transparant.
the file from dhanjel (posted 8-6-2016) has white corners, not transparant.
-
- Posts: 13
- Joined: Friday 10 November 2017 20:56
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Step by step guide: Sonos integration
Hi guys.
Im new here and have tried this great solution, but I have wierd problem.
Im running my domoticz installation with https and the switch sends commands in http. Not sure if this is the problem but it doesnt work. If I send the command directly in the browser with http it works, so the api is active. But if I use the exact same link on a selector in domoticz, nothing happends.
Which log can I start searching in for clues?
Thanks in advance for any help.
Im new here and have tried this great solution, but I have wierd problem.
Im running my domoticz installation with https and the switch sends commands in http. Not sure if this is the problem but it doesnt work. If I send the command directly in the browser with http it works, so the api is active. But if I use the exact same link on a selector in domoticz, nothing happends.
Which log can I start searching in for clues?
Thanks in advance for any help.
-
- Posts: 13
- Joined: Friday 10 November 2017 20:56
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Step by step guide: Sonos integration
Edit:royson wrote:Hi guys.
Im new here and have tried this great solution, but I have wierd problem.
Im running my domoticz installation with https and the switch sends commands in http. Not sure if this is the problem but it doesnt work. If I send the command directly in the browser with http it works, so the api is active. But if I use the exact same link on a selector in domoticz, nothing happends.
Which log can I start searching in for clues?
Thanks in advance for any help.
I figured it out. Nothing to do with the encryption fortunately. Domoticz just wasnt able to convert the space in "dining room". All sorted now =)
Next step is adding TTS.
Sent from my LG-H815 using Tapatalk
-
- Posts: 485
- Joined: Thursday 17 September 2015 10:13
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
Re: Step by step guide: Sonos integration
Hi there!
I just had a look at the node-sonos-http-api. I haven't tried it yet, (still waiting for 2 pcs Sonos One to be delivered) but it looks really nice.
I also had a quick look at the LUA script in the initial post. It seems to be a device triggered script so it will run whenever a device changes in Domoticz. That can happen quite often and will put some burden on the Domoticz server for sure.
Looking a bit closer at node-sonos-http-api I see that there is support for a web hook. That sounds promising because using that, Domoticz wouldn't have to do polling the API for changes. Instead Domoticz can be "push noticed" whenever there is a status change. It should be much faster and more efficient than polling. One small problem is that Domoticz currently doesn't have a way to trigger a specific script using the API. Therefore to use the web hook functionality we'd need some software to interpret whats coming in and inform Domoticz about it. That wouldn't be so hard to do.
I've started a nodejs project to intercept events from node-sonos-http-api using web hooks and use them to inform Domoticz. I'll let you know when I have been able to test it in case someone is interested.
I just had a look at the node-sonos-http-api. I haven't tried it yet, (still waiting for 2 pcs Sonos One to be delivered) but it looks really nice.
I also had a quick look at the LUA script in the initial post. It seems to be a device triggered script so it will run whenever a device changes in Domoticz. That can happen quite often and will put some burden on the Domoticz server for sure.
Looking a bit closer at node-sonos-http-api I see that there is support for a web hook. That sounds promising because using that, Domoticz wouldn't have to do polling the API for changes. Instead Domoticz can be "push noticed" whenever there is a status change. It should be much faster and more efficient than polling. One small problem is that Domoticz currently doesn't have a way to trigger a specific script using the API. Therefore to use the web hook functionality we'd need some software to interpret whats coming in and inform Domoticz about it. That wouldn't be so hard to do.
I've started a nodejs project to intercept events from node-sonos-http-api using web hooks and use them to inform Domoticz. I'll let you know when I have been able to test it in case someone is interested.
-
- Posts: 7
- Joined: Tuesday 28 November 2017 18:14
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Step by step guide: Sonos integration
Hi,
I am a beginner started with domoticz 8 weeks ago. Now after all my lights are integrated I am looking for sonos.
Did installation following step by step guide but failed.
Can anyone please help me?
Thanks.
I am a beginner started with domoticz 8 weeks ago. Now after all my lights are integrated I am looking for sonos.
Did installation following step by step guide but failed.
Can anyone please help me?
Thanks.
- Attachments
-
- npm_debug.log.JPG (68.16 KiB) Viewed 6634 times
-
- error2.JPG (35.79 KiB) Viewed 6634 times
-
- Error1.JPG (50.31 KiB) Viewed 6634 times
-
- Posts: 7
- Joined: Tuesday 28 November 2017 18:14
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Step by step guide: Sonos integration
Dear all,
now it runs. Juhu....
now it runs. Juhu....
-
- Posts: 265
- Joined: Monday 05 February 2018 8:42
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 12467
- Location: Netherlands, near Haarlem
- Contact:
Re: Step by step guide: Sonos integration
Heursqem wrote: ↑Wednesday 31 May 2017 13:22But how could I store the actual state, so I can resume after the clipall command?leecollings wrote:Hey, you can already do this with the clipall command (if you want to play the announcement through all Sonos devices on your network).Heursqem wrote:This is what I would love to achieve
#1 - Someone pushes my doorbell
#2 - I capture the current state of my sonos player (medium, song, volume etc) and save this for later
#3 - I play my own sound through the sonos player (ding-dong)
#4 - I go back to to captured/saved state and listen to original music again
Would all of this be possible with this solution?
You can handle all of the above by using:(store your mp3 file in /static/clips/)Code: Select all
http://localhost:5005/clipall/name-of-your-mp3.mp3
I noticed that this is not always working well. I have two sonos-speakers.leecollings wrote: ↑Wednesday 31 May 2017 14:06 It stores the current state within the command. Try it out and you'll see.
I've tested it, with a Play 1 playing a song, it pauses, plays the mp3 file, and then resumes the previously playing song.
If I send a clipall command to the sonoses, the sounds plays well on both speakers, but afterwards the music does not continue where it was. I think the music starts on the playlist from one of the speakers, not always the right one.
But if I send the command to both speakers separately (two links), it works well.
Just for the record
It might be a coding error?
Domoticz 2020.1 (12230) on Raspberry Pi 3B with Raspian Buster. Besides Domoticz, Rpi is running Pi-Hole.
Re: Step by step guide: Sonos integration
Gents, installed in on my Synology NAS, and can start / stop my Sonos speakers via the URL in my browser. But is doesn't start with the selector switch in Domoticz when im using the same url... Fout bij verzenden van schakelaar opdracht, controleer apparaat/hardware!
Anyone?
Thanks
Anyone?
Thanks
-
- Posts: 179
- Joined: Friday 12 July 2013 13:53
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta Ch
- Location: The Netherlands
- Contact:
Re: Step by step guide: Sonos integration
@josimd
Should work. Can you share the url that you use to let it start playing
Should work. Can you share the url that you use to let it start playing
Re: Step by step guide: Sonos integration
Thanks for reply;
in my browser: http://192.168.86.136:5005/woonkamer/play
(small think is when I use http://192.168.86.136:5005/woonkamer/pauze it doesn't stop)
and I use the same in Domoticz;
http://192.168.86.136:5005/woonkamer/play
But then I get the error
in my browser: http://192.168.86.136:5005/woonkamer/play
(small think is when I use http://192.168.86.136:5005/woonkamer/pauze it doesn't stop)
and I use the same in Domoticz;
http://192.168.86.136:5005/woonkamer/play
But then I get the error
-
- Posts: 179
- Joined: Friday 12 July 2013 13:53
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta Ch
- Location: The Netherlands
- Contact:
Re: Step by step guide: Sonos integration
The following url should be changed ;
http://192.168.86.136:5005/woonkamer/pauze
to
http://192.168.86.136:5005/woonkamer/pause
What is the version of Domoticz you are running. Because, some time ago there were some issues with the selector switch. But that has been resolved.
http://192.168.86.136:5005/woonkamer/pauze
to
http://192.168.86.136:5005/woonkamer/pause
What is the version of Domoticz you are running. Because, some time ago there were some issues with the selector switch. But that has been resolved.
Re: Step by step guide: Sonos integration
I'm running on V4.9700 (synology)
-
- Posts: 179
- Joined: Friday 12 July 2013 13:53
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta Ch
- Location: The Netherlands
- Contact:
Re: Step by step guide: Sonos integration
Is new enough.
Can you check again, if your setup similar to the below;
- Attachments
-
- Capture.JPG (211.13 KiB) Viewed 4846 times
Who is online
Users browsing this forum: No registered users and 0 guests