Page 1 of 1
unwanted devices in dashticz
Posted: Saturday 06 July 2019 16:00
by pvklink
Hi, i jyst added a zwave sensor to my dashticz that displays the wattage of my washing machine/ I measure this for testing if my machine is ready and then gives a message by let my google assistant speaks an turning a led lamp red.
i want to display this to check if my algoritmes are working.
But when i add this device (it is displaying) i get two more devices (kwh and onother one)..
How do i delete these from dashticz?
Re: unwanted devices in dashticz
Posted: Saturday 06 July 2019 18:27
by EdwinK
I think the device is giving 2 or more data-streams. So you have one with the kwh and another one. You can use the following (adapt the idx to your idx

)
Re: unwanted devices in dashticz
Posted: Saturday 06 July 2019 18:42
by pvklink
i tried 982-1 and 982_1 no switch at all
Re: unwanted devices in dashticz
Posted: Saturday 06 July 2019 18:45
by EdwinK
Try with '928_1' with the ' at the beginning and end
Re: unwanted devices in dashticz
Posted: Saturday 06 July 2019 19:00
by pvklink
yep works! thanks!
Re: unwanted devices in dashticz
Posted: Saturday 06 July 2019 23:24
by pvklink
1) Is there an other way to give the icons for devices with a datastream another color?
2) also hide_data does not work...
my trials:
blocks['982_1'] = {}
blocks['982_1']['title'] = 'Was machine';
blocks['982_1']['icon'] = 'fas fa-bolt';
blocks['982_1']['hide_data'] = true;
blocks['982_1']['width'] = 3;
and in css
.fa-bolt.on {color: red !important;}
.fa-bolt.off {color: green !important;}
last part does not work...
this also does not work
.block_982_1 .fa-bolt.on {color: red;}
.block_982_1 .fa-bolt.off {color: lightgrey;}
Re: unwanted devices in dashticz
Posted: Sunday 07 July 2019 3:37
by HansieNL
Can you try: .fas.fa-bolt.on {color: red !important;}
Re: unwanted devices in dashticz
Posted: Sunday 07 July 2019 10:24
by pvklink
thanks, but did not work...
/* .fa-bolt.on {color: red !important;} */
/* .fa-bolt.off {color: green !important;} */
.fas.fa-bolt.on {color: red !important;}
.fas.fa-bolt.on {color: green !important;}
Re: unwanted devices in dashticz
Posted: Sunday 07 July 2019 22:47
by HansieNL
@pvklink: Can you try: .block_982_1 .icon.on {color: red;}
Re: unwanted devices in dashticz
Posted: Monday 08 July 2019 16:07
by pvklink
noop, still does not work..
here is my config...
i did remove de /* ... */ to activate it...
these are all the trials...
the attached image is a little bit older then the config (no update date anymore , i added: last_update....
blocks['982_1'] = {}
blocks['982_1']['title'] = 'Was machine';
blocks['982_1']['icon'] = 'fas fa-bolt';
blocks['982_1']['hide_data'] = true;
blocks['982_1']['width'] = 3;
blocks['982_1']['switch'] = true;
blocks['982_1']['last_update'] = false;
blocks[1025] = {}
blocks[1025]['title'] = 'Zolder radiator';
blocks[1025]['hide_data'] = true;
blocks[1025]['switch'] =true;
blocks[1025]['width'] = 3;
blocks[1025]['last_update'] = false;
css
/* .block_982 .fa-bolt.on {color: red;} WERKT NIET */
/* .block_982 .fa-bolt.off {color: lightgrey;} WERKT NIET*/
/* .block_982_1 .icon.on {color: red !important;} WERKT NIET */
/* .block_982_1 .icon.off {color: red !important;} WERKT NIET */
/* .fa-bolt.on {color: red !important;} WERKT NIET*/
/* .fa-bolt.off {color: green !important;} WERKT NIET*/
/* .fas.fa-bolt.on {color: red !important;} WERKT NIET*/
/* .fas.fa-bolt.on {color: green !important;} WERKT NIET*/
Re: unwanted devices in dashticz
Posted: Thursday 18 July 2019 15:49
by Lokonli
pvklink wrote: Monday 08 July 2019 16:07
noop, still does not work..
here is my config...
i did remove de /* ... */ to activate it...
these are all the trials...
the attached image is a little bit older then the config (no update date anymore , i added: last_update....
blocks['982_1'] = {}
blocks['982_1']['title'] = 'Was machine';
blocks['982_1']['icon'] = 'fas fa-bolt';
blocks['982_1']['hide_data'] = true;
blocks['982_1']['width'] = 3;
blocks['982_1']['switch'] = true;
blocks['982_1']['last_update'] = false;
blocks[1025] = {}
blocks[1025]['title'] = 'Zolder radiator';
blocks[1025]['hide_data'] = true;
blocks[1025]['switch'] =true;
blocks[1025]['width'] = 3;
blocks[1025]['last_update'] = false;
css
/* .block_982 .fa-bolt.on {color: red;} WERKT NIET */
/* .block_982 .fa-bolt.off {color: lightgrey;} WERKT NIET*/
/* .block_982_1 .icon.on {color: red !important;} WERKT NIET */
/* .block_982_1 .icon.off {color: red !important;} WERKT NIET */
/* .fa-bolt.on {color: red !important;} WERKT NIET*/
/* .fa-bolt.off {color: green !important;} WERKT NIET*/
/* .fas.fa-bolt.on {color: red !important;} WERKT NIET*/
/* .fas.fa-bolt.on {color: green !important;} WERKT NIET*/
If you want to change the icon color for block 982_1 add the following to custom.css:
Code: Select all
.block_982_1 .col-icon {
color: red !important
}
If device 982 is a power measurement device then it doesn't have a state (like a switch), so it doesn't have the on/off class attached to it.
If you want to change the color depending on the data, then first add a class to the block via the afterGetDevices() function in custom.js:
Code: Select all
function afterGetDevices(){
var device = alldevices['982'];
console.log(device);
var usage = parseFloat(device['Usage']);
console.log(usage);
if( usage >20){
$('div.block_982_1').addClass('warning');
}
else {
$('div.block_982_1').removeClass('warning');
}
}
And to apply the right styling add the following to custom.css to change the color of the icon:
Code: Select all
.warning .col-icon {
color: blue !important
}
In the example above I assumed the measured data is reported via the 'Usage' parameter. You might have to change this to another parameter, depending on the specific device you have. The two console.log statements will show the device info In the developer window of Chrome (press F11). You can use this to find the right parameter name.
If it's working you can remove the two console.log statements.
Re: unwanted devices in dashticz
Posted: Thursday 18 July 2019 21:00
by pvklink
when i arrive on my holiday address..i am going to try it..thanks!