Page 1 of 1
Reverse On/Off icon
Posted: Saturday 16 December 2023 20:21
by madpatrick
Hi,
Is it possible to reverse the status of On / Off?
If the swtich is off then the iconis faded, but i like to have the changed to highlighted for some switches
Re: Reverse On/Off icon
Posted: Saturday 16 December 2023 21:27
by waltervl
You could make an inverted custom icon for these switches.
https://www.domoticz.com/wiki/Custom_ic ... binterface.
Edit: Now I see it is for Dasticz so you probably can ignore my answer.
Re: Reverse On/Off icon
Posted: Sunday 17 December 2023 8:29
by Lokonli
madpatrick wrote: Saturday 16 December 2023 20:21
Hi,
Is it possible to reverse the status of On / Off?
If the swtich is off then the iconis faded, but i like to have the changed to highlighted for some switches
You can do that via styling in custom.css.
If you have defined your block via:
Then add the following to custom.css:
Code: Select all
[data-id="1324"] .off.icon {
opacity: 1 !important;
}
[data-id="1324"] .on.icon {
opacity: 0.2 !important;
}
or, use the addClass block parameter, and define relevant css classes in custom.js
Re: Reverse On/Off icon
Posted: Sunday 17 December 2023 8:52
by habahabahaba
Yes, its possible if the device supports icon change.
You have to do the icons by yourself and add them via web interface - Setup -> More options -> Custom Icons.
https://domoticz.com/wiki/Custom_icons_for_webinterface - wki
https://drive.google.com/drive/folders/ ... KXRcuCsJWQ - icons pack
Re: Reverse On/Off icon
Posted: Sunday 17 December 2023 9:26
by madpatrick
Lokonli wrote: Sunday 17 December 2023 8:29
madpatrick wrote: Saturday 16 December 2023 20:21
Hi,
Is it possible to reverse the status of On / Off?
If the swtich is off then the iconis faded, but i like to have the changed to highlighted for some switches
You can do that via styling in custom.css.
If you have defined your block via:
Then add the following to custom.css:
Code: Select all
[data-id="1324"] .off.icon {
opacity: 1 !important;
}
[data-id="1324"] .on.icon {
opacity: 0.2 !important;
}
or, use the addClass block parameter, and define relevant css classes in custom.js
Thanks
This is working fine with an icon.
How cani do it for an img ?
I can change the size for the imange, but on/off is not working
Code: Select all
.block_673 img {max-width: 60px !important;}
.block_673 .off.img {opacity: 1 !important;}
Re: Reverse On/Off icon
Posted: Sunday 17 December 2023 21:03
by Lokonli
For images (images you use on the position of an icon) you can also just use:
Code: Select all
.block_673 .off.icon {
opacity: 1 !important
}
Alternative, use addClass, like below:
In your block definition in CONFIG.js, for each block with inverted state styling:
Code: Select all
blocks[673] = {
addClass: 'invertedstatestyle'
}
And in custom.css, only once:
Code: Select all
.invertedstatestyle .on.icon {
opacity: 0.4 !important
}
.invertedstatestyle .off.icon {
opacity: 1 !important
}
Re: Reverse On/Off icon
Posted: Sunday 17 December 2023 21:28
by madpatrick
Lokonli wrote: Sunday 17 December 2023 21:03
For images (images you use on the position of an icon) you can also just use:
Code: Select all
.block_673 .off.icon {
opacity: 1 !important
}
Alternative, use addClass, like below:
In your block definition in CONFIG.js, for each block with inverted state styling:
Code: Select all
blocks[673] = {
addClass: 'invertedstatestyle'
}
[/quote]
This is working.
Not sure why it didn't work earlier
Thanks for the support !
Re: Reverse On/Off icon
Posted: Sunday 17 December 2023 21:29
by madpatrick
madpatrick wrote: Sunday 17 December 2023 21:28
Lokonli wrote: Sunday 17 December 2023 21:03
For images (images you use on the position of an icon) you can also just use:
Code: Select all
.block_673 .off.icon {
opacity: 1 !important
}
This is working.
Not sure why it didn't work earlier
Thanks for the support !