Page 5 of 9
Re: Python plugin: Sonos
Posted: Sunday 05 March 2017 13:51
by tester22
HomeAutomation wrote:mvzut wrote: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
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').
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).
Works perfect.
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 timer pluging however.
?
Timer plugin?
Create an dummy switch and conenct it to blocky.
Define the Sonos to start playing directly and stop after x minutes.
Re: Python plugin: Sonos
Posted: Sunday 05 March 2017 21:46
by HomeAutomation
tester22 wrote:HomeAutomation wrote: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').
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).
Works perfect.
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 timer pluging however.
?
Timer plugin?
Create an dummy switch and conenct it to blocky.
Define the Sonos to start playing directly and stop after x minutes.
Sorry, I ment an Alarm Clock.
Currently I use the "Time = " function in Blocky to start for instance the WakeUp script.
Scenes however can't be reached with myAnroid tablet.
Even though, I prefer a plugin in which it's possible to fill in a time (clock) value.
Jan
Re: Python plugin: Sonos
Posted: Monday 06 March 2017 6:20
by dhanjel
It would be nice to be able to set the media source (Sonos favourite for instance), if possible.
I currently use a nodejs middle tier for doing that, and it would be nice to get rid of external dependencies.
I use it to automatically play some lounge music in the bathroom when there is motion
Re: Python plugin: Sonos
Posted: Tuesday 07 March 2017 21:21
by tester22
RayAmsterdam wrote:TTS would be great!
OK, this is super Alpha (pre Beta) but the latest version on Github supports TTS:
https://github.com/tester22/Domoticz-Sonos
Re: Python plugin: Sonos
Posted: Wednesday 08 March 2017 10:58
by bdormael
It's definitly super alpha, when replacing the previous plugin file with the new one, Domoticz won't start anymore.
Going back to the previous plugin file, all works fine.
Re: Python plugin: Sonos
Posted: Wednesday 08 March 2017 11:10
by tester22
bdormael wrote:
It's definitly super alpha, when replacing the previous plugin file with the new one, Domoticz won't start anymore.
Going back to the previous plugin file, all works fine.
Strange, did you copy all the files including the zip files to the plugin folder?
Re: Python plugin: Sonos
Posted: Wednesday 08 March 2017 11:47
by bdormael
tester22 wrote:bdormael wrote:
It's definitly super alpha, when replacing the previous plugin file with the new one, Domoticz won't start anymore.
Going back to the previous plugin file, all works fine.
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 ?
Re: Python plugin: Sonos
Posted: Wednesday 08 March 2017 11:50
by tester22
bdormael wrote:tester22 wrote:bdormael wrote:
It's definitly super alpha, when replacing the previous plugin file with the new one, Domoticz won't start anymore.
Going back to the previous plugin file, all works fine.
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.
Re: Python plugin: Sonos
Posted: Wednesday 08 March 2017 12:41
by bdormael
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.
Tried the new file, still crashing Domoticz I'm afraid
Re: Python plugin: Sonos
Posted: Wednesday 08 March 2017 13:03
by tester22
bdormael wrote:tester22 wrote:bdormael wrote:
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.
Tried the new file, still crashing Domoticz I'm afraid
Are you on the latest Domoticz Beta? Icons were introduced a couple of weeks ago.
Or switch to this version, without icons:
https://github.com/tester22/Domoticz-So ... /plugin.py
Re: Python plugin: Sonos
Posted: Wednesday 08 March 2017 14:05
by bdormael
The version I'm on is 6683, tried it with the file without icons, now it's working fine again
I'm wondering now how I can test TTS, as I don't see any difference
Re: Python plugin: Sonos
Posted: Wednesday 08 March 2017 14:15
by tester22
bdormael wrote:
The version I'm on is 6683, tried it with the file without icons, now it's working fine again
I'm wondering now how I can test TTS, as I don't see any difference
Your need the latest version of the plugin, I think it is fexed now. Was an broken zip file.
So update to latest version here:
https://github.com/tester22/Domoticz-Sonos
Re: Python plugin: Sonos
Posted: Wednesday 08 March 2017 14:24
by bdormael
tester22 wrote:bdormael wrote:
The version I'm on is 6683, tried it with the file without icons, now it's working fine again
I'm wondering now how I can test TTS, as I don't see any difference
Your need the latest version of the plugin, I think it is fexed now. Was an broken zip file.
So update to latest version here:
https://github.com/tester22/Domoticz-Sonos
Newest version installed, crashing directly:
2017-03-08 14:22:54.664 (Sonos Eetkamer) Initialized version 1.0, author 'tester22'
2017-03-08 14:22:54.719 Error: Domoticz received fatal signal 11 !...
2017-03-08 14:22:54.732 Error: /home/pi/domoticz/domoticz() [0x1be334]
2017-03-08 14:22:54.732 Error: /home/pi/domoticz/domoticz(_Z14signal_handleri+0x58) [0x1be3ec]
2017-03-08 14:22:54.732 Error: /lib/arm-linux-gnueabihf/libc.so.6(__default_sa_restorer_v2+0) [0x76add180]
2017-03-08 14:22:54.732 Error: /home/pi/domoticz/domoticz(_ZNSs6assignERKSs+0x98) [0x6a7e70]
2017-03-08 14:22:54.732 Error: /home/pi/domoticz/domoticz(_ZN7Plugins11CImage_initEPNS_6CImageEP7_objectS3_+0x21c) [0x46a5f8]
Re: Python plugin: Sonos
Posted: Wednesday 08 March 2017 14:28
by tester22
bdormael wrote:tester22 wrote:bdormael wrote:
The version I'm on is 6683, tried it with the file without icons, now it's working fine again
I'm wondering now how I can test TTS, as I don't see any difference
Your need the latest version of the plugin, I think it is fexed now. Was an broken zip file.
So update to latest version here:
https://github.com/tester22/Domoticz-Sonos
Newest version installed, crashing directly:
2017-03-08 14:22:54.664 (Sonos Eetkamer) Initialized version 1.0, author 'tester22'
2017-03-08 14:22:54.719 Error: Domoticz received fatal signal 11 !...
2017-03-08 14:22:54.732 Error: /home/pi/domoticz/domoticz() [0x1be334]
2017-03-08 14:22:54.732 Error: /home/pi/domoticz/domoticz(_Z14signal_handleri+0x58) [0x1be3ec]
2017-03-08 14:22:54.732 Error: /lib/arm-linux-gnueabihf/libc.so.6(__default_sa_restorer_v2+0) [0x76add180]
2017-03-08 14:22:54.732 Error: /home/pi/domoticz/domoticz(_ZNSs6assignERKSs+0x98) [0x6a7e70]
2017-03-08 14:22:54.732 Error: /home/pi/domoticz/domoticz(_ZN7Plugins11CImage_initEPNS_6CImageEP7_objectS3_+0x21c) [0x46a5f8]
Ok that seems clear. Have removed the custom icons and will report this.
Try the latest commit on github.
Re: Python plugin: Sonos
Posted: Wednesday 08 March 2017 14:43
by bdormael
tester22 wrote:bdormael wrote:
Newest version installed, crashing directly:
2017-03-08 14:22:54.664 (Sonos Eetkamer) Initialized version 1.0, author 'tester22'
2017-03-08 14:22:54.719 Error: Domoticz received fatal signal 11 !...
2017-03-08 14:22:54.732 Error: /home/pi/domoticz/domoticz() [0x1be334]
2017-03-08 14:22:54.732 Error: /home/pi/domoticz/domoticz(_Z14signal_handleri+0x58) [0x1be3ec]
2017-03-08 14:22:54.732 Error: /lib/arm-linux-gnueabihf/libc.so.6(__default_sa_restorer_v2+0) [0x76add180]
2017-03-08 14:22:54.732 Error: /home/pi/domoticz/domoticz(_ZNSs6assignERKSs+0x98) [0x6a7e70]
2017-03-08 14:22:54.732 Error: /home/pi/domoticz/domoticz(_ZN7Plugins11CImage_initEPNS_6CImageEP7_objectS3_+0x21c) [0x46a5f8]
Ok that seems clear. Have removed the custom icons and will report this.
Try the latest commit on github.
Thx, all working again.
Now I have the voice fields, so I have added my key and language for each of my devices, but what do I need to do now to test it ?
(how can I send a line of text to a certain device ?)
Re: Python plugin: Sonos
Posted: Friday 10 March 2017 16:18
by RayAmsterdam
bdormael wrote:
Now I have the voice fields, so I have added my key and language for each of my devices, but what do I need to do now to test it ?
(how can I send a line of text to a certain device ?)
I've got the same question. Another question: Does it restore to the same state as before playing the tts?
Re: Python plugin: Sonos
Posted: Friday 10 March 2017 17:43
by RayAmsterdam
RayAmsterdam wrote:
Now I have the voice fields, so I have added my key and language for each of my devices, but what do I need to do now to test it ?
(how can I send a line of text to a certain device ?)
I've got the same question. Another question: Does it restore to the same state as before playing the tts?
Already found out by experience it speaks out the notifications and keeps repeating it. No restoring of the previous setting unfortunately.
Re: Python plugin: Sonos
Posted: Friday 10 March 2017 17:45
by tester22
RayAmsterdam wrote:bdormael wrote:
Now I have the voice fields, so I have added my key and language for each of my devices, but what do I need to do now to test it ?
(how can I send a line of text to a certain device ?)
I've got the same question. Another question: Does it restore to the same state as before playing the tts?
Right now it does not resume state. But I think I will reverse this since I have found an problem without any possible solution. If the players load data straight from Voicerss it interprets is as radio, hence it repeats the message indefinitely. Node-Sonos have solved that by downloading the data and expose it using an internal http server. This is not posdible ewith the current Domoticz python framework and all workaround includes adding additional components and that is something I want to avoid.
Re: Python plugin: Sonos
Posted: Friday 10 March 2017 17:53
by RayAmsterdam
tester22 wrote:
Right now it does not resume state. But I think I will reverse this since I have found an problem without any possible solution. If the players load data straight from Voicerss it interprets is as radio, hence it repeats the message indefinitely. Node-Sonos have solved that by downloading the data and expose it using an internal http server. This is not posdible ewith the current Domoticz python framework and all workaround includes adding additional components and that is something I want to avoid.
Re: Python plugin: Sonos
Posted: Friday 17 March 2017 20:49
by Heursqem
dhanjel wrote:It would be nice to be able to set the media source (Sonos favourite for instance), if possible.
I currently use a nodejs middle tier for doing that, and it would be nice to get rid of external dependencies.
I use it to automatically play some lounge music in the bathroom when there is motion
Is it (already) possible to do this with core plugin? Would be really great feauture.
Cheers
Heursqem