Dashticz - v3.4.9 beta

Dashticz, alternative dashboard based on HTML, CSS, jQuery

Moderators: leecollings, htilburgs, robgeerts

User avatar
madpatrick
Posts: 637
Joined: Monday 26 December 2016 12:17
Target OS: Linux
Domoticz version: 2024.7
Location: Netherlands
Contact:

Re: Dashticz - v3.4.9 beta

Post by madpatrick »

Lokonli wrote: Thursday 28 May 2020 23:26
Something like:

Code: Select all

function getStatus_145(block){
var idx = block.idx;
var device = block.device;
   if(parseFloat(device['Data'])>23){
      block.addClass='warning';
   }
   else {
      block.addClass='';
   }
}
To set the color in the icon part:

Code: Select all

.warning .col-icon {
   color: red !important
}
Hi,

Is it possible to get data from 1 block, but change the colour of another block.
What i like to have is a message or color change of a block on the standby screen when a value reached a high value.
Since the standby screen is almost always on you will not see the alarms. Espacially when they are on page 2 or 3
-= HP server GEN8 Xeon(R) E3-1220L_V2 -=- OZW -=- Toon2 (rooted) -=- Domoticz v2024.7 -=- Dashticz v3.12b on Tab8" =-
Vomera
Posts: 184
Joined: Wednesday 06 September 2017 9:11
Target OS: Linux
Domoticz version:
Contact:

Re: Dashticz - v3.4.9 beta

Post by Vomera »

madpatrick wrote: Sunday 11 October 2020 11:52
Lokonli wrote: Thursday 28 May 2020 23:26
Something like:

Code: Select all

function getStatus_145(block){
var idx = block.idx;
var device = block.device;
   if(parseFloat(device['Data'])>23){
      block.addClass='warning';
   }
   else {
      block.addClass='';
   }
}
To set the color in the icon part:

Code: Select all

.warning .col-icon {
   color: red !important
}
Hi,

Is it possible to get data from 1 block, but change the colour of another block.
What i like to have is a message or color change of a block on the standby screen when a value reached a high value.
Since the standby screen is almost always on you will not see the alarms. Espacially when they are on page 2 or 3
Here is an example i use.

Code: Select all

// geeft regenmelding een kleur op basis van aantal mm per uur
	function getStatus_9450(block){
	var Data = block.device.Data;
	var idx = block.idx;
    var device = block.device;
	
   if(parseFloat(Data) > 100){	
     Dashticz.setBlock('3962', {addClass: 'bovendehonderd'});  
      
   }
   else if(parseFloat(Data) >10){
     Dashticz.setBlock('3962', {addClass: 'tientothonderd'});
   }   
   else if(parseFloat(Data) >5){
      Dashticz.setBlock('3962', {addClass: 'vijftottien'});    
   }     
   else if(parseFloat(Data) >2){
        Dashticz.setBlock('3962', {addClass: 'tweetotvijf'});   
   }
   
   else if(parseFloat(Data) >0){
      Dashticz.setBlock('3962', {addClass: 'nultottwee'});   
   }
    
   else {
     Dashticz.setBlock('3962', {addClass: 'none'}); 
   }
}
User avatar
madpatrick
Posts: 637
Joined: Monday 26 December 2016 12:17
Target OS: Linux
Domoticz version: 2024.7
Location: Netherlands
Contact:

Re: Dashticz - v3.4.9 beta

Post by madpatrick »

Vomera wrote: Monday 12 October 2020 11:17
Here is an example i use.

Thanks. This is working.

I'm trying to make 2 sensors change, but only 1 is changing.
This is what i've tried

Code: Select all

// geeft alarm melding van andere sensor
	function getStatus_262(block){
	var Data = block.device.Data;
	var idx = block.idx;
    	var device = block.device;
	
   else if(parseFloat(Data) <1.5){
     Dashticz.setBlock('regen', {addClass: 'warning'});
     Dashticz.setBlock('262', {addClass: 'warning'});  
   }   
    
   else {
     Dashticz.setBlock('regen', {addClass: 'none'}); 
   }
}
-= HP server GEN8 Xeon(R) E3-1220L_V2 -=- OZW -=- Toon2 (rooted) -=- Domoticz v2024.7 -=- Dashticz v3.12b on Tab8" =-
Vomera
Posts: 184
Joined: Wednesday 06 September 2017 9:11
Target OS: Linux
Domoticz version:
Contact:

Re: Dashticz - v3.4.9 beta

Post by Vomera »

madpatrick wrote: Monday 12 October 2020 19:08
Vomera wrote: Monday 12 October 2020 11:17
Here is an example i use.

Thanks. This is working.

I'm trying to make 2 sensors change, but only 1 is changing.
This is what i've tried

Code: Select all

// geeft alarm melding van andere sensor
	function getStatus_262(block){
	var Data = block.device.Data;
	var idx = block.idx;
    	var device = block.device;
	
   else if(parseFloat(Data) <1.5){
     Dashticz.setBlock('regen', {addClass: 'warning'});
     Dashticz.setBlock('262', {addClass: 'warning'});  
   }   
    
   else {
     Dashticz.setBlock('regen', {addClass: 'none'}); 
   }
}
And you are sure "regen" and "262" are valid blocks ? maybe you can insert some script from your config.js
Lokonli
Posts: 2262
Joined: Monday 29 August 2016 22:40
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Dashticz - v3.4.9 beta

Post by Lokonli »

madpatrick wrote: Monday 12 October 2020 19:08
Vomera wrote: Monday 12 October 2020 11:17
Here is an example i use.

Thanks. This is working.

I'm trying to make 2 sensors change, but only 1 is changing.
This is what i've tried

Code: Select all

// geeft alarm melding van andere sensor
	function getStatus_262(block){
	var Data = block.device.Data;
	var idx = block.idx;
    	var device = block.device;
	
   else if(parseFloat(Data) <1.5){
     Dashticz.setBlock('regen', {addClass: 'warning'});
     Dashticz.setBlock('262', {addClass: 'warning'});  
   }   
    
   else {
     Dashticz.setBlock('regen', {addClass: 'none'}); 
   }
}
Your function is not complete. You start with an 'else' statement, but you should start with an 'if' statement.

Further, the getStatus_262 is called when device 262 changes. You can modify this block directly with:

Code: Select all

   block.addClass = 'warning'
 
(no need to use the setBlock function)

So, I think you are trying to achieve the following:

Code: Select all

// geeft alarm melding van andere sensor
function getStatus_262(block) {
	var Data = block.device.Data;
	var idx = block.idx;
    	var device = block.device;
	
	if(parseFloat(Data) <1.5){
     		Dashticz.setBlock('regen', {addClass: 'warning'});
     		block.addClass = 'warning';		// set the addClass parameter for block 262
   	}   
   	else {
     		Dashticz.setBlock('regen', {addClass: 'none'}); 
     		block.addClass = ''; // reset the addClass parameter for block 262
   	}
}
User avatar
madpatrick
Posts: 637
Joined: Monday 26 December 2016 12:17
Target OS: Linux
Domoticz version: 2024.7
Location: Netherlands
Contact:

Re: Dashticz - v3.4.9 beta

Post by madpatrick »

Thanks guys.
This works !

The else if function was because i deleted some line to make the post smaller
-= HP server GEN8 Xeon(R) E3-1220L_V2 -=- OZW -=- Toon2 (rooted) -=- Domoticz v2024.7 -=- Dashticz v3.12b on Tab8" =-
User avatar
madpatrick
Posts: 637
Joined: Monday 26 December 2016 12:17
Target OS: Linux
Domoticz version: 2024.7
Location: Netherlands
Contact:

Re: Dashticz - v3.4.9 beta

Post by madpatrick »

Guys,

Need you support again.
When i want to use more sensors in the script, theupdate of block "regen" doesn't work any more.
Only the applicable sensors gets a warning.

Code: Select all

/ geeft alarm melding sensor
function getStatus_262(block) {
	var Data = block.device.Data;
	var idx = block.idx;
    	var device = block.device;
	
	if(parseFloat(Data) <1.5){
     		Dashticz.setBlock('regen', {addClass: 'warning'});
     		block.addClass = 'warning';		// set the addClass parameter for block 262
   	}   
   	else {
     		Dashticz.setBlock('regen', {addClass: 'none'}); 
     		block.addClass = ''; // reset the addClass parameter for block 262
   	}
}

// geeft alarm melding sensor
function getStatus_25(block) {
	var Data = block.device.Data;
	var idx = block.idx;
    	var device = block.device;
	
	if(parseFloat(Data) >80){
     		Dashticz.setBlock('regen', {addClass: 'warning'});
     		block.addClass = 'warning';		// set the addClass parameter for block
   	}   
   	else {
     		Dashticz.setBlock('regen', {addClass: 'none'}); 
     		block.addClass = ''; // reset the addClass parameter for block
   	}
}
The trick is that i want to set this up for a the sensors and when the alarm of one of the is triggered i see this also on the main screen (block "regen")
-= HP server GEN8 Xeon(R) E3-1220L_V2 -=- OZW -=- Toon2 (rooted) -=- Domoticz v2024.7 -=- Dashticz v3.12b on Tab8" =-
Lokonli
Posts: 2262
Joined: Monday 29 August 2016 22:40
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Dashticz - v3.4.9 beta

Post by Lokonli »

madpatrick wrote: Tuesday 13 October 2020 16:48 Guys,

Need you support again.
When i want to use more sensors in the script, theupdate of block "regen" doesn't work any more.
Only the applicable sensors gets a warning.

Code: Select all

/ geeft alarm melding sensor
function getStatus_262(block) {
	var Data = block.device.Data;
	var idx = block.idx;
    	var device = block.device;
	
	if(parseFloat(Data) <1.5){
     		Dashticz.setBlock('regen', {addClass: 'warning'});
     		block.addClass = 'warning';		// set the addClass parameter for block 262
   	}   
   	else {
     		Dashticz.setBlock('regen', {addClass: 'none'}); 
     		block.addClass = ''; // reset the addClass parameter for block 262
   	}
}

// geeft alarm melding sensor
function getStatus_25(block) {
	var Data = block.device.Data;
	var idx = block.idx;
    	var device = block.device;
	
	if(parseFloat(Data) >80){
     		Dashticz.setBlock('regen', {addClass: 'warning'});
     		block.addClass = 'warning';		// set the addClass parameter for block
   	}   
   	else {
     		Dashticz.setBlock('regen', {addClass: 'none'}); 
     		block.addClass = ''; // reset the addClass parameter for block
   	}
}
The trick is that i want to set this up for a the sensors and when the alarm of one of the is triggered i see this also on the main screen (block "regen")
I think I would approach it as follows:

Code: Select all

// geeft alarm melding sensor

var trigger_262 = false;
var trigger_25 = false;

function handleRegen() {
    if (trigger_262 || trigger_25)
        Dashticz.setBlock('regen', { addClass: 'warning' });
    else
        Dashticz.setBlock('regen', { addClass: '' });
}

function getStatus_262(block) {
    var Data = block.device.Data;
    var idx = block.idx;
    var device = block.device;

    if (parseFloat(Data) < 1.5) {
        trigger_262 = true;
        block.addClass = 'warning';		// set the addClass parameter for block 262
    }
    else {
        trigger_262 = false;
        block.addClass = ''; // reset the addClass parameter for block 262
    }
    handleRegen();
}

// geeft alarm melding sensor
function getStatus_25(block) {
    var Data = block.device.Data;
    var idx = block.idx;
    var device = block.device;

    if (parseFloat(Data) > 80) {
        trigger_25 = true;
        block.addClass = 'warning';		// set the addClass parameter for block
    }
    else {
        trigger_25 = false;
        block.addClass = ''; // reset the addClass parameter for block
    }
    handleRegen();
}
User avatar
madpatrick
Posts: 637
Joined: Monday 26 December 2016 12:17
Target OS: Linux
Domoticz version: 2024.7
Location: Netherlands
Contact:

Re: Dashticz - v3.4.9 beta

Post by madpatrick »

Lokonli wrote: Tuesday 13 October 2020 17:40
I think I would approach it as follows:
Many thanks Lokonli !!
Added 10 sensors with the script
-= HP server GEN8 Xeon(R) E3-1220L_V2 -=- OZW -=- Toon2 (rooted) -=- Domoticz v2024.7 -=- Dashticz v3.12b on Tab8" =-
User avatar
madpatrick
Posts: 637
Joined: Monday 26 December 2016 12:17
Target OS: Linux
Domoticz version: 2024.7
Location: Netherlands
Contact:

Re: Dashticz - v3.4.9 beta

Post by madpatrick »

Hi

Is it also possible to get a sound when the warning is triggered ?

The speech function is not working on my tablet (viewtopic.php?t=20426)
-= HP server GEN8 Xeon(R) E3-1220L_V2 -=- OZW -=- Toon2 (rooted) -=- Domoticz v2024.7 -=- Dashticz v3.12b on Tab8" =-
Lokonli
Posts: 2262
Joined: Monday 29 August 2016 22:40
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Dashticz - v3.4.9 beta

Post by Lokonli »

Do you have an Android tablet? Did you install Google speech synthesis engine, and set it as default?

You can use the playsound block parameters to play a sound.

See:
https://dashticz.readthedocs.io/en/mast ... parameters
User avatar
madpatrick
Posts: 637
Joined: Monday 26 December 2016 12:17
Target OS: Linux
Domoticz version: 2024.7
Location: Netherlands
Contact:

Re: Dashticz - v3.4.9 beta

Post by madpatrick »

Hi Lokonli,

Yes. It is an Android tablet.
I've found out that it is related to Fully Kiosk browser app.
When i'm using the chrome browser it is working
-= HP server GEN8 Xeon(R) E3-1220L_V2 -=- OZW -=- Toon2 (rooted) -=- Domoticz v2024.7 -=- Dashticz v3.12b on Tab8" =-
User avatar
madpatrick
Posts: 637
Joined: Monday 26 December 2016 12:17
Target OS: Linux
Domoticz version: 2024.7
Location: Netherlands
Contact:

Re: Dashticz - v3.4.9 beta

Post by madpatrick »

I know you play a sound when you click on a block, but is it possible when the warning gets trigger via custom.js

Code: Select all

function handleMessage() {
   if (trigger_182 && trigger_188)
        Dashticz.setBlock('emptyblock1', { addClass: 'message4' });
   else if (trigger_182)
        Dashticz.setBlock('emptyblock1', { addClass: 'message2' });
   else if (trigger_188)
        Dashticz.setBlock('emptyblock1', { addClass: 'message3' });
   else
        Dashticz.setBlock('emptyblock1', { addClass: '' });
}
-= HP server GEN8 Xeon(R) E3-1220L_V2 -=- OZW -=- Toon2 (rooted) -=- Domoticz v2024.7 -=- Dashticz v3.12b on Tab8" =-
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests