Page 4 of 28
Re: Dashticz - Bug report
Posted: Wednesday 10 May 2017 23:09
by wizjos
robgeerts wrote:How does your local-address look like?
So I can fix this in next release
That's a simple one, it is literally: 'db.sqlite'
Little explanation: I have a Synology with Baikal as a caldav server. Works perfectly, although ICS is not supported in that version of Baikal... I've found out that directly reading the sqlite file (in the old way, before the latest beta) gave me the output I wanted (eg. a calendar).
So I've made a script that copies the Baikal Sqlite file every 'x' minutes to the root of Dashticz... Thus ensuring I stay up-to-date.
I guess the internal address is either simply db.sqlite or my internal IP-address/db.sqlite...
Regards,
Wizjos
Re: Dashticz - Bug report
Posted: Wednesday 10 May 2017 23:14
by wizjos
robgeerts wrote:wizjos wrote:@robgeerts: Testing heavily with the latest beta (I hope, because you're so fast!)...
Having trouble getting the nu.nl rss feed to life: nothing shows...
But besides that issue I've noticed for some time (and thus different beta's) when debugging with Edge the console logs: '140 > 'getBlock_140' is undefined' (where the numbers are varied, so this is just an example). I can see where it's generated, but what causes it?
Regards,
Wizjos
How is it defined in your config?
Console logs are gone in latest beta
Good to read the console logs are gone.... Nice, but when it causes a flooding in the console it's more of a nuisance than a blessing....
I'm not completely sure what you mean by 'How is it defined in your config?'... How is what defined?
Sorry if I'm not getting the point here
Regards,
Wizjos
Re: Dashticz - Bug report
Posted: Thursday 11 May 2017 9:16
by robgeerts
I mean the piece of code in config.js where you define what rss-feed must be used..
Re: Dashticz - Bug report
Posted: Thursday 11 May 2017 9:26
by wizjos
robgeerts wrote:I mean the piece of code in config.js where you define what rss-feed must be used..
Ah right...
That's: var _NEWS_RSSFEED = '
http://www.nu.nl/rss/algemeen';
(never changed...)
Greets,
Wizjos
Re: Dashticz - Bug report
Posted: Thursday 11 May 2017 9:29
by robgeerts
This is kind of old way of showing news feeds.
Could you try defining it as:
Code: Select all
blocks['news_1'] = {}
blocks['news_1']['feed'] = 'https://cors-anywhere.herokuapp.com/http://www.nu.nl/rss/Algemeen';
And in the columns:
Re: Dashticz - Bug report
Posted: Thursday 11 May 2017 14:56
by gielie
I don't know if this is a real bug but, i use this code for presence detection.
Code: Select all
//Thuis
function getBlock_6(device,idx){
$('.block_'+idx);
var html='';
html+='<div class="col-xs-4 col-icon">';
if(device['Status']=='Off') html+='<img src="img/cust_away.png" class="off icon" />';
else html+='<img src="img/cust_home.png" class="on icon" />';
html+='</div>';
html+='<div class="col-xs-8 col-data">';
html+='<strong class="title">'+device['Name']+'</strong><br />';
if(device['Status']=='Off') html+='<span class="state">AFWEZIG</span>';
else html+='<span class="state">AANWEZIG</span>';
if(_SHOW_LASTUPDATE) html+='<br /><span class="lastupdate">'+moment(device['LastUpdate']).format(_LASTUPDATE_FORMAT)+'</span>';
html+='</div>';
return html;
}
and this looks like this
I would like to add
blocks [#]['show_lastupdate'] = true;
But this doesnt work.
When i remove the Thuis/afwezig code i get this.
With the [show_lastupdate] working.
Id like to use both, is this a bug or a feature request?
Re: Dashticz - Bug report
Posted: Thursday 11 May 2017 15:32
by robgeerts
Try this:
Code: Select all
//Thuis
function getBlock_6(device,idx){
$('.block_'+idx);
var html='';
html+='<div class="col-xs-4 col-icon">';
if(device['Status']=='Off') html+='<img src="img/cust_away.png" class="off icon" />';
else html+='<img src="img/cust_home.png" class="on icon" />';
html+='</div>';
html+='<div class="col-xs-8 col-data">';
html+='<strong class="title">'+device['Name']+'</strong><br />';
if(device['Status']=='Off') html+='<span class="state">AFWEZIG</span>';
else html+='<span class="state">AANWEZIG</span>';
if((_SHOW_LASTUPDATE && (typeof(blocks[idx])=='undefined' || typeof(blocks[idx]['hide_lastupdate'])=='undefined' || blocks[idx]['hide_lastupdate']===false)) || (!_SHOW_LASTUPDATE && (typeof(blocks[idx])!=='undefined' && typeof(blocks[idx]['show_lastupdate'])!=='undefined' && blocks[idx]['show_lastupdate']==true)) ){
html+='<br /><span class="lastupdate">'+moment(device['LastUpdate']).format(_LASTUPDATE_FORMAT)+'</span>';
}
html+='</div>';
return html;
}
Re: Dashticz - Bug report
Posted: Thursday 11 May 2017 16:38
by wizjos
robgeerts wrote:This is kind of old way of showing news feeds.
Could you try defining it as:
Code: Select all
blocks['news_1'] = {}
blocks['news_1']['feed'] = 'https://cors-anywhere.herokuapp.com/http://www.nu.nl/rss/Algemeen';
And in the columns:
Oops! You're right! Thanks for pointing it out to me.
Wizjos
Re: Dashticz - Bug report
Posted: Thursday 11 May 2017 22:55
by gielie
robgeerts wrote:Try this:
Code: Select all
//Thuis
function getBlock_6(device,idx){
$('.block_'+idx);
var html='';
html+='<div class="col-xs-4 col-icon">';
if(device['Status']=='Off') html+='<img src="img/cust_away.png" class="off icon" />';
else html+='<img src="img/cust_home.png" class="on icon" />';
html+='</div>';
html+='<div class="col-xs-8 col-data">';
html+='<strong class="title">'+device['Name']+'</strong><br />';
if(device['Status']=='Off') html+='<span class="state">AFWEZIG</span>';
else html+='<span class="state">AANWEZIG</span>';
if((_SHOW_LASTUPDATE && (typeof(blocks[idx])=='undefined' || typeof(blocks[idx]['hide_lastupdate'])=='undefined' || blocks[idx]['hide_lastupdate']===false)) || (!_SHOW_LASTUPDATE && (typeof(blocks[idx])!=='undefined' && typeof(blocks[idx]['show_lastupdate'])!=='undefined' && blocks[idx]['show_lastupdate']==true)) ){
html+='<br /><span class="lastupdate">'+moment(device['LastUpdate']).format(_LASTUPDATE_FORMAT)+'</span>';
}
html+='</div>';
return html;
}
This almost worked, i changed the icon so now its working with a custom icon, Tnks.
Code: Select all
//Thuis
function getBlock_64(device,idx){
$('.block_'+idx);
var html='';
html+='<div class="col-xs-4 col-icon">';
if(device['Status']=='Off') html+=iconORimage(idx,'fa-toggle-off','','off icon');
else html+=iconORimage(idx,'fa-toggle-on','','on icon');
html+='</div>';
html+='<div class="col-xs-8 col-data">';
html+='<strong class="title">'+device['Name']+'</strong><br />';
if(device['Status']=='Off') html+='<span class="state">AFWEZIG</span>';
else html+='<span class="state">AANWEZIG</span>';
if((_SHOW_LASTUPDATE && (typeof(blocks[idx])=='undefined' || typeof(blocks[idx]['hide_lastupdate'])=='undefined' || blocks[idx]['hide_lastupdate']===false)) || (!_SHOW_LASTUPDATE && (typeof(blocks[idx])!=='undefined' && typeof(blocks[idx]['show_lastupdate'])!=='undefined' && blocks[idx]['show_lastupdate']==true)) ){
html+='<br /><span class="lastupdate">'+moment(device['LastUpdate']).format(_LASTUPDATE_FORMAT)+'</span>';
}
html+='</div>';
return html;
}
Re: Dashticz - Bug report
Posted: Friday 12 May 2017 14:03
by wizjos
Just noticed an error in the LUA moonscript (see:
https://www.domoticz.com/forum/viewtopi ... 49#p130249)
It turned out that when the picturenumer is only one digit (and thus there needs to be a '0' added in front of the string representaton of the picturenumer) there were a few errors in the script resulting in a 'broken' picture.
Corrected.
Replace the part of the script that starts with '--calculate moonphase picture'
to 'if debug then print('Picture number: '..n..' '..'Picture name: '..picture) end'
with this:
Code: Select all
-- calculate moonphase picture
if percentIlluminated == '0' then
n='50'
else
if waardecheck==false then
picnumber=math.floor(math.abs(percentIlluminated-100)/2)
else
picnumber=math.floor(50+(percentIlluminated/2))
if picnumber == 100 then
picnumber=99
end
end
n=tostring(picnumber)
if string.len(n)==1 then
n='0'..n
end
end
picture='moon.'..n..'.png'
if debug then print('Picture number: '..n..' '..'Picture name: '..picture) end
also see link above...
Wizjos
Re: Dashticz - Bug report
Posted: Saturday 13 May 2017 10:44
by jake
The block for electricity usage (in Watts) shows 0 Watt when my solar panels are generating more power than I consume at that point. In Domoticz it shows as a negative number (which means: feed into the grid), but Dashticz shows just '0'.
Re: Dashticz - Bug report
Posted: Saturday 13 May 2017 22:08
by robgeerts
could you post the output of the device in domoticz so I can test with it?
Re: RE: Re: Dashticz - Bug report
Posted: Sunday 14 May 2017 0:42
by jake
robgeerts wrote:could you post the output of the device in domoticz so I can test with it?
The device only reports graphically (P1 smart meter electricity = std. Domoticz device for smart meter). The JSON command can be found here in the Wiki:
http://www.domoticz.com/wiki/Domoticz_A ... mart_meter
/json.htm?type=command¶m=udevice&idx=IDX&nvalue=0&svalue=USAGE1;USAGE2;RETURN1;RETURN2;CONS;PROD
I assume that the calculation should be CONS - PROD to generate a negative number when production is higher than consumption. At that point consumption will be 0 and Production (PROD) will be the remaining power that is fed into the grid
Re: Dashticz - Bug report
Posted: Sunday 14 May 2017 9:32
by mvveelen
I'm using 2 images I made myself for the Velux windows. One opened and one closed. But whatever I try, I'm not getting the closed image when the windows are closed but I do get the opened image when the windows are opened. And vice versa. See attached images. Is this a bug ?
Using:
Code: Select all
blocks[3533] = {}
blocks[3533]['title'] = 'Badkamerraam';
blocks[3533]['image'] = 'window_open.png';
or
Code: Select all
blocks[3533] = {}
blocks[3533]['title'] = 'Badkamerraam';
blocks[3533]['image'] = 'window_closed.png';
- Schermafbeelding 2017-05-14 om 09.38.26.png (85.9 KiB) Viewed 4209 times
Re: Dashticz - Bug report
Posted: Sunday 14 May 2017 9:51
by EdwinK
Aren't you just saying that Dashticz should only use the image you declare in the block?
I believe, but I'm not a coder, that it should be more something like this, in CUSTOM.js
Code: Select all
function getBlock_124(device,idx){ //change 124 to the idx of your device!
$('.block_'+idx).attr('onclick','switchDevice(this)');
var html='';
html+='<div class="col-xs-4 col-icon">';
if(device['Status']=='Off') html+=iconORimage(idx,'fa-toggle-off','','off icon');
else html+=iconORimage(idx,'fa-toggle-on','','on icon');
html+='</div>';
html+='<div class="col-xs-8 col-data">';
html+='<strong class="title">'+device['Name']+'</strong><br />';
if(device['Status']=='Off') html+='<span class="state"><<YOUR CLOSED TXT</span>';
else html+='<span class="state">YOUR OPEN TXT</span>';
if(_SHOW_LASTUPDATE) html+='<br /><span class="lastupdate">'+moment(device['LastUpdate']).format(_LASTUPDATE_FORMAT)+'</span>';
html+='</div>';
return html;
}
and then change the device_IDX to that of your device? O, and of course you need to change the image to that of yours.
Re: Dashticz - Bug report
Posted: Sunday 14 May 2017 12:26
by mvveelen
Not really sure how this works. I entered the right IDX and also the name of the image like this:
Code: Select all
function getBlock_3534(device,idx){ //change 124 to the idx of your device!
$('.block_'+idx).attr('onclick','switchDevice(this)');
var html='';
html+='<div class="col-xs-4 col-icon">';
if(device['Status']=='Off') html+=iconORimage(idx,'window_open','','off icon');
else html+=iconORimage(idx,'window_open.png','','on icon');
html+='</div>';
html+='<div class="col-xs-8 col-data">';
html+='<strong class="title">'+device['Name']+'</strong><br />';
if(device['Status']=='Off') html+='<span class="state"><<YOUR CLOSED TXT</span>';
else html+='<span class="state">OPEN</span>';
if(_SHOW_LASTUPDATE) html+='<br /><span class="lastupdate">'+moment(device['LastUpdate']).format(_LASTUPDATE_FORMAT)+'</span>';
html+='</div>';
return html;
}
But nothing shows up. The images are in the img folder. As you can see, I tried WITH .png and without the .png extension. Which one should it be? Both don't show me the images.
Re: Dashticz - Bug report
Posted: Sunday 14 May 2017 13:04
by HansieNL
mvveelen wrote:Not really sure how this works. I entered the right IDX and also the name of the image like this:
- Spoiler: show
Code: Select all
function getBlock_3534(device,idx){ //change 124 to the idx of your device!
$('.block_'+idx).attr('onclick','switchDevice(this)');
var html='';
html+='<div class="col-xs-4 col-icon">';
if(device['Status']=='Off') html+=iconORimage(idx,'window_open','','off icon');
else html+=iconORimage(idx,'window_open.png','','on icon');
html+='</div>';
html+='<div class="col-xs-8 col-data">';
html+='<strong class="title">'+device['Name']+'</strong><br />';
if(device['Status']=='Off') html+='<span class="state"><<YOUR CLOSED TXT</span>';
else html+='<span class="state">OPEN</span>';
if(_SHOW_LASTUPDATE) html+='<br /><span class="lastupdate">'+moment(device['LastUpdate']).format(_LASTUPDATE_FORMAT)+'</span>';
html+='</div>';
return html;
}
But nothing shows up. The images are in the img folder. As you can see, I tried WITH .png and without the .png extension. Which one should it be? Both don't show me the images.
Can you try to change
iconORimage(idx,'window_open','','off icon') to
'<img src="img/cust_home.png" class="on icon" />'
Re: Dashticz - Bug report
Posted: Sunday 14 May 2017 20:15
by mvveelen
Then the 'door'-images are back. I don't know if this is a bug....
Re: Dashticz - Bug report
Posted: Sunday 14 May 2017 20:24
by robgeerts
Use this:
Code: Select all
function getBlock_3534(device,idx){ //change 124 to the idx of your device!
$('.block_'+idx).attr('onclick','switchDevice(this)');
var html='';
html+='<div class="col-xs-4 col-icon">';
if(device['Status']=='Off') html+=iconORimage(idx,'','window_closed.png','off icon');
else html+=iconORimage(idx,'','window_open.png','on icon');
html+='</div>';
html+='<div class="col-xs-8 col-data">';
html+='<strong class="title">'+device['Name']+'</strong><br />';
if(device['Status']=='Off') html+='<span class="state"><<YOUR CLOSED TXT</span>';
else html+='<span class="state">OPEN</span>';
if(_SHOW_LASTUPDATE) html+='<br /><span class="lastupdate">'+moment(device['LastUpdate']).format(_LASTUPDATE_FORMAT)+'</span>';
html+='</div>';
return html;
}
The function that gets called: iconORimage, is different then with your code
the second argument of that function is for an icon, the third for an image.
Re: Dashticz - Bug report
Posted: Sunday 14 May 2017 20:41
by mvveelen
Tried this code, but now the "open" window is shown, but when I close the window or open it, the status stays the same in the dashboard, but switches in Domoticz. Also, when I click on the block, it shows (very short) the text "UIT", while I only use "OPEN" and "DICHT".