I see you are using the default Mediaplayer icon. On this page (https://drive.google.com/folderview?id= ... sp=sharing) you can find a beautiful Sonos icon

Moderator: leecollings
benotje wrote:No I did not but this does not helpG3rard wrote:@benotje, did you save the LUA as a Device in the Event page?
The pulldown on the right top now probably says All. Change that to Device and save the LUA script.
I can not specify LUA IDX: 104
![]()
after I got my raspberry restart it works
Top Thanks for your help
Now again I can continue, I am happy with it![]()
Code: Select all
var vs2 = JSON.parse(vs2);
Sent you a PM for some more details.HansLe wrote:@G3rard. I have a problem to define my Sonos device. There seems to be a problem with line 290 in frontpage.js.However I can see the error message "Uncaught SyntaxError: Unexpected token <" I don't know how to solve this. I don't know how to inspect a variable with inspect. Your advise pleaseCode: Select all
var vs2 = JSON.parse(vs2);
Code: Select all
//Volume up of Sonos
function ChangeVolumeUp(idx)
{
var url = "http://172.16.0.12/" + "sonos/index.php?zone=" + idx + "&action=VolumeUp";
console.log(url);
$.ajax({
url: url,
async: true,
dataType: 'html', //was json but that always gave an error although it's working
success: function(){
console.log('Volume up');
},
error: function(){
console.log('ERROR');
}
});
RefreshData();
}
//Volume down of Sonos
function ChangeVolumeDown(idx)
{
var url = "http://172.16.0.12/" + "sonos/index.php?zone=" + idx + "&action=VolumeDown";
console.log(url);
$.ajax({
url: url,
async: true,
dataType: 'html',
success: function(){
console.log('Volume down');
},
error: function(){
console.log('ERROR');
}
});
RefreshData();
}
Did you change to an on/off switch?luckydoggie wrote:@HansLe
Great! Got it working, thanks! Next problem is that if I enable the show_sonos_volume it doesn't work anymore. Do you got this working?
#Edit: With not working I mean that there are two lines at the frontpage where the data should be. All calls to the sonos that are necessary are working in browser.
Code: Select all
var vs1 = myTrim(VolumeSonos(item.idx)); //show volume
var vs2 = myTrim(MediaInfoSonos(item.idx)); //show what's playing - radio
var vs3 = myTrim(PositionInfoSonos(item.idx)); //show what's playing - albums
var vs2 = JSON.parse(vs2); //show what's playing to array
var vs3 = JSON.parse(vs3); //show what's playing to array
Code: Select all
var vs1 = myTrim(VolumeSonos(item.idx)); //show volume
console.log('volume: ' + vs1)
var vs2 = myTrim(MediaInfoSonos(item.idx)); //show what's playing - radio
console.log('vs2 part1: ' + vs2)
var vs3 = myTrim(PositionInfoSonos(item.idx)); //show what's playing - albums
console.log('vs3 part1: ' + vs3)
var vs2 = JSON.parse(vs2); //show what's playing to array
console.log('vs2 part2: ' + vs2)
var vs3 = JSON.parse(vs3); //show what's playing to array
console.log('vs3 part2: ' + vs3)
Users browsing this forum: No registered users and 1 guest