Value from user variable as block title (SOLVED)
Posted: Thursday 08 December 2022 15:29
Hi,
I cannot get this code to work, could anyone please help me?
I would like the value of an user variable v3 (value is 'Jan' as String) as the title of a block 161, which is a virtual switch
(code based on solution in viewtopic.php?t=34903)
v3 and block 161 are defined in CONFIG.js
custom.js:
What am I missing?
I cannot get this code to work, could anyone please help me?
I would like the value of an user variable v3 (value is 'Jan' as String) as the title of a block 161, which is a virtual switch
(code based on solution in viewtopic.php?t=34903)
v3 and block 161 are defined in CONFIG.js
custom.js:
Code: Select all
function getStatus_v3(block) { //guest1
var idx = block.idx;
var device = block.device;
if (parseString(device['Value']) != '') {
Dashticz.setBlock(161, {
title: 'test', //guest1
icon: 'fas fa-walking'
});
} // end if
} // end function