I tried
Code: Select all
var d = (32/100)*level;
Moderator: leecollings
Code: Select all
var d = (32/100)*level;
Code: Select all
['25', 'Level', 'cell2', 'Konyha LED','1','1'],
Code: Select all
//Dimmer, only works with 1-16 dimmer for now
function ChangeStatus(OpenDicht,level,idx,currentlevel)
{
//When switched off return to previous level, no matter if plus or min pressed
if (level == txt_off) {
if (currentlevel == 1) {
currentlevel++;
}
//console.log("In uit",currentlevel);
$.ajax({
url: $.domoticzurl+"/json.htm?type=command¶m=switchlight&idx=" + idx + "&switchcmd=Set Level&level=" + currentlevel,
async: false,
dataType: 'json',
success: function(){
console.log('SUCCES');
},
error: function(){
console.log('ERROR');
}
});
}
else {
level = level * 1;
console.log(OpenDicht,level);
if (OpenDicht == "plus")
{
var d = level * 3.125;
console.log("in plus",d,level);
if(d > 32) {
d = 32;
}
$.ajax({
url: $.domoticzurl+"/json.htm?type=command¶m=switchlight&idx=" + idx + "&switchcmd=Set Level&level=" + d,
async: false,
dataType: 'json',
success: function(){
console.log('SUCCES');
},
error: function(){
console.log('ERROR');
}
});
}
else {
var d = Math.round((level / 100.0) * 32);
console.log("in min",d,level);
if( d < 0 ){
d = 0;
}
$.ajax({
url: $.domoticzurl+"/json.htm?type=command¶m=switchlight&idx=" + idx + "&switchcmd=Set Level&level=" + d,
async: false,
dataType: 'json',
success: function(){
console.log('SUCCES');
},
error: function(){
console.log('ERROR');
}
});
}
}
RefreshData();
}
Code: Select all
//Dimmer
if(vtype == 'Level' && item.SwitchType == 'Dimmer') {
Code: Select all
} else if (item.MaxDimLevel == 32) {
//vdata2 = vdimmervalue; //used for ChangeStatus
//vdimmervalue = Math.round(vdimmervalue / 5)*5; //round to ten
vdata = vdimmervalue; //show current dim value
var hlp = '<span onclick="SwitchToggle('+item.idx+',\'Off\');lightbox_open(\'switch\', '+switch_off_timeout+', '+txt_switch_off+')"; style='+alarmcss+'>'+ vdata+'</span>';
var plus = "<img src=icons/up.png align=right vspace=12 onclick=ChangeStatus('plus'," + vdata + "," + item.idx + ","+ vdimmercurrent+")>"; //align=right replaced by hspace and vspace
var min = "<img src=icons/down.png align=left vspace=12 onclick=ChangeStatus('min'," + vdata + "," + item.idx + ","+ vdimmercurrent+")>" //align=left
}
+1denisj wrote:Albert,albertvandam wrote:Dear all,
With all the examples and code in this forum, I have managed to create a pretty good frontpage which runs on a wall mounted tablet.
can you please upload your frontpage packet some wear in order to download it and take some sample please ?
Thanks in advance
Denis
Code: Select all
var d = ((level + 10)/100 * 32) + 0.5;
Code: Select all
var d = level * 3.125;
Code: Select all
console.log("in plus",d,level);
Code: Select all
['181','Minuten', 'cell8', 'Alblasserdam-Gorinchem','1','0'],
Code: Select all
['181','Data', 'cell8', 'Alblasserdam-Gorinchem','1','0'],
Super it's working now. Thank you!
G3rard wrote:To install the frontpage on a Synology, enable Web station and put the frontpage in the web folder.
Hi G3rard,G3rard wrote:There is no other documentation, but let my try to help you.
You have to use the IP of your Sonos in the config.php, not the IP of the Pi.
Part of the config.php where 115 is the IDX in Domoticz.The url you have to use in this example is:Code: Select all
'zones' => array( '115' => '192.168.1.161', /* kitchen*/ ),
And you have to run the PHP on a PHP enabled web server. So if that's not installed on your Pi, you have to install PHP on it.Code: Select all
http://yourserver/tablet/sonos/index.php?zone=115&action=Play
did you make any configutations yet?
Have been waiting for over an hour. Still no luck.ubfssF wrote: Page loads slowly, but if configured right it should work.
Users browsing this forum: No registered users and 0 guests