Page 7 of 9
Re: Python plugin: Sonos
Posted: Tuesday 18 April 2017 0:20
by waaren
[quote="hpnisse"]Hey!
I have a Synology DS1515+ NAS with DSM version 6.1-15047.
And I have installed
Domoticz Beta v3.7320 by jumbotroll, that should support Python Plugin Beta.
The problem is that when I add plugins,
Sonos, the Domoticz installation can't find it.
...
I have installed this plugin on my Synology 916+ in
/usr/local/domoticz/var/plugins/domoticz-sonos
and it's working
Re: Python plugin: Sonos
Posted: Tuesday 18 April 2017 17:54
by hpnisse
waaren wrote:
I have installed this plugin on my Synology 916+ in
/usr/local/domoticz/var/plugins/domoticz-sonos
and it's working
GuyTreepbush wrote:Your file permissions are wrong. Set permissions for plug-in.py file to 0777
Thanks to you both!!!
Changed the rights and owner of the files/folders, and moved everything to "domoticz/
var/plugins/Sonos".
The volume and some on/off button appeared in devices.
Now I just have to figure it out how to use it like I want... is there any page that list all "commands" I can do?
Can I change input and groups by lua events?
Thanks again!!
Re: Python plugin: Sonos
Posted: Thursday 20 April 2017 9:01
by mvzut
hpnisse wrote:waaren wrote:
I have installed this plugin on my Synology 916+ in
/usr/local/domoticz/var/plugins/domoticz-sonos
and it's working
GuyTreepbush wrote:Your file permissions are wrong. Set permissions for plug-in.py file to 0777
Thanks to you both!!!
Changed the rights and owner of the files/folders, and moved everything to "domoticz/
var/plugins/Sonos".
The volume and some on/off button appeared in devices.
Now I just have to figure it out how to use it like I want... is there any page that list all "commands" I can do?
Can I change input and groups by lua events?
Thanks again!!
No you can't. Currently you can only play/pause them, change the volume, and see what's playing.
Re: Python plugin: Sonos
Posted: Saturday 22 April 2017 2:07
by johan9610
Hello tester22.
Great pluginn if it should be working. I've copied the files to /domoticz/plugins/Sonos/...files...
Rebooted several times my r-pi, and checked by hardware and virtual switch but i cann't find the option to add a Sonos switch?
Do i miss something what isn't mensient on the internet?
Some screanshots of prints would be nice to see what i can get..
Keep up the good work, hopefull there will be an office plugin soon like Heos by Denon.
Update: There wasn't any version of Python installed, after that en rebooting again it does work. Very Cool.
Re: Python plugin: Sonos
Posted: Tuesday 16 May 2017 12:25
by leecollings
Can someone please help me? I'm not getting much help from the plugin author, and despite trying everything that's been listed, I am not seeing 'Sonos' appear in my Hardware devices list.
Just to go through the basics...
I'm running Beta 3.7450
I have uploaded the plugin.py file in /plugins/sonos/
I have installed python3 and restarted the Pi
Still nothing shows up in the Hardware dropdown list.
Is there anything else I need to do?
UPDATE:
Even after running `sudo apt-get install python3-dev`, I'm still seeing the error in the log after restarting DM:
`PluginSystem: Failed dynamic library load, install the latest libpython3.x library that is available for your platform.`
How can I fix this? Is this what's stopping Sonos from appearing in the Hardware list?
Re: Python plugin: Sonos
Posted: Tuesday 16 May 2017 12:27
by tester22
leecollings wrote:Can someone please help me? I'm not getting much help from the plugin author, and despite trying everything that's been listed, I am not seeing 'Sonos' appear in my Hardware devices list.
Just to go through the basics...
I'm running Beta 3.7450
I have uploaded the plugin.py file in /plugins/sonos/
I have installed python3 and restarted the Pi
Still nothing shows up in the Hardware dropdown list.
Is there anything else I need to do?
Do you have any entry in your log displaying that the plugin system is loaded or that the plugin itself is loaded?
Does any other plugins work? What browser are you using?
Re: Python plugin: Sonos
Posted: Tuesday 16 May 2017 12:31
by leecollings
Even after running `sudo apt-get install python3-dev`, I'm still seeing the error in the log after restarting DM:
`PluginSystem: Failed dynamic library load, install the latest libpython3.x library that is available for your platform.`
How can I fix this? Is this what's stopping Sonos from appearing in the Hardware list?
Re: Python plugin: Sonos
Posted: Tuesday 16 May 2017 12:35
by tester22
leecollings wrote:Even after running `sudo apt-get install python3-dev`, I'm still seeing the error in the log after restarting DM:
`PluginSystem: Failed dynamic library load, install the latest libpython3.x library that is available for your platform.`
How can I fix this? Is this what's stopping Sonos from appearing in the Hardware list?
Since libpython isn't working that is what you need to fix.
Have you looked here:
https://www.domoticz.com/wiki/Using_Python_plugins
You need both python3 and python3-dev.
Re: Python plugin: Sonos
Posted: Tuesday 16 May 2017 12:35
by leecollings
Something strange going on.
So I already have python3, and this is the latest version. (But I previously ran apt-get install python3-dev, and that installed).
So I seem to have both a production and dev version of python3 installed, but yet Domoticz still displays the message
2017-05-16 11:23:20.424 PluginSystem: Failed dynamic library load, install the latest libpython3.x library that is available for your platform.
Re: Python plugin: Sonos
Posted: Tuesday 16 May 2017 12:41
by leecollings
Installed them both, and restarted. Still seeing the error notice in the log.
No idea what's going on.
Re: Python plugin: Sonos
Posted: Tuesday 16 May 2017 12:53
by leecollings
Now after reading article1, I tried to install sudo apt-get install libpython3.4
But this then said Unable to locate. Unable to find by regex...
I find it hard to believe that some users have had this working fine without any issues... There's clearly an issue probably within Domoticz if it's reporting that I don't have python3, which I clearly do.
Re: Python plugin: Sonos
Posted: Tuesday 16 May 2017 13:20
by leecollings
Can anyone help me please? There must be something I'm missing out here.
Is there any way to force to re-install whatever required version of python is needed? I've been trying apt-get install python3.6.1 and libpython3.6.1 but it can't find those either.
This is really annoying!!
Re: Python plugin: Sonos
Posted: Tuesday 16 May 2017 19:17
by leecollings
Okay, so I managed to install Python 3.6.1 and that loads fine.
I can now see Sonos Players in the Hardware List, but when I click 'Add', literally nothing happens. Nothing in the log, Domoticz doesn't crash. It just does nothing.
Any where I can go from here?
Re: Python plugin: Sonos
Posted: Tuesday 16 May 2017 19:19
by tester22
leecollings wrote:Okay, so I managed to install Python 3.6.1 and that loads fine.
I can now see Sonos Players in the Hardware List, but when I click 'Add', literally nothing happens. Nothing in the log, Domoticz doesn't crash. It just does nothing.
Any where I can go from here?
What browser are you using. If you are using Chrome you should make an force reload. Due to cached JavaScript.
Re: Python plugin: Sonos
Posted: Tuesday 16 May 2017 21:10
by leecollings
Hmm I'll try a cache clear and maybe an entire rPi restart.
I'm running Safari on Mac OS X by the way
Re: Python plugin: Sonos
Posted: Tuesday 16 May 2017 22:36
by leecollings
Got them added now, and seems to be successfully pausing the speakers when turning the switches On and Off.
My ultimate goal is to have an Event where it will collect the state of all players, pause them, play an MP3 file, and then return them to their original state.
I don't suppose this feature is actually built into the plugin in an easy way is it? I was looking at the Http Node Sonos API that does this via the clip all function, but there's such a delay between firing the event and actually hearing any sound.
What would be the best way to get the speakers to play a locally hosted (on the Pi) MP3 file?
Re: Python plugin: Sonos
Posted: Wednesday 17 May 2017 7:56
by tester22
leecollings wrote:Got them added now, and seems to be successfully pausing the speakers when turning the switches On and Off.
My ultimate goal is to have an Event where it will collect the state of all players, pause them, play an MP3 file, and then return them to their original state.
I don't suppose this feature is actually built into the plugin in an easy way is it? I was looking at the Http Node Sonos API that does this via the clip all function, but there's such a delay between firing the event and actually hearing any sound.
What would be the best way to get the speakers to play a locally hosted (on the Pi) MP3 file?
Right now it is only possible to control playback and volume on the players.
To be able to use tts or an local MP3 file Domoticz need to expose an http endpoint that the Sonos players can load data from, it is not possible with the current version of the python framework.
Also there is no clean way in Domoticz to send an event to an device in Domoticz other than on/off/dim.
Hopefully this will be possible in the future.
Re: Python plugin: Sonos
Posted: Wednesday 17 May 2017 9:59
by leecollings
Ah, sorry I didn't see the post earlier about what you can and can't do.
Thanks for the heads up, this may not cut the mustard for what I'm after. But nonetheless, it's fantastic to see a nice native Domoticz plugin to use.
I'll head back to the other API and see if I can improve the delay on firing the events of that.
I would love to hear about any updates to this plugin though, if these features are planned to be added at some point?
Re: Python plugin: Sonos
Posted: Wednesday 17 May 2017 11:28
by rjblake
tester22 wrote:bdormael wrote:tester22 wrote:
Strange, did you copy all the files including the zip files to the plugin folder?
Yes, the zip file is there as well, unfortunatly since domoticz does not start, I don't have any logging available either.
Is there any way I can add extra logging ?
Try this version:
https://github.com/tester22/Domoticz-So ... /plugin.py
I introduced custom icons about an week ago and maybe thats what causing it.
All working well on my side, but curious about the custom icons. They don't seem to be used at all, or is there something else I need to do to make use of them?
Re: Python plugin: Sonos
Posted: Thursday 01 June 2017 15:53
by leecollings
G3rard wrote:
Just place the code in a file called plugin.py and place it in the folder domoticz/plugin/sonos.
After a restart of Domoticz you can add your Sonos via the Hardware settings under Sonos Players.
After the past hour of removing and re-uploading the plugin files, clearing cache, restarting the Pi, and Allowing new sensors for 5 minutes, I still haven't been able to see 'Sonos Players' in the Hardware list.
There must be something more to adding this, as htese instructions don't seem to be working at all.
Can you give some advice or assistance please? Running v3.7613 Beta