Python plugin: Sonos [new version]

Python and python framework

Moderator: leecollings

Rodio
Posts: 39
Joined: Thursday 16 April 2015 10:18
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python plugin: Sonos [new version]

Post by Rodio »

OK

Again, thx for the good work.
I'm really happy with this plugin 8-) 8-)

GrR
Quax1507
Posts: 101
Joined: Tuesday 07 April 2015 21:29
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python plugin: Sonos [new version]

Post by Quax1507 »

I tried the plugin today. Configured IP of Sonos.
Radio list was discovered correctly.

Sonos does not react on any change of the created devices.

Here is the debug output after changing volume (no volume was changed at the Sonos box):

Code: Select all

2018-01-16 17:56:34.995  (Sonos) Sonos mute status: 0
2018-01-16 17:56:35.015  (Sonos) Update Sonos - Control: 0 - '0'
2018-01-16 17:57:01.620  (Sonos) Calling message handler 'onCommand'.
2018-01-16 17:57:01.620  (Sonos) onCommand called for Unit 2: Parameter 'Set Level'
2018-01-16 17:57:04.927  (Sonos) Calling message handler 'onHeartbeat'.
2018-01-16 17:57:04.941  (Sonos) <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><s:Body><u:GetTransportInfoResponse xmlns:u="urn:schemas-upnp-org:service:AVTransport:1"><CurrentTransportState>PLAYING</CurrentTransportState><CurrentTransportStatus>OK</CurrentTransportStatus><CurrentSpeed>1</CurrentSpeed></u:GetTransportInfoResponse></s:Body></s:Envelope>
2018-01-16 17:57:04.942  (Sonos) <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><s:Body><u:GetTransportInfoResponse xmlns:u="urn:schemas-upnp-org:service:AVTransport:1"><CurrentTransportState>PLAYING</CurrentTransportState><CurrentTransportStatus>OK</CurrentTransportStatus><CurrentSpeed>1</CurrentSpeed></u:GetTransportInfoResponse></s:Body></s:Envelope>
2018-01-16 17:57:04.942  (Sonos) Sonos state: PLAYING
2018-01-16 17:57:04.953  (Sonos) Update Sonos - Control: 1 - '0'
2018-01-16 17:57:04.967  (Sonos) <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><s:Body><u:GetPositionInfoResponse xmlns:u="urn:schemas-upnp-org:service:AVTransport:1"><Track>1</Track><TrackDuration>NOT_IMPLEMENTED</TrackDuration><TrackMetaData>NOT_IMPLEMENTED</TrackMetaData><TrackURI>x-rincon:RINCON_7828CA24905201400</TrackURI><RelTime>NOT_IMPLEMENTED</RelTime><AbsTime>NOT_IMPLEMENTED</AbsTime><RelCount>2147483647</RelCount><AbsCount>2147483647</AbsCount></u:GetPositionInfoResponse></s:Body></s:Envelope>
2018-01-16 17:57:04.967  (Sonos) <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><s:Body><u:GetPositionInfoResponse xmlns:u="urn:schemas-upnp-org:service:AVTransport:1"><Track>1</Track><TrackDuration>NOT_IMPLEMENTED</TrackDuration><TrackMetaData>NOT_IMPLEMENTED</TrackMetaData><TrackURI>x-rincon:RINCON_7828CA24905201400</TrackURI><RelTime>NOT_IMPLEMENTED</RelTime><AbsTime>NOT_IMPLEMENTED</AbsTime><RelCount>2147483647</RelCount><AbsCount>2147483647</AbsCount></u:GetPositionInfoResponse></s:Body></s:Envelope>
2018-01-16 17:57:05.006  (Sonos) <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><s:Body><u:GetVolumeResponse xmlns:u="urn:schemas-upnp-org:service:RenderingControl:1"><CurrentVolume>10</CurrentVolume></u:GetVolumeResponse></s:Body></s:Envelope>
2018-01-16 17:57:05.007  (Sonos) <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><s:Body><u:GetVolumeResponse xmlns:u="urn:schemas-upnp-org:service:RenderingControl:1"><CurrentVolume>10</CurrentVolume></u:GetVolumeResponse></s:Body></s:Envelope>
2018-01-16 17:57:05.007  (Sonos) Sonos volume: 10
2018-01-16 17:57:05.020  (Sonos) <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><s:Body><u:GetMuteResponse xmlns:u="urn:schemas-upnp-org:service:RenderingControl:1"><CurrentMute>0</CurrentMute></u:GetMuteResponse></s:Body></s:Envelope>
2018-01-16 17:57:05.021  (Sonos) <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><s:Body><u:GetMuteResponse xmlns:u="urn:schemas-upnp-org:service:RenderingControl:1"><CurrentMute>0</CurrentMute></u:GetMuteResponse></s:Body></s:Envelope>
2018-01-16 17:57:05.021  (Sonos) Sonos mute status: 0
2018-01-16 17:57:05.032  (Sonos) Update Sonos - Control: 0 - '0'
Any hints?
Quax1507
Posts: 101
Joined: Tuesday 07 April 2015 21:29
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python plugin: Sonos [new version]

Post by Quax1507 »

Plugin works when Sonos in *not* grouped!

After grouping a second Sonos it does not work anymore :(

Any idea to fix that?
Rodio
Posts: 39
Joined: Thursday 16 April 2015 10:18
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python plugin: Sonos [new version]

Post by Rodio »

Boehoehoe

2018-01-19 19:14:14.020 (Sonos Woonkamer) Calling message handler 'onHeartbeat'.
2018-01-19 19:14:14.139 (P1) P1 Smart Meter (P1 - Power)
2018-01-19 19:14:16.517 (P1) General/Voltage (Voltage L1)
2018-01-19 19:14:17.175 Error: (Sonos Woonkamer) Sonos not available ([Errno 113] No route to host)

Not working anymore :shock: :shock:
Reboot doesn't help.
As far as I know I didn't change/install anything.
Anyone got an idea?

Thx
R
Rodio
Posts: 39
Joined: Thursday 16 April 2015 10:18
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python plugin: Sonos [new version]

Post by Rodio »

mhhhhh,

Looks like I did install something :?
Python was on 2.7.9 and is now on 3.4.2.
Could this be the problem?

edit:
On the terminal:
pi@raspberrypi:~/domoticz/plugins/sonos $ python
Python 2.7.9 (default, Sep 17 2016, 20:26:04)

But during startup in the Domo logfiles it reports 3.4.2
d3rax
Posts: 14
Joined: Thursday 25 February 2016 20:16
Target OS: -
Domoticz version:
Contact:

Re: Python plugin: Sonos [new version]

Post by d3rax »

Hi,

I'm running domoticz Version 3.8153 (July 30h 2017) on my raspberry pi.

I first installed python 3 using these commands:

sudo apt-get install -y python3

sudo apt-get install -y python3-dev

After that I installed the plugin using these commands:

cd domoticz/plugins
git clone https://github.com/gerard33/sonos.git

cd domoticz/plugins/sonos
git pull

Then I add the my Sonos One in the hardware tab and configure it. Everything works then works perfectly. Alle the switches and sliders work, the radio channels work and the mp3 notifications work.

It has been running stable for a few days, but the problems begin when I restart my Pi. After restarting I get the domoticz 'offline' screen, restarting does not work. The only way to get domoticz working again is renaming the plugin folder, e.a. disableing the plugins.

I don't really have an idea how to solve this. I did notice that my python version is at 2.7.9. I don't know why but I'm not able to get a higher version of python? Really hope you guys have a suggestion, I really like the plugin!

Small update:
Instead of renaming the plugin folder i renamed the folder AwoxSMP in the plugin folder. I don't know what this plugin does, but after I rebooted, domoticz came back online AND the sonos plugin works! But I would like know whats going on here, hope there are some suggestions!
junr
Posts: 6
Joined: Tuesday 07 June 2016 23:02
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Netherlands
Contact:

Re: Python plugin: Sonos [new version]

Post by junr »

Hello,

Domoticz reported an error in the log.

domoticz version: V3.9030
HELP!

2018-03-11 18:33:00.223 Error: (Sonos) Unexpected response status received in function sendMessage (500, Internal Server Error). The following command is sent: urn:schemas-upnp-org:service:AVTransport:1#Play, /MediaRenderer/AVTransport/Control
2018-03-11 18:33:00.231 Error: Notification NOT handled, please report on GitHub!
2018-03-11 18:33:00.231 (Sonos) Update Sonos - Status: 1 - 'Off'
2018-03-11 18:33:00.237 Error: Notification NOT handled, please report on GitHub!
2018-03-11 18:33:00.238 (Sonos) Update Sonos - Volume: 2 - '10'
2018-03-11 18:33:00.245 Error: Notification NOT handled, please report on GitHub!
2018-03-11 18:33:00.246 (Sonos) Update Sonos - Control: 1 - '0'
2018-03-11 18:33:08.377 User: Admin initiated a switch command (735/Sonos - Radio/Set Level)
2018-03-11 18:33:08.414 (Sonos) Radio 10, x-sonosapi-stream:s16793?sid=254&flags=8224&sn=0
2018-03-11 18:33:14.577 Error: Notification NOT handled, please report on GitHub!
2018-03-11 18:33:14.578 (Sonos) Update Sonos - Status: 1 - 'Radio 10 - Snow Patrol - Just Say Yes'
2018-03-11 18:33:14.586 Error: Notification NOT handled, please report on GitHub!

Greetz Jorgen
RFXcom | Toon | Zware | Sonos |
mvzut
Posts: 443
Joined: Thursday 12 November 2015 10:55
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: The Netherlands
Contact:

Python plugin: Sonos [new version]

Post by mvzut »

I have the same... Reverted to a previous version which doesn't give these messages.
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
d3rax
Posts: 14
Joined: Thursday 25 February 2016 20:16
Target OS: -
Domoticz version:
Contact:

Re: Python plugin: Sonos [new version]

Post by d3rax »

d3rax wrote: Thursday 22 February 2018 21:01 Small update:
Instead of renaming the plugin folder i renamed the folder AwoxSMP in the plugin folder. I don't know what this plugin does, but after I rebooted, domoticz came back online AND the sonos plugin works! But I would like know whats going on here, hope there are some suggestions!
Renaming the AwoxSMP folder did not work for me either. After a reboot, domoticz does not come back online. Only thing that helps is renaming the plugin folder and reboot.

Does any one else have this issue?
mvzut
Posts: 443
Joined: Thursday 12 November 2015 10:55
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: The Netherlands
Contact:

Python plugin: Sonos [new version]

Post by mvzut »

mvzut wrote:I have the same... Reverted to a previous version which doesn't give these messages.
Changing to the last beta seems to have solved it for me.
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
josimd
Posts: 59
Joined: Saturday 09 January 2016 19:47
Target OS: -
Domoticz version:
Contact:

Re: Python plugin: Sonos [new version]

Post by josimd »

Hi Gerard, this plugin does not work anymore in version 4.9700 do you have an idea how to solve?

Many thanks!
User avatar
leecollings
Posts: 167
Joined: Tuesday 30 June 2015 18:09
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: United Kingdom
Contact:

Re: Python plugin: Sonos [new version]

Post by leecollings »

Hey all,

Can anyone give a status update as to the roadmap for this eventually being added to the stable release?
mvzut
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 [new version]

Post by mvzut »

leecollings wrote:Hey all,

Can anyone give a status update as to the roadmap for this eventually being added to the stable release?
I don't think Python plugins are intended to be added to a release. The plugin works fine by the way in the betas.
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
User avatar
leecollings
Posts: 167
Joined: Tuesday 30 June 2015 18:09
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: United Kingdom
Contact:

Re: Python plugin: Sonos [new version]

Post by leecollings »

Okay, sorry I didnt' mean to the release of Domoticz, I meant to be included in the dropdown of hardware on the stable version. What needs to happen for that?
mvzut
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 [new version]

Post by mvzut »

leecollings wrote:Okay, sorry I didnt' mean to the release of Domoticz, I meant to be included in the dropdown of hardware on the stable version. What needs to happen for that?
Python plugins only appear when you manually add the files to the plugin folder. Usually with some sort of git pull command, this is normally explained in the corresponding forum topic. Or alternatively with the plugin manager (which is a plugin in itself). Only a few examples are included in the plugin folder by default.

If you want a plugin to become part of the default list of hardware that is embedded in Domoticz, it should be completely rewritten in C and included in the beta versions first. But the whole point of Python plugins was that this much more complicated route would not be necessary anymore.
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
User avatar
leecollings
Posts: 167
Joined: Tuesday 30 June 2015 18:09
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: United Kingdom
Contact:

Re: Python plugin: Sonos [new version]

Post by leecollings »

So is this plugin ready to be pulled into the stable version of Domoticz yet, or not? You still haven't made it clear if it's ready for use or not...
mvzut
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 [new version]

Post by mvzut »

leecollings wrote:So is this plugin ready to be pulled into the stable version of Domoticz yet, or not? You still haven't made it clear if it's ready for use or not...
No, even though I am not the author I am pretty sure it will not become part of a stable version, simply because no Python plugin has ever been included in a stable version. But it's very much ready for use! Just follow the installation instructions and start using it, like I did a couple of months ago.
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
User avatar
leecollings
Posts: 167
Joined: Tuesday 30 June 2015 18:09
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: United Kingdom
Contact:

Re: Python plugin: Sonos [new version]

Post by leecollings »

Okay, forget about it being included in the stable release, I accept that's not what I meant.

But in terms of the huge long list of Hardware I have in my dropdown list, these have all been included in the release right? And there are some things there that are very specific and that I would never use.

So, how have these items been included in this list by default?
User avatar
leecollings
Posts: 167
Joined: Tuesday 30 June 2015 18:09
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: United Kingdom
Contact:

Re: Python plugin: Sonos [new version]

Post by leecollings »

This is why I find this confusing, so you're saying it's ready to use int he stable version.. However it has to be manually added. Why is this?

And is there a reason why it can't be automatically added to the dropdown list?
mvzut
Posts: 443
Joined: Thursday 12 November 2015 10:55
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: The Netherlands
Contact:

Python plugin: Sonos [new version]

Post by mvzut »

leecollings wrote:This is why I find this confusing, so you're saying it's ready to use int he stable version.. However it has to be manually added. Why is this?

And is there a reason why it can't be automatically added to the dropdown list?
The devices in the long list are there because people experienced in C coding worked on them in the past, and had them included in the main code. The Python framework was created to make it possible for more people to create plugins. There are already tens of those, all described somewhere in this forum, but none of them added to the list by default.

UPDATE:
I think that one of the reasons why all Python plugins are not included in the standard Domoticz package, is because they are still actively being developed in many cases. So they would be outdated very soon, especially if you use a stable release which you don't update very regularly. Domoticz has no automated update system built-in for plugins.

To address your "concerns", maybe it would be a good idea if the plugin manager (https://www.domoticz.com/wiki/Python_Plugin_Manager) would become a standard installed plugin...
Last edited by mvzut on Wednesday 17 October 2018 15:49, 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
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests