Page 5 of 12
Re: FlatZ Frontpage
Posted: Friday 25 September 2015 15:34
by galadril
I did found a problem in the lights.html:
<script type="text/javascript" src="
http://code.jquery.com/jquery-2.1.4.min.js"></script>
should be:
<script type="text/javascript" src="js/jquery-2.1.4.js"></script>
Re: FlatZ Frontpage
Posted: Saturday 26 September 2015 11:57
by galadril
Please check the latest verions:
https://github.com/galadril/FlatZ-Frontpage
- I've added a News page (rss)
- Lot's of fixes bij Patrick (for ipad/device, Rounded css added, fix for Kaku dimmers, etc)
Re: FlatZ Frontpage
Posted: Saturday 26 September 2015 13:22
by SwordFish
Verry nice.
Are you also working to at scenes to frontpage?
That will be awesome.
Re: FlatZ Frontpage
Posted: Sunday 27 September 2015 15:38
by mvveelen
galadril wrote:mvveelen wrote:I haven't looked at the code yet, because I'm facing some other challenges, but maybe I can try to find out where it goes wrong. What parts do I have to look at exactly?
Krommenie yes

(Assendelft)..
But please check the methods.js, it happens in this function:
function setLightDimmer(idx, bright)
If you compare the json calls with the json calls of Domoticz itself, maybe you can find the problem..
Uploaded the last version, and the dim level just doesn't seem to go well.
If I take a look at the other frontpage, the code for the dim level is like this (there seems to be a little trick to get the right dim levels):
Code: Select all
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 + 10)/100 * 16) + 0.5;
if(d > 16) {
d = 16;
}
$.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 = ((level-0.1 )/100*16) ;
//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();
}
So the value is divided by 16 and there is a .5 added for rounding the values to the right values?! So, the level is not in %, but in steps. Is there a way you can add / change this in a next version?
Re: FlatZ Frontpage
Posted: Sunday 27 September 2015 16:35
by bickel
Great project!
Is it already possible to add setpoint devices? I have several danfoss radiator thermostats i would like to see.
Several people already asked for webcam support...i'd like to support that feature also.
Another small nice to have would be the ability to centralized disable some menu items, like logs and news.
Gr,
ROnald
Re: FlatZ Frontpage
Posted: Sunday 27 September 2015 21:45
by Patrick
mvveelen wrote:Uploaded the last version, and the dim level just doesn't seem to go well.
If I take a look at the other frontpage, the code for the dim level is like this (there seems to be a little trick to get the right dim levels):
Code: Select all
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 + 10)/100 * 16) + 0.5;
if(d > 16) {
d = 16;
}
$.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 = ((level-0.1 )/100*16) ;
//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();
}
So the value is divided by 16 and there is a .5 added for rounding the values to the right values?! So, the level is not in %, but in steps. Is there a way you can add / change this in a next version?
What isn't going well?
I'm testing with a KaKu dimmer module and I can't detect any problems.
In settings.js you need to set the maxDimLevel (16 when KaKu), the formula transforms the 0-100 slider value to 0-maxDimLevel value.
Re: FlatZ Frontpage
Posted: Sunday 27 September 2015 21:52
by mvveelen
So I have to add the , '16' to get it to work? Will do tomorrow and test it. Thanks !
Re: FlatZ Frontpage
Posted: Sunday 27 September 2015 21:56
by Patrick
mvveelen wrote:So I have to add the , '16' to get it to work? Will do tomorrow and test it. Thanks !
Yep, in settings.js there's a extra variable added to define the maxDimLevel.
If the code reads no maxDimLevel it will set maxDimLevel to 100.
Re: FlatZ Frontpage
Posted: Monday 28 September 2015 8:39
by galadril
Another small nice to have would be the ability to centralized disable some menu items, like logs and news.
In latest version:
https://github.com/galadril/FlatZ-Frontpage
In settings.js:
//Menu settings
$.Graph = true;
$.News = true;
$.Log = true;
$.Lights = true;
$.Weather = true;
We're looking into your other requests!
Re: FlatZ Frontpage
Posted: Monday 28 September 2015 15:53
by galadril
Several people already asked for webcam support...i'd like to support that feature also.
Working on it, It's now working with camera image url...

Re: FlatZ Frontpage
Posted: Monday 28 September 2015 16:03
by SwordFish
Looks great.
I asked before do you have plans to ad scenes to the frontpage (maybe you over see it)?
Re: FlatZ Frontpage
Posted: Monday 28 September 2015 16:25
by galadril
SwordFish wrote:add scenes to the frontpage (maybe you over see it)?
I'll look into it

Re: FlatZ Frontpage
Posted: Monday 28 September 2015 18:59
by mvveelen
Great, got the dim levels working. My bad....
Question though: is it possible to update the % of the dim level too? When I have it at 53% and I set it to, let's say 100%, it keeps displaying the 53%
Would be nice to see the right % at the same time I change it.
Re: FlatZ Frontpage
Posted: Monday 28 September 2015 19:08
by SwordFish
galadril wrote:SwordFish wrote:add scenes to the frontpage (maybe you over see it)?
I'll look into it

That would be great.
Re: FlatZ Frontpage
Posted: Monday 28 September 2015 19:11
by Minglarn
galadril wrote:Several people already asked for webcam support...i'd like to support that feature also.
Working on it, It's now working with camera image url...
OMG! =)
Cant wait...
Re: FlatZ Frontpage
Posted: Monday 28 September 2015 21:24
by mvveelen
Aside from the % status for the dim level, I have some questions:
- I have Kodi on my RPi and I'm trying to add the Kodi status to the frontpage. All it shows is....nothing. Only an image. Is it possible or am I trying something that hasn't been added (yet)?
- When I look at my power consumption, it shows me:
606 Watt
Today:
6.674 kWh
Total:
890697;793095;0;0;606;0
What about the "Total:" ? A lot of numbers, but it doesn't make sense to me. Am I forgetting something?
- is it possible to make the "switch toggled" pop-up-thingy optional? It's slowing the switching down, so I'd rather have it off or deleted....
Re: FlatZ Frontpage
Posted: Monday 28 September 2015 22:07
by CodeItAway
First of all, compliments for your hard work.
I think something went wrong with one of the latest commits. Some files have text like these in them:
<<<<<<< HEAD
Re: FlatZ Frontpage
Posted: Monday 28 September 2015 22:13
by jjnj
Wow you are really making great progress
Re: FlatZ Frontpage
Posted: Tuesday 29 September 2015 20:53
by mvveelen
Just wanted 1 thing to add to my list of heavy demands

:
The left column shows the lights. ON or OFF. When it's OFF, everything is fine.
When it's ON, the lights with a dimmer, show the level.....and that is kind of....ugly. The level (text) runs through the text of the light under it, if you know what I mean. Could the level in the left column be set to 'not show' ?
Re: FlatZ Frontpage
Posted: Wednesday 30 September 2015 11:40
by Heisenberg
galadril wrote:Several people already asked for webcam support...i'd like to support that feature also.
Working on it, It's now working with camera image url...

Hi galadril, where do I modify the url streams for the IP cameras?
Also in the camera.html I don't see the navigation on the left (Switches) anymore