change block/device title when value changes Topic is solved

Dashticz, alternative dashboard based on HTML, CSS, jQuery

Moderators: leecollings, htilburgs, robgeerts

Post Reply
pvklink
Posts: 822
Joined: Wednesday 12 November 2014 15:01
Target OS: Raspberry Pi / ODroid
Domoticz version: latest b
Contact:

change block/device title when value changes

Post by pvklink »

Hi

I made a script that changes the block title when the state of the device changes
Problem is that the title does not change.
When the switch 1474 is On the title must be test1 and test2 when off...

function getChange_1474(idx,value,device){
if(parseFloat(device['state'])='On'){
blocks['1474']['title'] = 'test1';
}

else {
blocks['1474']['title'] = 'test2';
}
}
Raspberry (raspbian on rpi 3) , Domoticz Beta, dzVents , RFXtrx433e, P1, Hue, Yeelight, Zwave+, X10, ESP(easy), MQTT,Weather Underground, System Alive Checker, Domoticz Remote Server to RPI with Google Assistant,
Jablotron connection, Ikea
User avatar
HansieNL
Posts: 969
Joined: Monday 28 September 2015 15:13
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: change block/device title when value changes

Post by HansieNL »

Can you try:

Code: Select all

function getStatus_1474(idx,value,device){
	if (device.Data == "On") {
			blocks[1474]['title'] = "test1"
	 }
	 else {
		blocks[1474]['title'] = "test2"
	 }
 }
Blah blah blah
pvklink
Posts: 822
Joined: Wednesday 12 November 2014 15:01
Target OS: Raspberry Pi / ODroid
Domoticz version: latest b
Contact:

Re: change block/device title when value changes

Post by pvklink »

thanks!
will try that!
Raspberry (raspbian on rpi 3) , Domoticz Beta, dzVents , RFXtrx433e, P1, Hue, Yeelight, Zwave+, X10, ESP(easy), MQTT,Weather Underground, System Alive Checker, Domoticz Remote Server to RPI with Google Assistant,
Jablotron connection, Ikea
pvklink
Posts: 822
Joined: Wednesday 12 November 2014 15:01
Target OS: Raspberry Pi / ODroid
Domoticz version: latest b
Contact:

Re: change block/device title when value changes

Post by pvklink »

yes works!

thanks Hansie
Raspberry (raspbian on rpi 3) , Domoticz Beta, dzVents , RFXtrx433e, P1, Hue, Yeelight, Zwave+, X10, ESP(easy), MQTT,Weather Underground, System Alive Checker, Domoticz Remote Server to RPI with Google Assistant,
Jablotron connection, Ikea
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest