Use of variables

Moderators: leecollings, htilburgs, robgeerts

Post Reply
Ewaldharmsen
Posts: 130
Joined: Tuesday 07 February 2017 15:00
Target OS: Linux
Domoticz version:
Contact:

Use of variables

Post by Ewaldharmsen »

Maybe I missed it, but what I find quite usefull is the use of variables in my config:

Code: Select all

//IDX List
Weerstation 		= 5;
Screen			= 8;
Slaapkamer	 	= 32;
Rain				= 34;

//Definition of blocks
blocks = {}
blocks[Weerstation] = {
  width: 6
}

blocks['temperature'] = {
	title: 'Temperature',
	devices: [Slaapkamer,Weerstation],
	graphTypes : ['te'],
	spanGaps: false,
	maxTicksLimit: 10,
	legend: {
        	['te_'+Weerstation]: 'Outside',
		['te_'+Slaapkamer]: 'Inside'
        },
	customHeader: {
		[Weerstation]: 'data.split(",").slice(0,1)',                      
		[Slaapkamer]: 'data.split(",").slice(0,1)',               
		x:  '(data.'+Weerstation+'-data.'+Slaapkamer+').toFixed(2) + " °C"',
	},
	height : '300px'
}

//Definition of columns
columns = {}
columns[1] = {
	width: 4,
	blocks : [Screen,Rain,'temperature'],
}

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests