Thanks! It's working great now!mvzut wrote:You must fill in the IP address of the Sonos player you want to add. Easiest way to find this is via the Sonos app, under Settings > About my Sonos System.DomoRies wrote:Nice plugin, but what do you need to fill in at ip-adres in Domoticz? Now it's for default 127.0.0.1
Python plugin: Sonos [old version]
Moderator: leecollings
-
- Posts: 14
- Joined: Friday 25 November 2016 22:46
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta
- Location: Netherlands
- Contact:
Re: Python plugin: Sonos
-
- Posts: 443
- Joined: Thursday 12 November 2015 10:55
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta
- Location: The Netherlands
- Contact:
Re: Python plugin: Sonos
The plugin is giving errors like these since the last few beta updates:
Some searching revealed that the onNotification implementation in the Python plugin framework was changed recently:
http://www.domoticz.com/forum/viewtopic.php?t=16151
I now changed these lines in the Sonos plugin.py (lines 194-196)
into
No idea what info from the 7 arguments I should copy to the log, I copied the first 4 for now.
@tester22, maybe you can change this in the GitHub repository?
Code: Select all
2017-02-19 22:30:02.957 Error: (Sonos Laura) 'onNotification' failed 'TypeError':'onNotification() takes 1 positional argument but 7 were given'.
http://www.domoticz.com/forum/viewtopic.php?t=16151
I now changed these lines in the Sonos plugin.py (lines 194-196)
Code: Select all
def onNotification(Data):
Domoticz.Log("Notification: " + str(Data))
return
Code: Select all
def onNotification(name, subject, text, status, priority, sound, image_file):
Domoticz.Log("Notification: " + str(name) + ", subject: " + str(subject) + ", text: " + str(text) + ", status: " + str(status))
return
@tester22, maybe you can change this in the GitHub repository?
Last edited by mvzut on Monday 20 February 2017 11:18, edited 1 time in total.
Raspberry Pi 4 - RFXtrx433 - CC2531 Zigbee - Opentherm Gateway - P1 smart meter - Netatmo - Philips Hue - ELV Max! - ESP8266 DIY water meter - 6 x Sonos - 4 x IP cameras - Wall mounted tablet + Dashticz - Google Home integration - MANY switches/sensors
-
- Posts: 49
- Joined: Tuesday 20 December 2016 17:43
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Location: Sweden
- Contact:
Re: Python plugin: Sonos
Donemvzut wrote:The plugin is giving errors like these since the last few beta updates:
Some searching revealed that the onNotification implementation in the Python plugin framework was changed recently:Code: Select all
2017-02-19 22:30:02.957 Error: (Sonos Laura) 'onNotification' failed 'TypeError':'onNotification() takes 1 positional argument but 7 were given'.
http://www.domoticz.com/forum/viewtopic.php?t=16151
I now changed these lines in the Sonos plugin.py (lines 194-196)intoCode: Select all
def onNotification(Data): Domoticz.Log("Notification: " + str(Data)) return
No idea what info from the 7 arguments I should copy to the log, I copied the first 4 for now.Code: Select all
def onNotification(name, subject, text, status, priority, sound, image_file): Domoticz.Log("Notification: " + str(name) + ", subject: " + str(subject) + ", text: " + str(text) + ", status: " + str(status)) return
@Tester22, maybe you can change this in the GitHub repository?
-
- Posts: 42
- Joined: Wednesday 01 April 2015 11:52
- Target OS: Linux
- Domoticz version: Beta
- Contact:
Re: Python plugin: Sonos
Anyone else having a problem with the Volume Switch of the Sonos Plugin with the latest Beta and Plugin? Or is there something wrong with my configuration
-
- Posts: 3
- Joined: Wednesday 20 January 2016 16:32
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Python plugin: Sonos
It doesnt updates the Sonos volume indeedl00pz wrote:Anyone else having a problem with the Volume Switch of the Sonos Plugin with the latest Beta and Plugin? Or is there something wrong with my configuration
Also I miss the timer functionality to switch off my Play 1 automatically. Is that not possible with switch type media player?
-
- Posts: 49
- Joined: Tuesday 20 December 2016 17:43
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Location: Sweden
- Contact:
Re: Python plugin: Sonos
Strange. Volume is working on my play5 players and on my Sonos connect. Could you enable debug and add the log output to this thread.Pino112 wrote:It doesnt updates the Sonos volume indeedl00pz wrote:Anyone else having a problem with the Volume Switch of the Sonos Plugin with the latest Beta and Plugin? Or is there something wrong with my configuration
Also I miss the timer functionality to switch off my Play 1 automatically. Is that not possible with switch type media player?
Not sure what automatic shutdown means. As soon as the plugin detects that the player is stopped it will change status to off.
-
- Posts: 3
- Joined: Wednesday 20 January 2016 16:32
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Python plugin: Sonos
I updated to the latest beta version and it works now. Thanks.tester22 wrote:Strange. Volume is working on my play5 players and on my Sonos connect. Could you enable debug and add the log output to this thread.Pino112 wrote:It doesnt updates the Sonos volume indeedl00pz wrote:Anyone else having a problem with the Volume Switch of the Sonos Plugin with the latest Beta and Plugin? Or is there something wrong with my configuration
Also I miss the timer functionality to switch off my Play 1 automatically. Is that not possible with switch type media player?
Not sure what automatic shutdown means. As soon as the plugin detects that the player is stopped it will change status to off.
-
- Posts: 9
- Joined: Saturday 28 February 2015 19:52
- Target OS: Raspberry Pi / ODroid
- Domoticz version: V3.6838
- Location: The Netherlands
- Contact:
Re: Python plugin: Sonos
Not be able to add Sonos Player in Hardware
When selecting the Sonos pluging from the Pulldown box and pressing "Add" it's not updated in the hardware overview.
What can be wrong?
***** 2017-03-03 Problem caused by browser Chrome (Versie 56.0.2924.87)
When trying to add the pluging with my Android tablet all worked well.
Difference is that in Chrome the fields for filling in the IP adres etc. were not visible
In Edge there's also no problem to add the plugin in the hardware
......
Domoticz V3.6838 (c)2012-2017 GizMoCuz Build Hash: 895a33a
Startup Path: /home/pi/domoticz/
PluginSystem: Started, Python version '3.4.2'.
Jan
When selecting the Sonos pluging from the Pulldown box and pressing "Add" it's not updated in the hardware overview.
What can be wrong?
***** 2017-03-03 Problem caused by browser Chrome (Versie 56.0.2924.87)
When trying to add the pluging with my Android tablet all worked well.
Difference is that in Chrome the fields for filling in the IP adres etc. were not visible
In Edge there's also no problem to add the plugin in the hardware
......
Domoticz V3.6838 (c)2012-2017 GizMoCuz Build Hash: 895a33a
Startup Path: /home/pi/domoticz/
PluginSystem: Started, Python version '3.4.2'.
Jan
Last edited by HomeAutomation on Saturday 04 March 2017 9:17, edited 1 time in total.
-
- Posts: 443
- Joined: Thursday 12 November 2015 10:55
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta
- Location: The Netherlands
- Contact:
Re: Python plugin: Sonos
Did you fill in the IP address of your Sonos?HomeAutomation wrote:Not be able to add Sonos Player in Hardware
When selecting the Sonos pluging from the Pulldown box and pressing "Add" it's not updated in the hardware overview.
What can be wrong?
Domoticz V3.6838 (c)2012-2017 GizMoCuz Build Hash: 895a33a
Startup Path: /home/pi/domoticz/
PluginSystem: Started, Python version '3.4.2'.
Jan
Raspberry Pi 4 - RFXtrx433 - CC2531 Zigbee - Opentherm Gateway - P1 smart meter - Netatmo - Philips Hue - ELV Max! - ESP8266 DIY water meter - 6 x Sonos - 4 x IP cameras - Wall mounted tablet + Dashticz - Google Home integration - MANY switches/sensors
-
- Posts: 9
- Joined: Saturday 28 February 2015 19:52
- Target OS: Raspberry Pi / ODroid
- Domoticz version: V3.6838
- Location: The Netherlands
- Contact:
Re: Python plugin: Sonos
mvzut wrote:Did you fill in the IP address of your Sonos?HomeAutomation wrote:Not be able to add Sonos Player in Hardware
When selecting the Sonos pluging from the Pulldown box and pressing "Add" it's not updated in the hardware overview.
What can be wrong?
Domoticz V3.6838 (c)2012-2017 GizMoCuz Build Hash: 895a33a
Startup Path: /home/pi/domoticz/
PluginSystem: Started, Python version '3.4.2'.
Jan
No, I did not, because these fields were not visible .
I normaly work with Chrome. When I tried it on my Android tablet and later in Edge these fields were visble and it all worked well.
Jan
-
- Posts: 9
- Joined: Saturday 28 February 2015 19:52
- Target OS: Raspberry Pi / ODroid
- Domoticz version: V3.6838
- Location: The Netherlands
- Contact:
Re: Python plugin: Sonos
How to control Sonos by LUA script
Does anybody have a example how to control the Sonos plugin with a LUA script?
Jan
Does anybody have a example how to control the Sonos plugin with a LUA script?
Jan
-
- Posts: 443
- Joined: Thursday 12 November 2015 10:55
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta
- Location: The Netherlands
- Contact:
Re: Python plugin: Sonos
It's just as if you are controlling a lamp: You can use LUA on/off commands (commandArray['<status device name>'] = 'On') to start/pause a player with the current playlist, and you can use the volume device as if it was a dimmer (using e.g. commandArray['<volume device name>']= 'Set Level 30').HomeAutomation wrote:How to control Sonos by LUA script
Does anybody have a example how to control the Sonos plugin with a LUA script?
Jan
As far as I know the plugin can't be used to e.g. skip to the next song or to start a particular playlist. The virtual remote doesn't work (yet).
Raspberry Pi 4 - RFXtrx433 - CC2531 Zigbee - Opentherm Gateway - P1 smart meter - Netatmo - Philips Hue - ELV Max! - ESP8266 DIY water meter - 6 x Sonos - 4 x IP cameras - Wall mounted tablet + Dashticz - Google Home integration - MANY switches/sensors
-
- Posts: 9
- Joined: Saturday 28 February 2015 19:52
- Target OS: Raspberry Pi / ODroid
- Domoticz version: V3.6838
- Location: The Netherlands
- Contact:
Re: Python plugin: Sonos
Is it really that simple?mvzut wrote:It's just as if you are controlling a lamp: You can use LUA on/off commands (commandArray['<status device name>'] = 'On') to start/pause a player with the current playlist, and you can use the volume device as if it was a dimmer (using e.g. commandArray['<volume device name>']= 'Set Level 30').HomeAutomation wrote:How to control Sonos by LUA script
Does anybody have a example how to control the Sonos plugin with a LUA script?
Jan
As far as I know the plugin can't be used to e.g. skip to the next song or to start a particular playlist. The virtual remote doesn't work (yet).
Thanks, I'll give it a try.
Jan
-
- Posts: 49
- Joined: Tuesday 20 December 2016 17:43
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Location: Sweden
- Contact:
Re: Python plugin: Sonos
Does anyone want features like skip track? My idea have been to use this for automation for example switch on the amplifier when Sonos connect is starting. I have used the Sonos app for everything else.mvzut wrote:As far as I know the plugin can't be used to e.g. skip to the next song or to start a particular playlist. The virtual remote doesn't work (yet).HomeAutomation wrote:Jan
The only remaining feature I am planning is TTS as soon as the plugin have support for providing an url that Sonos players can conect to so they can download data.
-
- Posts: 443
- Joined: Thursday 12 November 2015 10:55
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta
- Location: The Netherlands
- Contact:
Python plugin: Sonos
Skipping tracks etc. is not needed for my purposes. I also primarily use the plugin to activate a Harmony scene (switching on my amp) when my Sonos Connect starts playing. What could be interesting is the ability to start a specific playlist or favourite or radio station. That would enable me to couple e.g. a radio station to a button on my wall mounted tablet running Imperihome, without the need to start the Sonos app.tester22 wrote:Does anyone want features like skip track? My idea have been to use this for automation for example switch on the amplifier when Sonos connect is starting. I have used the Sonos app for everything else.mvzut wrote:As far as I know the plugin can't be used to e.g. skip to the next song or to start a particular playlist. The virtual remote doesn't work (yet).HomeAutomation wrote:Jan
The only remaining feature I am planning is TTS as soon as the plugin have support for providing an url that Sonos players can conect to so they can download data.
Raspberry Pi 4 - RFXtrx433 - CC2531 Zigbee - Opentherm Gateway - P1 smart meter - Netatmo - Philips Hue - ELV Max! - ESP8266 DIY water meter - 6 x Sonos - 4 x IP cameras - Wall mounted tablet + Dashticz - Google Home integration - MANY switches/sensors
-
- Posts: 49
- Joined: Tuesday 20 December 2016 17:43
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Location: Sweden
- Contact:
Re: Python plugin: Sonos
How should that be implemented on in the ui?mvzut wrote:Skipping tracks etc. is not needed for my purposes. I also primarily use the plugin to activate a Harmony scene (switching on my amp) when my Sonos Connect starts playing. What could be interesting is the ability to start a specific playlist or favourite or radio station. That would enable me to couple e.g. a radio station to a button on my wall mounted tablet running Imperihome, without the need to start the Sonos app.tester22 wrote:Does anyone want features like skip track? My idea have been to use this for automation for example switch on the amplifier when Sonos connect is starting. I have used the Sonos app for everything else.mvzut wrote: As far as I know the plugin can't be used to e.g. skip to the next song or to start a particular playlist. The virtual remote doesn't work (yet).
The only remaining feature I am planning is TTS as soon as the plugin have support for providing an url that Sonos players can conect to so they can download data.
A combo button that the user can add Sonos uri (separated by comma) to under preferences or an notification type that can be triggered by scripts?
-
- Posts: 115
- Joined: Sunday 11 January 2015 16:40
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Python plugin: Sonos
TTS would be great!
-
- Posts: 9
- Joined: Saturday 28 February 2015 19:52
- Target OS: Raspberry Pi / ODroid
- Domoticz version: V3.6838
- Location: The Netherlands
- Contact:
Re: Python plugin: Sonos
I agree.RayAmsterdam wrote:TTS would be great!
Just bought my first Sonos Play 1 and allready experience a lot of opportunities for my HomeAutomation
Jan
-
- Posts: 49
- Joined: Tuesday 20 December 2016 17:43
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Location: Sweden
- Contact:
Re: Python plugin: Sonos
Yes, but the options I have seen so far requires the script to download the file and than expose it over http so Sonos can download it and that is not currently possible.HomeAutomation wrote:I agree.RayAmsterdam wrote:TTS would be great!
Just bought my first Sonos Play 1 and allready experience a lot of opportunities for my HomeAutomation
Jan
Also my plan was to use tha asynchronous built in communication layer (haven't been able to get it working thou) and then it is harder to actually know when the player is done playing the message.
-
- Posts: 9
- Joined: Saturday 28 February 2015 19:52
- Target OS: Raspberry Pi / ODroid
- Domoticz version: V3.6838
- Location: The Netherlands
- Contact:
Re: Python plugin: Sonos
Works perfect.mvzut wrote:It's just as if you are controlling a lamp: You can use LUA on/off commands (commandArray['<status device name>'] = 'On') to start/pause a player with the current playlist, and you can use the volume device as if it was a dimmer (using e.g. commandArray['<volume device name>']= 'Set Level 30').HomeAutomation wrote:How to control Sonos by LUA script
Does anybody have a example how to control the Sonos plugin with a LUA script?
Jan
As far as I know the plugin can't be used to e.g. skip to the next song or to start a particular playlist. The virtual remote doesn't work (yet).
Integreated Sonos in my WakeUp alarm.
Now, based on one time setting, I'm able to control my bedroom light (WakeUp), central heating and Sonos.
Still looking for a Alarm clock pluging however. ?
Last edited by HomeAutomation on Sunday 05 March 2017 13:56, edited 1 time in total.
Who is online
Users browsing this forum: Google [Bot] and 1 guest