Dashticz - Bug report

Moderator: leecollings

User avatar
wizjos
Posts: 78
Joined: Monday 07 March 2016 19:35
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Dashticz - Bug report

Post 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
User avatar
wizjos
Posts: 78
Joined: Monday 07 March 2016 19:35
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Dashticz - Bug report

Post 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 :P

Regards,
Wizjos
robgeerts
Posts: 1273
Joined: Saturday 24 January 2015 22:12
Target OS: NAS (Synology & others)
Domoticz version: 3.7067
Location: NL
Contact:

Re: Dashticz - Bug report

Post by robgeerts »

I mean the piece of code in config.js where you define what rss-feed must be used..
User avatar
wizjos
Posts: 78
Joined: Monday 07 March 2016 19:35
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Dashticz - Bug report

Post 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
robgeerts
Posts: 1273
Joined: Saturday 24 January 2015 22:12
Target OS: NAS (Synology & others)
Domoticz version: 3.7067
Location: NL
Contact:

Re: Dashticz - Bug report

Post 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:

Code: Select all

columns[1]['blocks'] = ['news_1']
User avatar
gielie
Posts: 290
Joined: Tuesday 12 January 2016 11:40
Target OS: Raspberry Pi / ODroid
Domoticz version: latest β
Location: The Netherlands (Alkmaar)
Contact:

Re: Dashticz - Bug report

Post 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
Image

I would like to add
blocks [#]['show_lastupdate'] = true;
But this doesnt work.

When i remove the Thuis/afwezig code i get this.
Image
With the [show_lastupdate] working.

Id like to use both, is this a bug or a feature request?
- Aeon Labs USB Stick met Z-wave plus
- Aeotec MultiSensor 6
- FIBARO FGS223
- FIBARO FGWPE Wall Plug
- Neo CoolCam Power plug
- Popp Smoke Detector
- Toon
- Kodi Media Server
robgeerts
Posts: 1273
Joined: Saturday 24 January 2015 22:12
Target OS: NAS (Synology & others)
Domoticz version: 3.7067
Location: NL
Contact:

Re: Dashticz - Bug report

Post 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;
}
User avatar
wizjos
Posts: 78
Joined: Monday 07 March 2016 19:35
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Dashticz - Bug report

Post 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:

Code: Select all

columns[1]['blocks'] = ['news_1']
Oops! You're right! Thanks for pointing it out to me.

Wizjos
User avatar
gielie
Posts: 290
Joined: Tuesday 12 January 2016 11:40
Target OS: Raspberry Pi / ODroid
Domoticz version: latest β
Location: The Netherlands (Alkmaar)
Contact:

Re: Dashticz - Bug report

Post 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;
}
- Aeon Labs USB Stick met Z-wave plus
- Aeotec MultiSensor 6
- FIBARO FGS223
- FIBARO FGWPE Wall Plug
- Neo CoolCam Power plug
- Popp Smoke Detector
- Toon
- Kodi Media Server
User avatar
wizjos
Posts: 78
Joined: Monday 07 March 2016 19:35
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Dashticz - Bug report

Post 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
jake
Posts: 742
Joined: Saturday 30 May 2015 22:40
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Contact:

Re: Dashticz - Bug report

Post 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'.
robgeerts
Posts: 1273
Joined: Saturday 24 January 2015 22:12
Target OS: NAS (Synology & others)
Domoticz version: 3.7067
Location: NL
Contact:

Re: Dashticz - Bug report

Post by robgeerts »

could you post the output of the device in domoticz so I can test with it?
jake
Posts: 742
Joined: Saturday 30 May 2015 22:40
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Contact:

Re: RE: Re: Dashticz - Bug report

Post 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&param=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
User avatar
mvveelen
Posts: 678
Joined: Friday 31 October 2014 10:22
Target OS: NAS (Synology & others)
Domoticz version: Beta
Location: Hoorn, The Netherlands
Contact:

Re: Dashticz - Bug report

Post 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
Schermafbeelding 2017-05-14 om 09.38.26.png (85.9 KiB) Viewed 4201 times
Attachments
window_open.png
window_open.png (19.15 KiB) Viewed 4202 times
window_closed.png
window_closed.png (799 Bytes) Viewed 4202 times
RPi3b+/RFXCOM rfxtrx433E/Shelly/Xiaomi Gateway/Philips HUE Lights/Atag Zone One/2 SunnyBoy inverters/AirconWithMe/P1 smartmeter/Domoticz latest Beta
User avatar
EdwinK
Posts: 1820
Joined: Sunday 22 January 2017 21:46
Target OS: Raspberry Pi / ODroid
Domoticz version: BETA
Location: Rhoon
Contact:

Re: Dashticz - Bug report

Post 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.
Running latest BETA on a Pi-3 | Toon® Thermostat (rooted) | Hue | Tuya | IKEA tradfri | Dashticz V3 on Lenovo Huawei Tablet | Conbee
User avatar
mvveelen
Posts: 678
Joined: Friday 31 October 2014 10:22
Target OS: NAS (Synology & others)
Domoticz version: Beta
Location: Hoorn, The Netherlands
Contact:

Re: Dashticz - Bug report

Post 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.
RPi3b+/RFXCOM rfxtrx433E/Shelly/Xiaomi Gateway/Philips HUE Lights/Atag Zone One/2 SunnyBoy inverters/AirconWithMe/P1 smartmeter/Domoticz latest Beta
User avatar
HansieNL
Posts: 957
Joined: Monday 28 September 2015 15:13
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Dashticz - Bug report

Post 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" />'
Blah blah blah
User avatar
mvveelen
Posts: 678
Joined: Friday 31 October 2014 10:22
Target OS: NAS (Synology & others)
Domoticz version: Beta
Location: Hoorn, The Netherlands
Contact:

Re: Dashticz - Bug report

Post by mvveelen »

Then the 'door'-images are back. I don't know if this is a bug....
RPi3b+/RFXCOM rfxtrx433E/Shelly/Xiaomi Gateway/Philips HUE Lights/Atag Zone One/2 SunnyBoy inverters/AirconWithMe/P1 smartmeter/Domoticz latest Beta
robgeerts
Posts: 1273
Joined: Saturday 24 January 2015 22:12
Target OS: NAS (Synology & others)
Domoticz version: 3.7067
Location: NL
Contact:

Re: Dashticz - Bug report

Post 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.
User avatar
mvveelen
Posts: 678
Joined: Friday 31 October 2014 10:22
Target OS: NAS (Synology & others)
Domoticz version: Beta
Location: Hoorn, The Netherlands
Contact:

Re: Dashticz - Bug report

Post 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".
RPi3b+/RFXCOM rfxtrx433E/Shelly/Xiaomi Gateway/Philips HUE Lights/Atag Zone One/2 SunnyBoy inverters/AirconWithMe/P1 smartmeter/Domoticz latest Beta
Locked

Who is online

Users browsing this forum: No registered users and 0 guests