Re: NEW frontpage.html - request comments
Posted: Tuesday 07 June 2016 14:07
franzelare wrote:Did anyone integrate a color selector for HUE of other RGB/RGBW dimmers in this frontpage?
Open source Home Automation System
https://forum.domoticz.com/
franzelare wrote:Did anyone integrate a color selector for HUE of other RGB/RGBW dimmers in this frontpage?
so I manage to get the foscam working with the following in frontpage.htmllukev wrote:Hi guys,jannl wrote:Basically this did the trick indeed.G3rard wrote: I use a picture of the camera on the frontpage and when I click on the picture it opens the live stream in a popup. For the live stream the stream of Domoticz is used.
This is the code I am using in frontpage.html for the popup:Idx 2 is the idx of the camera.Code: Select all
<div id="popup_camera"><img src="http://ip:port/camsnapshot.jpg?idx=2&t=" onClick="lightbox_close('camera');" width="640" height="480" onload='setTimeout(function() {src = src.substring(0, (src.lastIndexOf("t=")+2))+(new Date()).getTime()}, 100)' onerror='setTimeout(function() {src = src.substring(0, (src.lastIndexOf("t=")+2))+(new Date()).getTime()}, 1000)' class='bigcamera' /></div>
Maybe this can help you?
Have been wrestling with this frontpage for quite a few days now. I'm almost there I guess...
I can't seem to get my Foscam working. I followed all the steps, including the one above. But I don't see a snapshot of the camera in the frontpage.
I have used this:
But when I do, I get a blank frame in the cell (the one with the torn paper; missing picture kind-a-thing). The strange thing is, when I enter the URL directly in my browers, a perfect snapshot is downloaded to my PC.Code: Select all
src="http://192.168.1.153:8084/camsnapshot.jpg?idx=1&t=" onClick="lightbox_close('camera2');" width="720px" height="480px" onload='setTimeout(function() {src = src.substring(0, (src.lastIndexOf("t=")+2))+(new Date()).getTime()}, 15000)' onerror='setTimeout(function() {src = src.substring(0, (src.lastIndexOf("t=")+2))+(new Date()).getTime()}, 1000)' class='' /></div> <div id="fade"></div>
This URL:When I click the frame, the popup appears, but with the snapshot, no streaming video.... What am I missing here?? Driving me nuts...Code: Select all
http://192.168.1.153:8084/camsnapshot.jpg?idx=1&t=
lukev wrote:thanks!
That indeed did the trick for me! Thanks!
Next (and last) hurdle for me is the combination of zwave and kaku dimmers. I've used the last frontpage jannl posted in this thread. Kaku dimmers work like a charm. I can dim from 1 to 100%.
Zwave dimmers start somewhere around 19, and go back to 1 no matter which button I push. Once on "1" they are not changing value anymore.
Someone some clever thoughts about that maybe?
Code: Select all
//Selector Switches
if(vtype == 'Selector') {
vdata= item['Level']; //added to show setpoint in stead on or off
var lvlnames = item['LevelNames'].split("|");
var lvlindex;
if (item['Level'] =='0'){
lvlindex = 0;
}
else{
var temp = item['Level'] + "";
lvlindex = temp.slice(0, -1);
}
var LevelName = lvlnames[lvlindex];
var hlp = '<span style='+vattr+'>'+ LevelName+'</span>';
var vplusmin05 = '10'; //added to set setpoint with 10 steps
var plus = "<img src=icons/up2.png align=right vspace=12 width=30 onclick=BlindChangeStatus('plus'," +vdata+ "," + item.idx + ")>";
var min = "<img src=icons/down3.png align=left vspace=12 width=30 onclick=BlindChangeStatus('min'," +vdata+ "," + item.idx + ")>";
//console.log(vdata);
vdata = min.concat(hlp,plus);
}
Code: Select all
['148','Selector', 'cell13', 'Spotify Playlist','0','5'],
Try replacing txt_on with "On" and txt_off with "Off", the value for vdata must be what you find whenlukev wrote:I'm switching over to the frontpage from G3rard, works great.
Now I would like to use some images for my PIR's in a couple of cells.
I have no coding skills whatsoever, so I'm looking at the rest of the script and try to accomplish something
I have added this lines to frontpage.js:
and this line to frontpage_settings.js (at the top, amongst the other 'special items')Code: Select all
//replace pir with icon if (item.idx == idx_pirspeelkamer && vdata == txt_on){ vdata=new String(vdata).replace( txt_on, "<img src=icons/motion48-on.png"); } if (item.idx == idx_pirspeelkamer && vdata == txt_off){ vdata=new String(vdata).replace( txt_off, "<img src=icons/motion48-off.png"); }
And changed this line in the user-settings of frontpage_settings.js:Code: Select all
var idx_pirspeelkamer = '258';
Now the text in the cell has vanished, but there is now image. I only see a litte box where the image should be....And yes, the icons are placed in the icons-folderCode: Select all
['258','Status', 'cell2_7', 'Motion speelkamer','0','4'],
Can someone figure out my mistake here?
Thanks for the Selector switch code.racquemis wrote:Great FrontPage,
This is what i currently have setup:
Made some changes to the css files to better fit 10 inch tablets (1280x800) and added support for Selector switches
Here the code for the selector switches if anyone is interested
Just add the following above the text "//Blinds" in the FrontPage.js fileThen in FrontPage-settings.js use something like this:Code: Select all
//Selector Switches if(vtype == 'Selector') { vdata= item['Level']; //added to show setpoint in stead on or off var lvlnames = item['LevelNames'].split("|"); var lvlindex; if (item['Level'] =='0'){ lvlindex = 0; } else{ var temp = item['Level'] + ""; lvlindex = temp.slice(0, -1); } var LevelName = lvlnames[lvlindex]; var hlp = '<span style='+vattr+'>'+ LevelName+'</span>'; var vplusmin05 = '10'; //added to set setpoint with 10 steps var plus = "<img src=icons/up2.png align=right vspace=12 width=30 onclick=BlindChangeStatus('plus'," +vdata+ "," + item.idx + ")>"; var min = "<img src=icons/down3.png align=left vspace=12 width=30 onclick=BlindChangeStatus('min'," +vdata+ "," + item.idx + ")>"; //console.log(vdata); vdata = min.concat(hlp,plus); }
Code: Select all
['148','Selector', 'cell13', 'Spotify Playlist','0','5'],
Code: Select all
//Selector Switches
if(vtype == 'Selector') {
vdata = item['Level']; //get current level
var lvlnames = item['LevelNames'].split("|"); //get all levels
var countlevels = item['LevelNames'].split("|").length-1; //count the number of levels
var lvlindex;
if (item['Level'] == '0'){
lvlindex = 0;
}
else {
var temp = item['Level'] + "";
lvlindex = temp.slice(0, -1);
}
var LevelName = lvlnames[lvlindex];
if (LevelName == 'Off') {
LevelName = txt_off;
}
if(lvlindex == 0) { //switch is off
//allow button to switch on
var hlp = '<span onclick="BlindChangeStatus(\'plus\', '+vdata+', '+item.idx+');lightbox_open(\'switch\', '+switch_on_timeout+', '+txt_switch_on+')"; style='+alarmcss+'>'+LevelName+'</span>';
var plus = ""; //no up when switch is off
var min = ""; //no down when switch is off
}
else { //switch is on
if (lvlindex == countlevels) { //max level, don't allow plus button to go to next level which isn't there
var plus = "<img src=icons/up.png align=right vspace=12 width=30>";
}
else {
var plus = "<img src=icons/up.png align=right vspace=12 width=30 onclick=BlindChangeStatus('plus'," +vdata+ "," + item.idx + ")>";
}
var min = "<img src=icons/down.png align=left vspace=12 width=30 onclick=BlindChangeStatus('min'," +vdata+ "," + item.idx + ")>";
//allow button to switch off
var hlp = '<span onclick="SwitchToggle('+item.idx+', \'Off\');lightbox_open(\'switch\', '+switch_off_timeout+', '+txt_switch_off+')"; style='+alarmcss+'>'+LevelName+'</span>';
}
//console.log(vdata);
vdata = min.concat(hlp,plus);
}
Thanks The gas meter works well.lukev wrote:For total amount of gas you have to use the input from "Data" or "Counter", for the day consumption you have to use "CounterToday". See the difference in the idx-output from my P1 gasmeterRobertn wrote:Hallo I have two question
How can I support the nest thermostat so I can set the temperature, with a “+” and “-“ button.
And 1 have a P1 smart meter.
In domoticz I can see my gas use per day.
In the FrontPage I only see the total use of my gas. How do i get the day used information?
BTW I love this frontpage
Thanks in advanced Robert
Thanks for the info! And just to be sure, they (frontpage files when moved into ../www directory) do not get removed in an update either?jannl wrote:Basically they are all unique files. Frontpage file do not exist in a clean installation. To be sure, first make a backup of your www directory incl. subdirectorys.