We have moved at community.getvera.com

Author Topic: openLuup: Sonos  (Read 19285 times)

Offline CudaNet

  • Beta Testers
  • Hero Member
  • *****
  • Posts: 1401
  • Karma: +42/-11
  • Chimichanga !
Re: openLuup: Sonos
« Reply #30 on: April 03, 2016, 12:37:05 pm »
It's persistent isn't it....

Code: [Select]
2016-04-03 11:34:40.734   openLuup.context_switch::  ERROR: [string "[6] I_Sonos1.xml"]:1452: attempt to index field '?' (a nil value)

Code: [Select]
local members, coordinator
localUUID = localUUID or ""

if (saveAndRestore == true and sayPlayback[device] == nil) then
local uuidListe2 = uuidListe
if (uuidListe2:find(localUUID) == nil) then
if (uuidListe2 == "") then
uuidListe2 = localUUID
else
uuidListe2 = localUUID .. "," .. uuidListe2
end
end

My bad, it's the variable localUUID which is nil, not uuidListe.

So, then, ...
Code: [Select]
local members, coordinator
localUUID = localUUID or ""

if (saveAndRestore == true and sayPlayback[device] == nil) then
local uuidListe2 = uuidListe
if (uuidListe2:find(localUUID) == nil) then
openLuup, AltUI, Zway and HomeWave, enough said...

Offline akbooer

  • Moderator
  • Master Member
  • *****
  • Posts: 6387
  • Karma: +290/-70
  • "Less is more"
Re: openLuup: Sonos
« Reply #31 on: April 03, 2016, 12:46:43 pm »
Yes, I think we're here now...

Code: [Select]

coordinator = dataTable[localUUID].GroupCoordinator or ""
members = dataTable[localUUID].ZonePlayerUUIDsInGroup or ""
        newGroup = false
if (coordinator ~= "" and coordinator == localUUID and members ~= localUUID) then
newGroup = true
end

which should really be written

Code: [Select]

coordinator = (dataTable[localUUID] or {}).GroupCoordinator or ""
members = (dataTable[localUUID] or {}).ZonePlayerUUIDsInGroup or ""
        newGroup = false
if (coordinator ~= "" and coordinator == localUUID and members ~= localUUID) then
newGroup = true
end

...but the ROOT CAUSE is that localUUID is nil, and we'd have to find out why.
3x Vera Lite-UI5/Edge-UI7, 25x Fibaro, 23x TKB, 9x MiniMote, 2x NorthQ Power, 2x Netatmo, 1x Foscam FI9831P, 9x Philips Hue,
Razberry, MySensors Arduino, HomeWave, AltUI, AltHue, DataYours, Grafana, openLuup, ZWay, ZeroBrane Studio.

Offline akbooer

  • Moderator
  • Master Member
  • *****
  • Posts: 6387
  • Karma: +290/-70
  • "Less is more"
Re: openLuup: Sonos
« Reply #32 on: April 03, 2016, 12:52:34 pm »
...but the ROOT CAUSE is that localUUID is nil, and we'd have to find out why.

...and the answer is: because I don't assign one!

This might be an easy fix in the openLuup device loader.
3x Vera Lite-UI5/Edge-UI7, 25x Fibaro, 23x TKB, 9x MiniMote, 2x NorthQ Power, 2x Netatmo, 1x Foscam FI9831P, 9x Philips Hue,
Razberry, MySensors Arduino, HomeWave, AltUI, AltHue, DataYours, Grafana, openLuup, ZWay, ZeroBrane Studio.

Offline akbooer

  • Moderator
  • Master Member
  • *****
  • Posts: 6387
  • Karma: +290/-70
  • "Less is more"
Re: openLuup: Sonos
« Reply #33 on: April 03, 2016, 02:01:33 pm »
This might be an easy fix in the openLuup device loader.

...fix for UUIDs: init.lua and chdev.lua now in development branch.
3x Vera Lite-UI5/Edge-UI7, 25x Fibaro, 23x TKB, 9x MiniMote, 2x NorthQ Power, 2x Netatmo, 1x Foscam FI9831P, 9x Philips Hue,
Razberry, MySensors Arduino, HomeWave, AltUI, AltHue, DataYours, Grafana, openLuup, ZWay, ZeroBrane Studio.

Offline CudaNet

  • Beta Testers
  • Hero Member
  • *****
  • Posts: 1401
  • Karma: +42/-11
  • Chimichanga !
Re: openLuup: Sonos
« Reply #34 on: April 03, 2016, 09:10:21 pm »
It's looking a lot better but still no go.... No errors whatsoever but it's still only wanting to play the last device in the Sonos chain (4,5 failed but 6 works). In my log below I attempted 4, then 6. I verified that all devices play, pause, resume and stop perfectly.

Code: [Select]
2016-04-03 20:03:30.565   :: openLuup STARTUP ::
2016-04-03 20:03:30.565   openLuup.init::      version 2016.04.03  @akbooer
2016-04-03 20:03:30.625   openLuup.scheduler:: version 2016.03.01  @akbooer
2016-04-03 20:03:30.627   openLuup.wsapi::     version 2016.03.05  @akbooer
2016-04-03 20:03:30.627   openLuup.server::    version 2016.03.20  @akbooer
2016-04-03 20:03:30.633   openLuup.plugins::   version 2016.03.05  @akbooer
2016-04-03 20:03:30.642   openLuup.scenes::    version 2016.03.11  @akbooer
2016-04-03 20:03:30.647   openLuup.chdev::     version 2016.04.03  @akbooer
2016-04-03 20:03:30.649   openLuup.io:0:        version 2016.02.15  @akbooer
2016-04-03 20:03:30.649   openLuup.luup:0:      version 2016.03.01  @akbooer
2016-04-03 20:03:30.657   openLuup.rooms::     version 2015.10.15  @akbooer
2016-04-03 20:03:30.657   openLuup.requests::  version 2016.03.11  @akbooer

Code: [Select]
2016-04-03 20:04:39.598   luup_log:0: ALTUI: runLua(luup.call_action("urn:micasaverde-com:serviceId:Sonos1", "Say",{Text="Testing", Volume=30},4))
2016-04-03 20:04:39.599   luup.call_action:0: 4.urn:micasaverde-com:serviceId:Sonos1.Say
2016-04-03 20:04:39.599   luup_log:4: TTS server (ODX): Function Started, params = [http://10.0.3.11:8080], Device [4], Language [en], Say [Testing].
2016-04-03 20:04:39.599   luup_log:4: TTS server (ODX): OSX Server Text-2-Send [text=Testing].
2016-04-03 20:04:39.599   luup_log:4: TTS server (ODX): OSX URL to Call [http://10.0.3.11:8080/tts].
2016-04-03 20:04:39.599   luup_log:4: TTS server (ODX): OSX URL Method [POST].
2016-04-03 20:04:39.730   luup_log:4: TTS server (ODX): OSX MP3 Path [/static/tmp/tmpfubVpP.mp3].
2016-04-03 20:04:39.730   luup_log:4: TTS server (ODX): OSX URI [http://10.0.3.11:8080/static/tmp/tmpfubVpP.mp3].
2016-04-03 20:04:39.730   luup_log:4: TTS server (ODX): OSX URL to Call [http://10.0.3.11:8080/static/tmp/tmpfubVpP.mp3].
2016-04-03 20:04:39.730   luup_log:4: TTS server (ODX): OSX URL Method [HEAD].
2016-04-03 20:04:39.735   luup_log:4: TTS server (ODX): OSX MP3 File Size [8437].
2016-04-03 20:04:39.735   luup_log:4: TTS server (ODX): OSX MP3 Play Duration(+1 Second) [3].
2016-04-03 20:04:39.735   luup_log:4: TTS server (ODX): Function Completed, sending 'duration' [3] and 'uri' [http://10.0.3.11:8080/static/tmp/tmpfubVpP.mp3].
2016-04-03 20:04:39.736   luup_log:0: ALTUI: Evaluation of lua code returned: nil
2016-04-03 20:04:39.738   openLuup.server:: request completed (8 bytes, 1 chunks, 140 ms) tcp{client}: 0xbeff20
2016-04-03 20:04:42.246   openLuup.server:: request completed (1222 bytes, 1 chunks, 60188 ms) tcp{client}: 0xc5d6b8
2016-04-03 20:04:42.349   openLuup.server:: /data_request?id=lu_status2&output_format=json&DataVersion=731810779&Timeout=60&MinimumDelay=1500&_=1459731802441 tcp{client}: 0xc5d6b8
2016-04-03 20:04:46.644   openLuup.server:: /data_request?id=lr_ALTUI_LuaRunHandler&command=run_lua&lua=luup.call_action(%22urn%3Amicasaverde-com%3AserviceId%3ASonos1%22%2C%20%22Say%22%2C%7BText%3D%22Testing%22%2C%20Volume%3D30%7D%2C6)&_=1459731802442 tcp{client}: 0xbeff20
2016-04-03 20:04:46.645   luup_log:0: ALTUI: runLua(luup.call_action("urn:micasaverde-com:serviceId:Sonos1", "Say",{Text="Testing", Volume=30},6))
2016-04-03 20:04:46.646   luup.call_action:0: 6.urn:micasaverde-com:serviceId:Sonos1.Say
2016-04-03 20:04:46.646   luup_log:6: TTS server (ODX): Function Started, params = [http://10.0.3.11:8080], Device [6], Language [en], Say [Testing].
2016-04-03 20:04:46.646   luup_log:6: TTS server (ODX): OSX Server Text-2-Send [text=Testing].
2016-04-03 20:04:46.646   luup_log:6: TTS server (ODX): OSX URL to Call [http://10.0.3.11:8080/tts].
2016-04-03 20:04:46.646   luup_log:6: TTS server (ODX): OSX URL Method [POST].
2016-04-03 20:04:46.833   luup_log:6: TTS server (ODX): OSX MP3 Path [/static/tmp/tmpPWcG3o.mp3].
2016-04-03 20:04:46.833   luup_log:6: TTS server (ODX): OSX URI [http://10.0.3.11:8080/static/tmp/tmpPWcG3o.mp3].
2016-04-03 20:04:46.834   luup_log:6: TTS server (ODX): OSX URL to Call [http://10.0.3.11:8080/static/tmp/tmpPWcG3o.mp3].
2016-04-03 20:04:46.834   luup_log:6: TTS server (ODX): OSX URL Method [HEAD].
2016-04-03 20:04:46.839   luup_log:6: TTS server (ODX): OSX MP3 File Size [8437].
2016-04-03 20:04:46.839   luup_log:6: TTS server (ODX): OSX MP3 Play Duration(+1 Second) [3].
2016-04-03 20:04:46.839   luup_log:6: TTS server (ODX): Function Completed, sending 'duration' [3] and 'uri' [http://10.0.3.11:8080/static/tmp/tmpPWcG3o.mp3].
2016-04-03 20:04:47.309   luup.variable_set:6: 6.urn:upnp-org:serviceId:AVTransport.TransportState was: STOPPED now: PLAYING #hooks:0
2016-04-03 20:04:47.337   luup.variable_set:6: 6.urn:upnp-org:serviceId:AVTransport.CurrentTransportActions was: Set, Play, Stop, Pause, Next now: Set, Play, Stop, Pause, Seek, Next, Previous #hooks:0
2016-04-03 20:04:47.346   luup.variable_set:6: 6.urn:upnp-org:serviceId:AVTransport.NumberOfTracks was: 0 now: 1 #hooks:0
2016-04-03 20:04:47.346   luup.variable_set:6: 6.urn:upnp-org:serviceId:AVTransport.AVTransportURI was: x-sonosapi-radio:radio%3ara.985486574?sid=204&flags=8300&sn=4 now: http://10.0.3.11:8080/static/tmp/tmpPWcG3o.mp3 #hooks:0
2016-04-03 20:04:47.347   luup.variable_set:6: 6.urn:upnp-org:serviceId:AVTransport.AVTransportURIMetaData was: <DIDL-Lite xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:upnp="urn:schemas-upnp-org:metadata-1-0/upnp/" xmlns:r="urn:schemas-rinconnetworks-com:metadata-1-0/" xmlns="urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/"><item id="000c206cradio%3ara.985486574" parentID="00082064radiogenre%3aClassical%20%26%20Jazz" restricted="true"><dc:title>Classical</dc:title><upnp:class>object.item.audioItem.audioBroadcast</upnp:class><desc id="cdudn" nameSpace="urn:schemas-rinconnetworks-com:metadata-1-0/">SA_RINCON52231_X_#Svc52231-0-Token</desc></item></DIDL-Lite> now:  #hooks:0
2016-04-03 20:04:47.358   luup.variable_set:6: 6.urn:upnp-org:serviceId:AVTransport.CurrentTrack was: 0 now: 1 #hooks:0
2016-04-03 20:04:47.358   luup.variable_set:6: 6.urn:upnp-org:serviceId:AVTransport.CurrentTrackDuration was: 0:00:00 now: 0:00:01 #hooks:0
2016-04-03 20:04:47.359   luup.variable_set:6: 6.urn:upnp-org:serviceId:AVTransport.CurrentTrackURI was:  now: http://10.0.3.11:8080/static/tmp/tmpPWcG3o.mp3 #hooks:0
2016-04-03 20:04:47.359   luup.variable_set:6: 6.urn:upnp-org:serviceId:AVTransport.CurrentTrackMetaData was:  now: <DIDL-Lite xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:upnp="urn:schemas-upnp-org:metadata-1-0/upnp/" xmlns:r="urn:schemas-rinconnetworks-com:metadata-1-0/" xmlns="urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/"><item id="-1" parentID="-1" restricted="true"><res protocolInfo="http-get:*:audio/mpeg:*" duration="0:00:01">http://10.0.3.11:8080/static/tmp/tmpPWcG3o.mp3</res><r:streamContent></r:streamContent><dc:title>tmpPWcG3o.mp3</dc:title><upnp:class>object.item.audioItem.musicTrack</upnp:class></item></DIDL-Lite> #hooks:0
2016-04-03 20:04:47.360   luup.variable_set:6: 6.urn:micasaverde-com:serviceId:Sonos1.CurrentService was: Apple Music now:  #hooks:0
2016-04-03 20:04:47.360   luup.variable_set:6: 6.urn:upnp-org:serviceId:AVTransport.CurrentRadio was: Classical now:  #hooks:0
2016-04-03 20:04:47.360   luup.variable_set:6: 6.urn:upnp-org:serviceId:AVTransport.CurrentStatus was: Apple Music: Classical now: tmpPWcG3o.mp3 #hooks:0
2016-04-03 20:04:47.361   luup.variable_set:6: 6.urn:upnp-org:serviceId:AVTransport.CurrentTitle was:  now: tmpPWcG3o.mp3 #hooks:0
2016-04-03 20:04:47.361   luup.variable_set:6: 6.urn:upnp-org:serviceId:AVTransport.CurrentAlbumArt was: http://10.0.4.24:1400/getaa?s=1&u=x%2dsonosapi%2dradio%3aradio%253ara%2e985486574%3fsid%3d204%26amp%3bflags%3d8300%26amp%3bsn%3d4 now: http://10.0.4.24:1400/img/icon-S3.png #hooks:0
2016-04-03 20:04:47.377   luup.variable_set:6: 6.urn:upnp-org:serviceId:RenderingControl.Volume was: 15 now: 30 #hooks:0
2016-04-03 20:04:47.377   luup.variable_set:6: 6.urn:micasaverde-com:serviceId:HaDevice1.LastUpdate was: 1459731813 now: 1459731887 #hooks:0
2016-04-03 20:04:47.378   luup_log:0: ALTUI: Evaluation of lua code returned: nil
2016-04-03 20:04:47.379   openLuup.server:: request completed (8 bytes, 1 chunks, 735 ms) tcp{client}: 0xbeff20
2016-04-03 20:04:47.436   openLuup.server:: request completed (63134 bytes, 4 chunks, 5086 ms) tcp{client}: 0xc5d6b8
2016-04-03 20:04:47.541   openLuup.server:: /data_request?id=lu_status2&output_format=json&DataVersion=731810795&Timeout=60&MinimumDelay=1500&_=1459731802443 tcp{client}: 0xc5d6b8
2016-04-03 20:04:50.351   luup.variable_set:6: 6.urn:upnp-org:serviceId:AVTransport.TransportState was: PLAYING now: STOPPED #hooks:0
2016-04-03 20:04:50.735   luup.variable_set:6: 6.urn:micasaverde-com:serviceId:HaDevice1.LastUpdate was: 1459731887 now: 1459731890 #hooks:0
2016-04-03 20:04:51.234   luup.variable_set:6: 6.urn:upnp-org:serviceId:AVTransport.CurrentTransportActions was: Set, Play, Stop, Pause, Seek, Next, Previous now: Set, Play, Stop, Pause, Next #hooks:0
2016-04-03 20:04:51.244   luup.variable_set:6: 6.urn:upnp-org:serviceId:AVTransport.NumberOfTracks was: 1 now: 0 #hooks:0
2016-04-03 20:04:51.244   luup.variable_set:6: 6.urn:upnp-org:serviceId:AVTransport.AVTransportURI was: http://10.0.3.11:8080/static/tmp/tmpPWcG3o.mp3 now: x-sonosapi-radio:radio%3ara.985486574?sid=204&amp;flags=8300&amp;sn=4 #hooks:0
2016-04-03 20:04:51.245   luup.variable_set:6: 6.urn:upnp-org:serviceId:AVTransport.AVTransportURIMetaData was:  now: <DIDL-Lite xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:upnp="urn:schemas-upnp-org:metadata-1-0/upnp/" xmlns:r="urn:schemas-rinconnetworks-com:metadata-1-0/" xmlns="urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/"><item id="000c206cradio%3ara.985486574" parentID="00082064radiogenre%3aClassical%20%26%20Jazz" restricted="true"><dc:title>Classical</dc:title><upnp:class>object.item.audioItem.audioBroadcast</upnp:class><desc id="cdudn" nameSpace="urn:schemas-rinconnetworks-com:metadata-1-0/">SA_RINCON52231_X_#Svc52231-0-Token</desc></item></DIDL-Lite> #hooks:0
2016-04-03 20:04:51.252   luup.variable_set:6: 6.urn:upnp-org:serviceId:AVTransport.CurrentTrack was: 1 now: 0 #hooks:0
2016-04-03 20:04:51.252   luup.variable_set:6: 6.urn:upnp-org:serviceId:AVTransport.CurrentTrackDuration was: 0:00:01 now: 0:00:00 #hooks:0
2016-04-03 20:04:51.252   luup.variable_set:6: 6.urn:upnp-org:serviceId:AVTransport.CurrentTrackURI was: http://10.0.3.11:8080/static/tmp/tmpPWcG3o.mp3 now:  #hooks:0
2016-04-03 20:04:51.253   luup.variable_set:6: 6.urn:upnp-org:serviceId:AVTransport.CurrentTrackMetaData was: <DIDL-Lite xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:upnp="urn:schemas-upnp-org:metadata-1-0/upnp/" xmlns:r="urn:schemas-rinconnetworks-com:metadata-1-0/" xmlns="urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/"><item id="-1" parentID="-1" restricted="true"><res protocolInfo="http-get:*:audio/mpeg:*" duration="0:00:01">http://10.0.3.11:8080/static/tmp/tmpPWcG3o.mp3</res><r:streamContent></r:streamContent><dc:title>tmpPWcG3o.mp3</dc:title><upnp:class>object.item.audioItem.musicTrack</upnp:class></item></DIDL-Lite> now:  #hooks:0
2016-04-03 20:04:51.253   luup.variable_set:6: 6.urn:micasaverde-com:serviceId:Sonos1.CurrentService was:  now: Apple Music #hooks:0
2016-04-03 20:04:51.253   luup.variable_set:6: 6.urn:upnp-org:serviceId:AVTransport.CurrentRadio was:  now: Classical #hooks:0
2016-04-03 20:04:51.253   luup.variable_set:6: 6.urn:upnp-org:serviceId:AVTransport.CurrentStatus was: tmpPWcG3o.mp3 now: Apple Music: Classical #hooks:0
2016-04-03 20:04:51.253   luup.variable_set:6: 6.urn:upnp-org:serviceId:AVTransport.CurrentTitle was: tmpPWcG3o.mp3 now:  #hooks:0
2016-04-03 20:04:51.254   luup.variable_set:6: 6.urn:upnp-org:serviceId:AVTransport.CurrentAlbumArt was: http://10.0.4.24:1400/img/icon-S3.png now: http://10.0.4.24:1400/getaa?s=1&u=x%2dsonosapi%2dradio%3aradio%253ara%2e985486574%3fsid%3d204%26amp%3bflags%3d8300%26amp%3bsn%3d4 #hooks:0
2016-04-03 20:04:51.270   luup.variable_set:6: 6.urn:upnp-org:serviceId:RenderingControl.Volume was: 30 now: 15 #hooks:0
2016-04-03 20:04:51.504   luup.variable_set:6: 6.urn:micasaverde-com:serviceId:HaDevice1.LastUpdate was: 1459731890 now: 1459731891 #hooks:0
2016-04-03 20:04:52.033   openLuup.server:: request completed (63095 bytes, 4 chunks, 4491 ms) tcp{client}: 0xc5d6b8
2016-04-03 20:04:52.137   openLuup.server:: /data_request?id=lu_status2&output_format=json&DataVersion=731810812&Timeout=60&MinimumDelay=1500&_=1459731802444 tcp{client}: 0xc5d6b8
2016-04-03 20:04:52.416   openLuup.server:: /favicon.ico tcp{client}: 0xbeff20
2016-04-03 20:04:52.416   openLuup.HTTP.FILE:: file not found:favicon.ico
2016-04-03 20:04:52.416   openLuup.server:: request completed (0 bytes, 0 chunks, 0 ms) tcp{client}: 0xbeff20
2016-04-03 20:04:53.132   openLuup.server:: /data_request?id=lr_ALTUI_Handler&command=oscommand&oscommand=tail%20-n%20500%20%2Fetc%2Fcmh-ludl%2FLuaUPnP.log&_=1459731802445 tcp{client}: 0xbeff20
« Last Edit: April 03, 2016, 09:13:04 pm by CudaNet »
openLuup, AltUI, Zway and HomeWave, enough said...

Offline CudaNet

  • Beta Testers
  • Hero Member
  • *****
  • Posts: 1401
  • Karma: +42/-11
  • Chimichanga !
Re: openLuup: Sonos
« Reply #35 on: April 05, 2016, 11:53:15 pm »
Interesting... The functions get(GroupInfos; L_Sonos) and get(Service; I_Sonos) aren't being passed the 'uuid' (e.g. RINCON_B8E937B105E001400) from sayOrAlert ....

Device / UUID = 4/ RINCON_B8E937B105E001400
Code: [Select]
2016-04-05 22:39:02.833   luup_log:4: TTS server (ODX): Function Started, params = [http://10.0.3.11:8080], Device [4], Language [en], Say [Oh, the weather outside if frightful.].
2016-04-05 22:39:02.833   luup_log:4: TTS server (ODX): OSX Server Text-2-Send [text=Oh, the weather outside if frightful.].
2016-04-05 22:39:02.833   luup_log:4: TTS server (ODX): OSX URL to Call [http://10.0.3.11:8080/tts].
2016-04-05 22:39:02.833   luup_log:4: TTS server (ODX): OSX URL Method [POST].
2016-04-05 22:39:03.021   luup_log:4: TTS server (ODX): OSX MP3 Path [/static/tmp/tmpSA88gE.mp3].
2016-04-05 22:39:03.024   luup_log:4: TTS server (ODX): OSX URI [http://10.0.3.11:8080/static/tmp/tmpSA88gE.mp3].
2016-04-05 22:39:03.024   luup_log:4: TTS server (ODX): OSX URL to Call [http://10.0.3.11:8080/static/tmp/tmpSA88gE.mp3].
2016-04-05 22:39:03.024   luup_log:4: TTS server (ODX): OSX URL Method [HEAD].
2016-04-05 22:39:03.030   luup_log:4: TTS server (ODX): OSX MP3 File Size [22465].
2016-04-05 22:39:03.031   luup_log:4: TTS server (ODX): OSX MP3 Play Duration(+1 Second) [4].
2016-04-05 22:39:03.031   luup_log:4: TTS server (ODX): Function Completed, sending 'duration' [4] and 'uri' [http://10.0.3.11:8080/static/tmp/tmpSA88gE.mp3].
2016-04-05 22:39:03.031   luup_log:4: sayOrAlert (ODX): uri [http://10.0.3.11:8080/static/tmp/tmpSA88gE.mp3].
2016-04-05 22:39:03.031   luup_log:4: sayOrAlert (ODX): device [4].
2016-04-05 22:39:03.031   luup_log:4: playURI(ODX): channel [Master].
2016-04-05 22:39:03.031   luup_log:4: playURI(ODX): device [4].
2016-04-05 22:39:03.031   luup_log:4: playURI(ODX): instanceId [0].
2016-04-05 22:39:03.031   luup_log:4: playURI(ODX): uri [http://10.0.3.11:8080/static/tmp/tmpSA88gE.mp3].
2016-04-05 22:39:03.032   luup_log:4: playURI(ODX): speed [1].
2016-04-05 22:39:03.032   luup_log:4: playURI(ODX): volume [30].
2016-04-05 22:39:03.032   luup_log:4: playURI(ODX): uuids [].
2016-04-05 22:39:03.032   luup_log:4: TTS server (ODX): getService:uuid.
2016-04-05 22:39:03.032   luup_log:4: nil
2016-04-05 22:39:03.032   luup_log:4: nil
2016-04-05 22:39:03.032   luup_log:4: urn:schemas-upnp-org:service:AVTransport:1
2016-04-05 22:39:03.032   luup_log:4: TTS server (ODX): getService:uuid.
2016-04-05 22:39:03.032   luup_log:4: TTS server (ODX): aresServicesLoaded:uuid.
2016-04-05 22:39:03.032   luup_log:4: nil
2016-04-05 22:39:03.033   luup_log:4: TTS server (ODX): aresServicesLoaded:uuid.
2016-04-05 22:39:03.033   luup_log:4: TTS server (ODX): getService:uuid.
2016-04-05 22:39:03.033   luup_log:4: nil
2016-04-05 22:39:03.033   luup_log:4: nil
2016-04-05 22:39:03.033   luup_log:4: urn:schemas-upnp-org:service:RenderingControl:1
2016-04-05 22:39:03.033   luup_log:4: TTS server (ODX): getService:uuid.
2016-04-05 22:39:03.033   luup_log:4: TTS server (ODX): aresServicesLoaded:uuid.
2016-04-05 22:39:03.033   luup_log:4: nil
2016-04-05 22:39:03.033   luup_log:4: TTS server (ODX): aresServicesLoaded:uuid.
2016-04-05 22:39:03.033   luup_log:4: sayOrAlert (ODX): device [http://10.0.3.11:8080/static/tmp/tmpSA88gE.mp3].
2016-04-05 22:39:03.033   luup_log:4: sayOrAlert (ODX): instanceId [0].
2016-04-05 22:39:03.033   luup_log:4: sayOrAlert (ODX): instanceId [http://10.0.3.11:8080/static/tmp/tmpSA88gE.mp3].
2016-04-05 22:39:03.034   luup_log:4: sayOrAlert (ODX): volume [30].
2016-04-05 22:39:03.034   luup_log:4: sayOrAlert (ODX): uuidListe [].
2016-04-05 22:39:03.034   luup_log:0: ALTUI: Evaluation of lua code returned: nil
2016-04-05 22:39:03.036   openLuup.server:: request completed (8 bytes, 1 chunks, 203 ms) tcp{client}: 0x11e0b28
2016-04-05 22:39:05.686   openLuup.server:: /favicon.ico tcp{client}: 0x11e0b28
2016-04-05 22:39:05.686   openLuup.HTTP.FILE:: file not found:favicon.ico
2016-04-05 22:39:05.687   openLuup.server:: request completed (0 bytes, 0 chunks, 1 ms) tcp{client}: 0x11e0b28

Device / UUID = 6 / RINCON_B8E937D8F66601400
Code: [Select]
2016-04-05 22:40:42.116   luup_log:6: TTS server (ODX): Function Started, params = [http://10.0.3.11:8080], Device [6], Language [en], Say [Oh, the weather outside if frightful.].
2016-04-05 22:40:42.116   luup_log:6: TTS server (ODX): OSX Server Text-2-Send [text=Oh, the weather outside if frightful.].
2016-04-05 22:40:42.116   luup_log:6: TTS server (ODX): OSX URL to Call [http://10.0.3.11:8080/tts].
2016-04-05 22:40:42.116   luup_log:6: TTS server (ODX): OSX URL Method [POST].
2016-04-05 22:40:42.412   luup_log:6: TTS server (ODX): OSX MP3 Path [/static/tmp/tmpNPoH7i.mp3].
2016-04-05 22:40:42.412   luup_log:6: TTS server (ODX): OSX URI [http://10.0.3.11:8080/static/tmp/tmpNPoH7i.mp3].
2016-04-05 22:40:42.412   luup_log:6: TTS server (ODX): OSX URL to Call [http://10.0.3.11:8080/static/tmp/tmpNPoH7i.mp3].
2016-04-05 22:40:42.412   luup_log:6: TTS server (ODX): OSX URL Method [HEAD].
2016-04-05 22:40:42.419   luup_log:6: TTS server (ODX): OSX MP3 File Size [22465].
2016-04-05 22:40:42.419   luup_log:6: TTS server (ODX): OSX MP3 Play Duration(+1 Second) [4].
2016-04-05 22:40:42.419   luup_log:6: TTS server (ODX): Function Completed, sending 'duration' [4] and 'uri' [http://10.0.3.11:8080/static/tmp/tmpNPoH7i.mp3].
2016-04-05 22:40:42.419   luup_log:6: sayOrAlert (ODX): uri [http://10.0.3.11:8080/static/tmp/tmpNPoH7i.mp3].
2016-04-05 22:40:42.420   luup_log:6: sayOrAlert (ODX): device [6].
2016-04-05 22:40:42.420   luup_log:6: TTS server (ODX): getGroupInfos:uuid [RINCON_B8E937D8F66601400].
2016-04-05 22:40:42.423   luup_log:6: TTS server (ODX): getService:uuid.
2016-04-05 22:40:42.423   luup_log:6: RINCON_B8E937D8F66601400
2016-04-05 22:40:42.423   luup_log:6: nil
2016-04-05 22:40:42.423   luup_log:6: urn:schemas-upnp-org:service:ZoneGroupTopology:1
2016-04-05 22:40:42.423   luup_log:6: TTS server (ODX): getService:uuid.
2016-04-05 22:40:42.424   luup_log:6: TTS server (ODX): aresServicesLoaded:uuid.
2016-04-05 22:40:42.424   luup_log:6: RINCON_B8E937D8F66601400
2016-04-05 22:40:42.424   luup_log:6: TTS server (ODX): aresServicesLoaded:uuid.
2016-04-05 22:40:42.440   luup_log:6: TTS server (ODX): setData:uuid [RINCON_B8E937D8F66601400].
2016-04-05 22:40:42.446   luup_log:6: TTS server (ODX): setData:uuid [RINCON_B8E937D8F66601400].
2016-04-05 22:40:42.446   luup_log:6: TTS server (ODX): getGroupInfos:uuid [RINCON_B8E937D8F66601400].
2016-04-05 22:40:42.450   luup_log:6: TTS server (ODX): setData:uuid [RINCON_B8E937D8F66601400].
2016-04-05 22:40:42.450   luup_log:6: TTS server (ODX): setData:uuid [RINCON_B8E937D8F66601400].
2016-04-05 22:40:42.450   luup_log:6: TTS server (ODX): getService:uuid.
2016-04-05 22:40:42.450   luup_log:6: RINCON_B8E937D8F66601400
2016-04-05 22:40:42.450   luup_log:6: nil
2016-04-05 22:40:42.450   luup_log:6: urn:schemas-upnp-org:service:AVTransport:1
2016-04-05 22:40:42.450   luup_log:6: TTS server (ODX): getService:uuid.
2016-04-05 22:40:42.450   luup_log:6: TTS server (ODX): aresServicesLoaded:uuid.
2016-04-05 22:40:42.450   luup_log:6: RINCON_B8E937D8F66601400
2016-04-05 22:40:42.451   luup_log:6: TTS server (ODX): aresServicesLoaded:uuid.
2016-04-05 22:40:42.460   luup_log:6: TTS server (ODX): setData:uuid [RINCON_B8E937D8F66601400].
{removed repeated many times)
2016-04-05 22:40:42.513   luup_log:6: TTS server (ODX): extractDataFromMetaData:uuid [RINCON_B8E937D8F66601400].
2016-04-05 22:40:42.514   luup_log:6: TTS server (ODX): updateServicesMetaDataKeys:uuid [RINCON_B8E937D8F66601400].
2016-04-05 22:40:42.514   luup_log:6: TTS server (ODX): setData:uuid [RINCON_B8E937D8F66601400].
{removed repeated many times)
2016-04-05 22:40:42.515   luup_log:6: TTS server (ODX): getService:uuid.
2016-04-05 22:40:42.515   luup_log:6: RINCON_B8E937D8F66601400
2016-04-05 22:40:42.515   luup_log:6: nil
2016-04-05 22:40:42.515   luup_log:6: urn:schemas-upnp-org:service:RenderingControl:1
2016-04-05 22:40:42.515   luup_log:6: TTS server (ODX): getService:uuid.
2016-04-05 22:40:42.515   luup_log:6: TTS server (ODX): aresServicesLoaded:uuid.
2016-04-05 22:40:42.515   luup_log:6: RINCON_B8E937D8F66601400
2016-04-05 22:40:42.515   luup_log:6: TTS server (ODX): aresServicesLoaded:uuid.
2016-04-05 22:40:42.524   luup_log:6: TTS server (ODX): setData:uuid [RINCON_B8E937D8F66601400].
2016-04-05 22:40:42.532   luup_log:6: TTS server (ODX): setData:uuid [RINCON_B8E937D8F66601400].
2016-04-05 22:40:42.532   luup_log:6: playURI(ODX): channel [Master].
2016-04-05 22:40:42.532   luup_log:6: playURI(ODX): device [6].
2016-04-05 22:40:42.532   luup_log:6: playURI(ODX): instanceId [0].
2016-04-05 22:40:42.532   luup_log:6: playURI(ODX): uri [http://10.0.3.11:8080/static/tmp/tmpNPoH7i.mp3].
2016-04-05 22:40:42.533   luup_log:6: playURI(ODX): speed [1].
2016-04-05 22:40:42.533   luup_log:6: playURI(ODX): volume [30].
2016-04-05 22:40:42.533   luup_log:6: playURI(ODX): uuids [].
2016-04-05 22:40:42.533   luup_log:6: TTS server (ODX): getService:uuid.
2016-04-05 22:40:42.533   luup_log:6: RINCON_B8E937D8F66601400
2016-04-05 22:40:42.533   luup_log:6: nil
2016-04-05 22:40:42.533   luup_log:6: urn:schemas-upnp-org:service:AVTransport:1
2016-04-05 22:40:42.533   luup_log:6: TTS server (ODX): getService:uuid.
2016-04-05 22:40:42.533   luup_log:6: TTS server (ODX): aresServicesLoaded:uuid.
2016-04-05 22:40:42.533   luup_log:6: RINCON_B8E937D8F66601400
2016-04-05 22:40:42.533   luup_log:6: TTS server (ODX): aresServicesLoaded:uuid.
2016-04-05 22:40:42.534   luup_log:6: TTS server (ODX): getService:uuid.
2016-04-05 22:40:42.534   luup_log:6: RINCON_B8E937D8F66601400
2016-04-05 22:40:42.534   luup_log:6: nil
2016-04-05 22:40:42.534   luup_log:6: urn:schemas-upnp-org:service:RenderingControl:1
2016-04-05 22:40:42.534   luup_log:6: TTS server (ODX): getService:uuid.
2016-04-05 22:40:42.534   luup_log:6: TTS server (ODX): aresServicesLoaded:uuid.
2016-04-05 22:40:42.534   luup_log:6: RINCON_B8E937D8F66601400
2016-04-05 22:40:42.534   luup_log:6: TTS server (ODX): aresServicesLoaded:uuid.
2016-04-05 22:40:42.694   luup_log:6: sayOrAlert (ODX): device [http://10.0.3.11:8080/static/tmp/tmpNPoH7i.mp3].
2016-04-05 22:40:42.694   luup_log:6: sayOrAlert (ODX): instanceId [0].
2016-04-05 22:40:42.694   luup_log:6: sayOrAlert (ODX): instanceId [http://10.0.3.11:8080/static/tmp/tmpNPoH7i.mp3].
2016-04-05 22:40:42.694   luup_log:6: sayOrAlert (ODX): volume [30].
2016-04-05 22:40:42.694   luup_log:6: sayOrAlert (ODX): uuidListe [].
2016-04-05 22:40:42.695   luup_log:6: TTS server (ODX): getService:uuid.
2016-04-05 22:40:42.695   luup_log:6: RINCON_B8E937D8F66601400
2016-04-05 22:40:42.695   luup_log:6: nil
2016-04-05 22:40:42.695   luup_log:6: urn:schemas-upnp-org:service:ZoneGroupTopology:1
2016-04-05 22:40:42.695   luup_log:6: TTS server (ODX): getService:uuid.
2016-04-05 22:40:42.695   luup_log:6: TTS server (ODX): aresServicesLoaded:uuid.
2016-04-05 22:40:42.695   luup_log:6: RINCON_B8E937D8F66601400
2016-04-05 22:40:42.695   luup_log:6: TTS server (ODX): aresServicesLoaded:uuid.
2016-04-05 22:40:42.723   luup_log:6: TTS server (ODX): setData:uuid [RINCON_B8E937D8F66601400].
2016-04-05 22:40:42.730   luup_log:6: TTS server (ODX): setData:uuid [RINCON_B8E937D8F66601400].
2016-04-05 22:40:42.730   luup_log:6: TTS server (ODX): getGroupInfos:uuid [RINCON_B8E937D8F66601400].
2016-04-05 22:40:42.734   luup_log:6: TTS server (ODX): setData:uuid [RINCON_B8E937D8F66601400].
2016-04-05 22:40:42.734   luup_log:6: TTS server (ODX): setData:uuid [RINCON_B8E937D8F66601400].
2016-04-05 22:40:42.734   luup_log:6: TTS server (ODX): getService:uuid.
2016-04-05 22:40:42.734   luup_log:6: RINCON_B8E937D8F66601400
2016-04-05 22:40:42.734   luup_log:6: nil
2016-04-05 22:40:42.734   luup_log:6: urn:schemas-upnp-org:service:AVTransport:1
2016-04-05 22:40:42.734   luup_log:6: TTS server (ODX): getService:uuid.
2016-04-05 22:40:42.734   luup_log:6: TTS server (ODX): aresServicesLoaded:uuid.
2016-04-05 22:40:42.734   luup_log:6: RINCON_B8E937D8F66601400
2016-04-05 22:40:42.735   luup_log:6: TTS server (ODX): aresServicesLoaded:uuid.
2016-04-05 22:40:42.745   luup_log:6: TTS server (ODX): setData:uuid [RINCON_B8E937D8F66601400].
2016-04-05 22:40:42.746   luup.variable_set:6: 6.urn:upnp-org:serviceId:AVTransport.TransportState was: STOPPED now: TRANSITIONING #hooks:0
2016-04-05 22:40:42.746   luup_log:6: TTS server (ODX): setData:uuid [RINCON_B8E937D8F66601400].
2016-04-05 22:40:42.746   luup_log:6: TTS server (ODX): setData:uuid [RINCON_B8E937D8F66601400].
2016-04-05 22:40:42.754   luup_log:6: TTS server (ODX): setData:uuid [RINCON_B8E937D8F66601400].
2016-04-05 22:40:42.764   luup_log:6: TTS server (ODX): setData:uuid [RINCON_B8E937D8F66601400].
2016-04-05 22:40:42.774   luup_log:6: TTS server (ODX): setData:uuid [RINCON_B8E937D8F66601400].
2016-04-05 22:40:42.774   luup.variable_set:6: 6.urn:upnp-org:serviceId:AVTransport.CurrentTransportActions was: Set, Play, Stop, Pause, Next now: Set, Play, Stop, Pause, Seek, Next, Previous #hooks:0
2016-04-05 22:40:43.001   luup_log:6: TTS server (ODX): setData:uuid [RINCON_B8E937D8F66601400].
2016-04-05 22:40:43.001   luup.variable_set:6: 6.urn:upnp-org:serviceId:AVTransport.NumberOfTracks was: 0 now: 1 #hooks:0
2016-04-05 22:40:43.001   luup_log:6: TTS server (ODX): setData:uuid [RINCON_B8E937D8F66601400].
2016-04-05 22:40:43.001   luup_log:6: TTS server (ODX): setData:uuid [RINCON_B8E937D8F66601400].
2016-04-05 22:40:43.001   luup.variable_set:6: 6.urn:upnp-org:serviceId:AVTransport.AVTransportURI was: x-sonosapi-radio:radio%3ara.798879065?sid=204&flags=8300&sn=4 now: http://10.0.3.11:8080/static/tmp/tmpNPoH7i.mp3 #hooks:0
2016-04-05 22:40:43.002   luup_log:6: TTS server (ODX): setData:uuid [RINCON_B8E937D8F66601400].
2016-04-05 22:40:43.002   luup.variable_set:6: 6.urn:upnp-org:serviceId:AVTransport.AVTransportURIMetaData was: <DIDL-Lite xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:upnp="urn:schemas-upnp-org:metadata-1-0/upnp/" xmlns:r="urn:schemas-rinconnetworks-com:metadata-1-0/" xmlns="urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/"><item id="000c206cradio%3ara.798879065" parentID="00020000radio:bethoven" restricted="true"><dc:title>Bethoven&apos;s Solveig&apos;s Song Radio</dc:title><upnp:class>object.item.audioItem.audioBroadcast.sonos-favorite</upnp:class><desc id="cdudn" nameSpace="urn:schemas-rinconnetworks-com:metadata-1-0/">SA_RINCON52231_X_#Svc52231-0-Token</desc></item></DIDL-Lite> now:  #hooks:0
2016-04-05 22:40:43.017   luup_log:6: TTS server (ODX): setData:uuid [RINCON_B8E937D8F66601400].
2016-04-05 22:40:43.017   luup.variable_set:6: 6.urn:upnp-org:serviceId:AVTransport.CurrentTrack was: 0 now: 1 #hooks:0
2016-04-05 22:40:43.017   luup_log:6: TTS server (ODX): setData:uuid [RINCON_B8E937D8F66601400].
2016-04-05 22:40:43.018   luup.variable_set:6: 6.urn:upnp-org:serviceId:AVTransport.CurrentTrackDuration was: 0:00:00 now: 0:00:03 #hooks:0
2016-04-05 22:40:43.018   luup_log:6: TTS server (ODX): setData:uuid [RINCON_B8E937D8F66601400].
2016-04-05 22:40:43.018   luup.variable_set:6: 6.urn:upnp-org:serviceId:AVTransport.CurrentTrackURI was:  now: http://10.0.3.11:8080/static/tmp/tmpNPoH7i.mp3 #hooks:0
2016-04-05 22:40:43.018   luup_log:6: TTS server (ODX): setData:uuid [RINCON_B8E937D8F66601400].
2016-04-05 22:40:43.018   luup.variable_set:6: 6.urn:upnp-org:serviceId:AVTransport.CurrentTrackMetaData was:  now: <DIDL-Lite xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:upnp="urn:schemas-upnp-org:metadata-1-0/upnp/" xmlns:r="urn:schemas-rinconnetworks-com:metadata-1-0/" xmlns="urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/"><item id="-1" parentID="-1" restricted="true"><res protocolInfo="http-get:*:audio/mpeg:*" duration="0:00:03">http://10.0.3.11:8080/static/tmp/tmpNPoH7i.mp3</res><r:streamContent></r:streamContent><dc:title>tmpNPoH7i.mp3</dc:title><upnp:class>object.item.audioItem.musicTrack</upnp:class></item></DIDL-Lite> #hooks:0
2016-04-05 22:40:43.019   luup_log:6: TTS server (ODX): setData:uuid [RINCON_B8E937D8F66601400].
2016-04-05 22:40:43.019   luup_log:6: TTS server (ODX): extractDataFromMetaData:uuid [RINCON_B8E937D8F66601400].
2016-04-05 22:40:43.019   luup_log:6: TTS server (ODX): updateServicesMetaDataKeys:uuid [RINCON_B8E937D8F66601400].
2016-04-05 22:40:43.019   luup_log:6: TTS server (ODX): setData:uuid [RINCON_B8E937D8F66601400].
2016-04-05 22:40:43.020   luup.variable_set:6: 6.urn:micasaverde-com:serviceId:Sonos1.CurrentService was: Apple Music now:  #hooks:0
2016-04-05 22:40:43.020   luup_log:6: TTS server (ODX): setData:uuid [RINCON_B8E937D8F66601400].
2016-04-05 22:40:43.020   luup_log:6: TTS server (ODX): setData:uuid [RINCON_B8E937D8F66601400].
2016-04-05 22:40:43.020   luup.variable_set:6: 6.urn:upnp-org:serviceId:AVTransport.CurrentStatus was: Apple Music now: tmpNPoH7i.mp3 #hooks:0
2016-04-05 22:40:43.020   luup_log:6: TTS server (ODX): setData:uuid [RINCON_B8E937D8F66601400].
2016-04-05 22:40:43.020   luup.variable_set:6: 6.urn:upnp-org:serviceId:AVTransport.CurrentTitle was:  now: tmpNPoH7i.mp3 #hooks:0
2016-04-05 22:40:43.020   luup_log:6: TTS server (ODX): setData:uuid [RINCON_B8E937D8F66601400].
2016-04-05 22:40:43.021   luup_log:6: TTS server (ODX): setData:uuid [RINCON_B8E937D8F66601400].
2016-04-05 22:40:43.021   luup_log:6: TTS server (ODX): setData:uuid [RINCON_B8E937D8F66601400].
2016-04-05 22:40:43.021   luup_log:6: TTS server (ODX): setData:uuid [RINCON_B8E937D8F66601400].
2016-04-05 22:40:43.021   luup.variable_set:6: 6.urn:upnp-org:serviceId:AVTransport.CurrentAlbumArt was: http://10.0.4.24:1400/getaa?s=1&u=x%2dsonosapi%2dradio%3aradio%253ara%2e798879065%3fsid%3d204%26flags%3d8300%26sn%3d4 now: http://10.0.4.24:1400/img/icon-S3.png #hooks:0
2016-04-05 22:40:43.021   luup_log:6: TTS server (ODX): getService:uuid.
2016-04-05 22:40:43.021   luup_log:6: RINCON_B8E937D8F66601400
2016-04-05 22:40:43.021   luup_log:6: nil
2016-04-05 22:40:43.021   luup_log:6: urn:schemas-upnp-org:service:RenderingControl:1
2016-04-05 22:40:43.021   luup_log:6: TTS server (ODX): getService:uuid.
2016-04-05 22:40:43.022   luup_log:6: TTS server (ODX): aresServicesLoaded:uuid.
2016-04-05 22:40:43.022   luup_log:6: RINCON_B8E937D8F66601400
2016-04-05 22:40:43.022   luup_log:6: TTS server (ODX): aresServicesLoaded:uuid.
2016-04-05 22:40:43.030   luup_log:6: TTS server (ODX): setData:uuid [RINCON_B8E937D8F66601400].
2016-04-05 22:40:43.089   luup_log:6: TTS server (ODX): setData:uuid [RINCON_B8E937D8F66601400].
2016-04-05 22:40:43.090   luup.variable_set:6: 6.urn:upnp-org:serviceId:RenderingControl.Volume was: 19 now: 30 #hooks:0

So for function (sayOrAlert), the variable UUIDs[device] is nil for all other devices except the last Sonos device [6]. Is it possible the table 'UUIDs = {}' is being overwritten as it loops through the device(s)/UUID's and only storing the last device in the chain ? I'm tired, need sleep...
« Last Edit: April 06, 2016, 01:06:20 am by CudaNet »
openLuup, AltUI, Zway and HomeWave, enough said...

Offline akbooer

  • Moderator
  • Master Member
  • *****
  • Posts: 6387
  • Karma: +290/-70
  • "Less is more"
Re: openLuup: Sonos
« Reply #36 on: April 06, 2016, 03:15:21 am »
Great detective work!  Let me see if I can find the broken link in the chain...
3x Vera Lite-UI5/Edge-UI7, 25x Fibaro, 23x TKB, 9x MiniMote, 2x NorthQ Power, 2x Netatmo, 1x Foscam FI9831P, 9x Philips Hue,
Razberry, MySensors Arduino, HomeWave, AltUI, AltHue, DataYours, Grafana, openLuup, ZWay, ZeroBrane Studio.

Offline CudaNet

  • Beta Testers
  • Hero Member
  • *****
  • Posts: 1401
  • Karma: +42/-11
  • Chimichanga !
Re: openLuup: Sonos
« Reply #37 on: April 06, 2016, 04:43:52 pm »
Sounds good, tons of little details in dealing with a Sonos system.

Great detective work!  Let me see if I can find the broken link in the chain...
openLuup, AltUI, Zway and HomeWave, enough said...

Offline CudaNet

  • Beta Testers
  • Hero Member
  • *****
  • Posts: 1401
  • Karma: +42/-11
  • Chimichanga !
Re: openLuup: Sonos
« Reply #38 on: April 08, 2016, 10:08:33 pm »
In the meantime, I've found an alternate solution that plays quite well. I took a github project (using node.js) Sonos RESTful client and made all the necessary modifications to support the OSXTTS server. Works perfectly with very minor Lua. I can now totally remove all the remaining non-zwave devices from my Vera's. If the issue with the UUIDs table can be resolved then I'd be more than happy to test again but I must move forward ...
« Last Edit: April 08, 2016, 10:22:16 pm by CudaNet »
openLuup, AltUI, Zway and HomeWave, enough said...

Offline akbooer

  • Moderator
  • Master Member
  • *****
  • Posts: 6387
  • Karma: +290/-70
  • "Less is more"
Re: openLuup: Sonos
« Reply #39 on: April 09, 2016, 02:58:04 am »
Yes, I've been very slow - not much time to work on it.  My problem is that what once worked for TTS on a Vera does not now work for me (Microsoft TTS.). Google doesn't work either, so I don't have a test bed for anything.

Glad to hear about the workaround.

3x Vera Lite-UI5/Edge-UI7, 25x Fibaro, 23x TKB, 9x MiniMote, 2x NorthQ Power, 2x Netatmo, 1x Foscam FI9831P, 9x Philips Hue,
Razberry, MySensors Arduino, HomeWave, AltUI, AltHue, DataYours, Grafana, openLuup, ZWay, ZeroBrane Studio.

Offline CudaNet

  • Beta Testers
  • Hero Member
  • *****
  • Posts: 1401
  • Karma: +42/-11
  • Chimichanga !
Re: openLuup: Sonos
« Reply #40 on: April 09, 2016, 10:41:19 am »
AK, same here and I totally understand and appreciate you getting me past the first few road blocks... Without that I wouldn't have been able to perform any analysis. I'm going to let someone else (or perhaps others) turn this one over to the developer assuming the developer is willing to adjust for operation within openLuup. Why ? simply because we have options...

As for this workaround, the more I use it the more I'm really liking it. It has more features and it's easy to understand what's happening in code. Would be a great baked-in solution for Sonos support within AltUI w/o having a plugin. I'd mention this to @amg0 but there's a tremendous amount of effort being applied in Workflows right now so I'll wait.

If there's interest out there for a TTS workaround, I can post instructions on how to install. I may even start bundling it within the hosted images (enabled via rc.local)...

Yes, I've been very slow - not much time to work on it.  My problem is that what once worked for TTS on a Vera does not now work for me (Microsoft TTS.). Google doesn't work either, so I don't have a test bed for anything.

Glad to hear about the workaround.
openLuup, AltUI, Zway and HomeWave, enough said...

Offline akbooer

  • Moderator
  • Master Member
  • *****
  • Posts: 6387
  • Karma: +290/-70
  • "Less is more"
Re: openLuup: Sonos
« Reply #41 on: April 09, 2016, 11:01:16 am »
I, for one, would be interested in the instructions!

I'm grateful, as ever, to you since in the process we've improved openLuup anyway, even if we haven't fixed the Sonos issue.
3x Vera Lite-UI5/Edge-UI7, 25x Fibaro, 23x TKB, 9x MiniMote, 2x NorthQ Power, 2x Netatmo, 1x Foscam FI9831P, 9x Philips Hue,
Razberry, MySensors Arduino, HomeWave, AltUI, AltHue, DataYours, Grafana, openLuup, ZWay, ZeroBrane Studio.

Offline CudaNet

  • Beta Testers
  • Hero Member
  • *****
  • Posts: 1401
  • Karma: +42/-11
  • Chimichanga !
Re: openLuup: Sonos
« Reply #42 on: April 10, 2016, 03:44:40 pm »
AK, not a problem - I'll put something together and post it here. For those using Wolf P. TTS server, I seem to be having issues as it doesn't seem to recognize the param for Voice (selecting speech voice). This was one area lacking within the Sonos plugin and I patched the code for it to work and well... Hmm, I may have to pay for a license (as there's now a cost for the latest version) do this ... regardless I'm still really happy with Sonos client solution.

Update: Yes, the latest release of WP/OSXTTS does resolve the issue with selecting voices... I may have the original (free) version I can post so those with a Mac (OSX 10 or run a Virtual Box) can use it to host their TTS server. That way if they really like it they can purchase a license OR just use it as-is...

I, for one, would be interested in the instructions!

I appreciate that but honestly it's all you and the awesome plugin developers who, like the rest of us, see the immense benefit of openLuup... Truly ! I'm going to look at this Sonos issue as a sign.. Let's try this alternative solution and see how we feel in the next month or so ...
Quote
I'm grateful, as ever, to you since in the process we've improved openLuup anyway, even if we haven't fixed the Sonos issue.
« Last Edit: April 10, 2016, 06:22:20 pm by CudaNet »
openLuup, AltUI, Zway and HomeWave, enough said...

Offline CudaNet

  • Beta Testers
  • Hero Member
  • *****
  • Posts: 1401
  • Karma: +42/-11
  • Chimichanga !
Re: openLuup: Sonos
« Reply #43 on: April 11, 2016, 03:26:00 pm »
Part 1 of 2: Preparing the environment (Raspberry Pi2/3).
This is a rough write-up, I'll do something more formal when I have time... Please perform all steps as a Sudoer...

[1] Install Node 4.0 (or greater); I'm using Node 4.0. For other distro's check here: http://nodejs.org/dist/v4.0.0/
Code: [Select]
wget https://nodejs.org/dist/v4.0.0/node-v4.0.0-linux-armv7l.tar.gz
tar -xvf node-v4.0.0-linux-armv7l.tar.gz
cd node-v4.0.0-linux-armv7l
sudo cp -R * /usr/local/

[2] Verify Node version (very important).
Code: [Select]
node -v
root@Test:/home/cuda/node-sonos-http-api# node -v
v4.0.0

[3] Install NPM (Node JavaScript Package Manager 1.4.21) and upgrade to latest (e.g. 3.8.6).
Code: [Select]
apt-get install npm
npm install npm@latest -g

[4] Install the Sonos client from Git...
Code: [Select]
apt-get update
apt-get install git
git clone https://github.com/jishi/node-sonos-http-api.git
cd node-sonos-http-api
npm install --production

[5] Obtain an API key from VoiceRSS: http://www.voicerss.org/
Code: [Select]
Note: 350 free requests daily limited to 100KB per request

[6] Build a settings.json file; additional settings may also be set. See GitHub/Developer site for more detail.
Code: [Select]
cd node-sonos-http-api
nano settings.json

>> copy and paste below this line
{
  "voicerss": "your API key here"
}
<< copy and paste above this line

perform a cntrl-o, press [enter], perform a cntrl-x to exit

[7] Start the Sonos client.
Code: [Select]
npm start

info: binding SSDP to port 1905
info: discovering all IPs from lo
info: discovering all IPs from eth0
info: relevant IPs 172.16.5.205=null
info: notification server listening on port 3500
http server listening on port 5005
no preset file, ignoring...
info: scanning for players in ip 172.16.5.205
... and more information when it discovers your speakers

[8] You can now issue luup.inet.wget's to the client from openLuup... For instance, luup.inet.wget("http://{your_ip_here}:5005/{room}/state") will return this json payload.
Code: [Select]
{
"currentTrack":{
"artist":"Origen",
"title":"Ave Maria (f.shubert)",
"album":"Ave Maria",
"albumArtURI":"/getaa?s=1&u=x-sonosprog-http%3asong%253a6247994.mp4%3fsid%3d204%26flags%3d8224%26sn%3d4",
"duration":257,
"uri":"x-sonosprog-http:song%3a6247994.mp4?sid=204&flags=8224&sn=4",
"radioShowMetaData":"",
"absoluteAlbumArtURI":"http://10.0.4.24:1400/getaa?s=1&u=x-sonosprog-http%3asong%253a6247994.mp4%3fsid%3d204%26flags%3d8224%26sn%3d4",
"streamInfo":"",
"type":"track"
},
"nextTrack":{
"uri":"x-sonosprog-http:song%3a513324605.mp4?sid=204&flags=8224&sn=4",
"albumArtURI":"/getaa?s=1&u=x-sonosprog-http%3asong%253a513324605.mp4%3fsid%3d204%26flags%3d8224%26sn%3d4",
"absoluteAlbumArtURI":"http://10.0.4.24:1400/getaa?s=1&u=x-sonosprog-http%3asong%253a513324605.mp4%3fsid%3d204%26flags%3d8224%26sn%3d4",
"title":"Silent Noon",
"artist":"",
"album":"Silent Noon"
},
"volume":24,
"mute":false,
"trackNo":4,
"elapsedTime":149,
"elapsedTimeFormatted":"02:29",
"zoneState":"PLAYING",
"playerState":"PLAYING",
"zonePlayMode":{
"shuffle":false,
"repeat":false,
"crossfade":false
}
}

You can visit https://github.com/jishi/node-sonos-http-api for additional actions....
Todo's: Provide a say.js patched with support for volume on a say action, currently hardcoded to 40%.
« Last Edit: April 11, 2016, 05:00:50 pm by CudaNet »
openLuup, AltUI, Zway and HomeWave, enough said...

Offline CudaNet

  • Beta Testers
  • Hero Member
  • *****
  • Posts: 1401
  • Karma: +42/-11
  • Chimichanga !
Re: openLuup: Sonos
« Reply #44 on: April 11, 2016, 04:19:29 pm »
reserved for Wolf TTS modifications to say.js and settings.json
Code: [Select]
[1] Adapted say.js to call Wolf P. TTS v 2.1.2. rather than voiceRSS.
[2] Implemented volume for say, else defaults to volume defined within settings.json or 40%; e.g. /volume/30
[3] Implemented (acapela/infovox; HQ voices) voice selection or defaults to voice defined within settings.json. e.g. /Peter
[4] Changes to rc.local for API persistence.

Todo's: Write all this up into a formal easy-to-follow guide and host the files...
« Last Edit: April 11, 2016, 04:56:39 pm by CudaNet »
openLuup, AltUI, Zway and HomeWave, enough said...