Plugin: ALT Sonos

[quote=“kyle.dawson, post:20, topic:199987”]Tried luup reload and discover. Still no Group info by have player info.

Any changes to cloud code that I need to rebuild?[/quote]

If badges are green it should be ok but it does not hurt to try to redeploy both Google side and Vera side once from scratch.
Also Whats in JavaScript console ?

Here is what console shows.

SyntaxError: redeclaration of const VOLDELTA data_request:1:1
J_ALTSonos.js:1:1 text/</<
http://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js:2:48441
each
http://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js:2:2571
each
http://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js:2:1238
text/<
http://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js:2:48425
z
http://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js:2:31764
text
http://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js:2:48362
_deviceDrawControlPanel/</<
http://192.168.1.120/port_3480/J_ALTUI_uimgr.js:4356:48
_getFileContent J_ALTUI_utils.js:4054:5 _deviceDrawControlPanel/<
http://192.168.1.120/port_3480/J_ALTUI_uimgr.js:4338:8
each
http://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js:2:2621
_deviceDrawControlPanel
http://192.168.1.120/port_3480/J_ALTUI_uimgr.js:4334:6
pageControlPanel
http://192.168.1.120/port_3480/J_ALTUI_uimgr.js:6713:3
displayPage
http://192.168.1.120/port_3480/J_ALTUI_uimgr.js:15530:6
changePage
http://192.168.1.120/port_3480/J_ALTUI_uimgr.js:15535:4
_setInteractivity/<
http://192.168.1.120/port_3480/J_ALTUI_uimgr.js:7036:6
dispatch
http://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js:2:41720
add/y.handle
http://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js:2:39774
TypeError: fav.service is undefined[Learn More] data_request:271:5
getFavoritesMenuitems/< J_ALTSonos.js:271:5 map
http://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js:2:3169
getFavoritesMenuitems J_ALTSonos.js:265:11 getHtml J_ALTSonos.js:290:18 ALTSonos_Households/< J_ALTSonos.js:325:64 u
http://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js:2:27452
fireWith
http://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js:2:28202
k
http://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js:2:77649
n/<
http://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js:2:79907

[quote=“kyle.dawson, post:22, topic:199987”]Here is what console shows.

SyntaxError: redeclaration of const VOLDELTA data_request:1:1
J_ALTSonos.js:1:1 text/</<
http://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js:2:48441
each
http://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js:2:2571
each
http://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js:2:1238
text/<
http://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js:2:48425
z
http://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js:2:31764
text
http://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js:2:48362
_deviceDrawControlPanel/</<
http://192.168.1.120/port_3480/J_ALTUI_uimgr.js:4356:48
_getFileContent J_ALTUI_utils.js:4054:5 _deviceDrawControlPanel/<
http://192.168.1.120/port_3480/J_ALTUI_uimgr.js:4338:8
each
http://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js:2:2621
_deviceDrawControlPanel
http://192.168.1.120/port_3480/J_ALTUI_uimgr.js:4334:6
pageControlPanel
http://192.168.1.120/port_3480/J_ALTUI_uimgr.js:6713:3
displayPage
http://192.168.1.120/port_3480/J_ALTUI_uimgr.js:15530:6
changePage
http://192.168.1.120/port_3480/J_ALTUI_uimgr.js:15535:4
_setInteractivity/<
http://192.168.1.120/port_3480/J_ALTUI_uimgr.js:7036:6
dispatch
http://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js:2:41720
add/y.handle
http://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js:2:39774
TypeError: fav.service is undefined[Learn More] data_request:271:5
getFavoritesMenuitems/< J_ALTSonos.js:271:5 map
http://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js:2:3169
getFavoritesMenuitems J_ALTSonos.js:265:11 getHtml J_ALTSonos.js:290:18 ALTSonos_Households/< J_ALTSonos.js:325:64 u
http://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js:2:27452
fireWith
http://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js:2:28202
k
http://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js:2:77649
n/<
http://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js:2:79907[/quote]

I suspect a cache issue. please follow the following procedure
1- in ALTUI go to Misc/ Options , go down to Cache control and click Clear File DB
2- in UI7, reupload all ALTSONOS files from github
3- reload Luup
4- refresh browser, clear the cache (ctrl+f5) before going into sonos panel

[EDIT] : you may want to try v0.11, I fixed a potential issue just in case it is related

Followed steps, cleared cache same issue. Updated code, cleared cache, same issue.

Console output looks a little different:

Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user?s experience. For more help http://xhr.spec.whatwg.org/ jquery.min.js:2:79417

TypeError: fav.service is undefined[Learn More] data_request:272:5
getFavoritesMenuitems/< J_ALTSonos.js:272:5 map
http://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js:2:3169
getFavoritesMenuitems J_ALTSonos.js:266:11 getHtml J_ALTSonos.js:291:18 ALTSonos_Households/< J_ALTSonos.js:326:64 u
http://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js:2:27452
fireWith
http://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js:2:28202
k
http://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js:2:77649
n/<
http://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js:2:79907

I also rebuild the cloud functions from scratch. Reloaded Luup, Rebooted Vera, clear cache, tried Firefox and Chrome browser, still getting this error in Java Console:

TypeError: fav.service is undefined[Learn More] data_request:272:5
getFavoritesMenuitems/< J_ALTSonos.js:272:5 map
http://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js:2:3169
getFavoritesMenuitems J_ALTSonos.js:266:11 getHtml J_ALTSonos.js:291:18 ALTSonos_Households/< J_ALTSonos.js:326:64 u
http://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js:2:27452
fireWith
http://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js:2:28202
k
http://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js:2:77649
n/<
http://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js:2:79907

Looks like issue with this line of code:

			name += '<span>' + (fav.service.name || '') +":"+fav.name + '</span>'

[quote=“kyle.dawson, post:25, topic:199987”]I also rebuild the cloud functions from scratch. Reloaded Luup, Rebooted Vera, clear cache, tried Firefox and Chrome browser, still getting this error in Java Console:

TypeError: fav.service is undefined[Learn More] data_request:272:5
getFavoritesMenuitems/< J_ALTSonos.js:272:5 map
http://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js:2:3169
getFavoritesMenuitems J_ALTSonos.js:266:11 getHtml J_ALTSonos.js:291:18 ALTSonos_Households/< J_ALTSonos.js:326:64 u
http://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js:2:27452
fireWith
http://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js:2:28202
k
http://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js:2:77649
n/<
http://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js:2:79907

Looks like issue with this line of code:

			name += '<span>' + (fav.service.name || '') +":"+fav.name + '</span>'[/quote]

this is a consequence of something else. put it in debug mode and send me the log of a complete luup reload sequence please

[quote=“amg0, post:26, topic:199987”][quote=“kyle.dawson, post:25, topic:199987”]I also rebuild the cloud functions from scratch. Reloaded Luup, Rebooted Vera, clear cache, tried Firefox and Chrome browser, still getting this error in Java Console:

TypeError: fav.service is undefined[Learn More] data_request:272:5
getFavoritesMenuitems/< J_ALTSonos.js:272:5 map
http://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js:2:3169
getFavoritesMenuitems J_ALTSonos.js:266:11 getHtml J_ALTSonos.js:291:18 ALTSonos_Households/< J_ALTSonos.js:326:64 u
http://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js:2:27452
fireWith
http://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js:2:28202
k
http://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js:2:77649
n/<
http://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js:2:79907

Looks like issue with this line of code:

			name += '<span>' + (fav.service.name || '') +":"+fav.name + '</span>'[/quote]

this is a consequence of something else. put it in debug mode and send me the log of a complete luup reload sequence please[/quote]

this is fixed with a bugfix in github GitHub - amg0/ALTSonos: ALT Sonos plugin for VERA

Amazing amg0 that you also rebuild the Sonos plugin !! Question: does TTS also work?

Yes TTS works great. You would call it thru the ALTUI actions. It would use the ALTSonos for TTS with with your Voice RSS Key. This is in options for ALTUI.

Ok thanks, but is it also possible without using ALTUI, so only the ALT sonos plugin?

I do not think so. The TTS part is in the ALTUI. ALTUI calls a voice service to create mp3, it passes the mp3 file to ALTSonos. So there is no TTS logic in the ALTSonos Today.

Correct. There is a audio clip upnp action ( the same altui uses ) but the tts Logic and mp3 generation is happening before that so in altui.

This seems like an awesome plugin.

I thought I’d throw it out there: is there anyway to use this plugin with AltUI on openLuup?

[quote=“Cheddah, post:33, topic:199987”]This seems like an awesome plugin.

I thought I’d throw it out there: is there anyway to use this plugin with AltUI on openLuup?[/quote]

I use it on ALTUI, not tested on openluup but I do not see why it would not work. but it is not perfect ( support for TTS is a bit rough ) and installation of the google cloud part requires very strict following of instruction. some managed to do it fine ( and I use it daily too )

Time to put it on AltAppStore?

V 0.26

add support in UI for playlists

I had a go at trying this plugin today. I struggled a bit with the Google cloud readme instructions because I think maybe Google have changed their interface menus and terminology. However, I still managed to get this working first time, so my sincere thanks to the author and contributors for their work. Time now for me to have a play and explore what it can do… :slight_smile:

Wow congrats
I did not put this plugin in the App Store as I consider it is a bit rough in terms on install.
But I use it more than daily for me and it works fine.
There is also integration with Altui so altui recognizes it and is able to play message through it with a single upnp action.

for the users of ALTSONOS

Sonos changed their Sonos API, I had to make a small adjustment in the ALTSONOS plugin. v0.27 in GitHub - amg0/ALTSonos: ALT Sonos plugin for VERA solves the issue