Page 1 of 1

updated my dashticz

Posted: Monday 27 April 2020 15:48
by pvklink
Hi, i updated my dashticz to the latest version, and i get a error
cannot read property value of undefined.
The kw usage of my 2103_1 is displayed when i delete the below function.
When i activate the function i get an error as described...

Code: Select all

function getStatus_2103_1(idx,value,device)
{
if (parseFloat(device.value) >2) 
	{
		blocks['2103_1']['title'] = 'Wasmachine Aan';
		blocks['2103_1']['icon'] = 'fas fa-thermometer-full';
	} 
	
else	{
		blocks['2103_1']['title'] = 'Wasmachine Uit';
		blocks['2103_1']['icon'] = 'fas fa-thermometer-half';
	} 
}

Re: updated my dashticz

Posted: Monday 27 April 2020 16:53
by HansieNL
pvklink wrote: Monday 27 April 2020 15:48 Hi, i updated my dashticz to the latest version, and i get a error
cannot read property value of undefined.
The kw usage of my 2103_1 is displayed when i delete the below function.
When i activate the function i get an error as described...
Spoiler: show

Code: Select all

function getStatus_2103_1(idx,value,device)
{
if (parseFloat(device.value) >2) 
	{
		blocks['2103_1']['title'] = 'Wasmachine Aan';
		blocks['2103_1']['icon'] = 'fas fa-thermometer-full';
	} 
	
else	{
		blocks['2103_1']['title'] = 'Wasmachine Uit';
		blocks['2103_1']['icon'] = 'fas fa-thermometer-half';
	} 
}
Upgrade instructions of version 3.4.1 contains: Breaking change: getBlock, getStatus and getChange interface in custom.js
The examples in Functionality via custom.js https://dashticz.readthedocs.io/en/beta ... -idx-block have been updated.

Re: updated my dashticz

Posted: Monday 27 April 2020 18:57
by pvklink
Hi @HansieNL, thanks!

I think it is working again!
For those who can use it, this is my code to check if my washingamchine is working!

Code: Select all

function getStatus_2103_1(block) 
	{
	var usage = block.device.value;
	if (parseFloat(usage) > 2) 
		{
		block.icon = 'fas fa-thermometer-full'
		block.title = 'Wasmachine Aan'
		} 
	else 
		{
	         block.icon = 'fas fa-thermometer-half'
         	block.title = 'Wasmachine Uit'
     		}
	 }