Hi
I want a screen. Place columns and blocks on the screen. I want to specify the blocks to be. However, I only want them to appear under certain conditions. For example, I list all the lights in the house. But only those that are turned on would appear. If I click on 1, it will turn off and disappear from the list. I want it to disappear completely, the other burning lights to roll into its empty space.
Is this possible somehow?
Thanks
show blocks by parameter
Moderators: leecollings, htilburgs, robgeerts
-
- Posts: 31
- Joined: Friday 13 October 2017 19:56
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: show blocks by parameter
Can anyone help with the above?
-
- Posts: 2290
- Joined: Monday 29 August 2016 22:40
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: show blocks by parameter
You have to add some code to custom.js. Below an example for two switches.kispalsz wrote: ↑Thursday 16 June 2022 19:37 Hi
I want a screen. Place columns and blocks on the screen. I want to specify the blocks to be. However, I only want them to appear under certain conditions. For example, I list all the lights in the house. But only those that are turned on would appear. If I click on 1, it will turn off and disappear from the list. I want it to disappear completely, the other burning lights to roll into its empty space.
Is this possible somehow?
Thanks
Example of CONFIG.js:
Code: Select all
var blocks = {}
blocks['light1'] = {
idx: 79,
}
blocks['light2'] = {
idx: 80,
}
var columns = {}
columns[1] = {
blocks: ['light1','light2'],
width: 6
}
var screens = {}
screens[1] = {
columns: [1]
}
Code: Select all
function hideBlockWhenOff(block) {
if(block.device.Status!=="On") {
block.addClass="hidden";
}
else block.addClass="";
}
function getStatus_light1(block) {
hideBlockWhenOff(block);
}
function getStatus_light2(block) {
hideBlockWhenOff(block);
}
Who is online
Users browsing this forum: No registered users and 1 guest