Reverse On/Off icon
Moderators: leecollings, htilburgs, robgeerts
- madpatrick
- Posts: 667
- Joined: Monday 26 December 2016 12:17
- Target OS: Linux
- Domoticz version: 2025.1
- Location: Netherlands
- Contact:
Reverse On/Off icon
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
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
-= HP server GEN11 =- OZW -=- Toon2 (rooted) -=- Domoticz v2025.1 -=- Dashticz v3.14b on Tab8" =-
- waltervl
- Posts: 5853
- Joined: Monday 28 January 2019 18:48
- Target OS: Linux
- Domoticz version: 2024.7
- Location: NL
- Contact:
Re: Reverse On/Off icon
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.
Edit: Now I see it is for Dasticz so you probably can ignore my answer.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
-
- Posts: 2290
- Joined: Monday 29 August 2016 22:40
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Reverse On/Off icon
You can do that via styling in custom.css.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
If you have defined your block via:
Code: Select all
blocks[1324] = {
...
}
Code: Select all
[data-id="1324"] .off.icon {
opacity: 1 !important;
}
[data-id="1324"] .on.icon {
opacity: 0.2 !important;
}
- habahabahaba
- Posts: 233
- Joined: Saturday 18 March 2023 14:44
- Target OS: Windows
- Domoticz version: 2024.4
- Contact:
Re: Reverse On/Off icon
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
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
- madpatrick
- Posts: 667
- Joined: Monday 26 December 2016 12:17
- Target OS: Linux
- Domoticz version: 2025.1
- Location: Netherlands
- Contact:
Re: Reverse On/Off icon
ThanksLokonli wrote: ↑Sunday 17 December 2023 8:29You can do that via styling in custom.css.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
If you have defined your block via:Then add the following to custom.css:Code: Select all
blocks[1324] = { ... }
or, use the addClass block parameter, and define relevant css classes in custom.jsCode: Select all
[data-id="1324"] .off.icon { opacity: 1 !important; } [data-id="1324"] .on.icon { opacity: 0.2 !important; }
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;}
-= HP server GEN11 =- OZW -=- Toon2 (rooted) -=- Domoticz v2025.1 -=- Dashticz v3.14b on Tab8" =-
-
- Posts: 2290
- Joined: Monday 29 August 2016 22:40
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Reverse On/Off icon
For images (images you use on the position of an icon) you can also just use:
Alternative, use addClass, like below:
In your block definition in CONFIG.js, for each block with inverted state styling:
And in custom.css, only once:
Code: Select all
.block_673 .off.icon {
opacity: 1 !important
}
In your block definition in CONFIG.js, for each block with inverted state styling:
Code: Select all
blocks[673] = {
addClass: 'invertedstatestyle'
}
Code: Select all
.invertedstatestyle .on.icon {
opacity: 0.4 !important
}
.invertedstatestyle .off.icon {
opacity: 1 !important
}
- madpatrick
- Posts: 667
- Joined: Monday 26 December 2016 12:17
- Target OS: Linux
- Domoticz version: 2025.1
- Location: Netherlands
- Contact:
Re: Reverse On/Off icon
Lokonli wrote: ↑Sunday 17 December 2023 21:03 For images (images you use on the position of an icon) you can also just use:Alternative, use addClass, like below:Code: Select all
.block_673 .off.icon { opacity: 1 !important }
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 !
-= HP server GEN11 =- OZW -=- Toon2 (rooted) -=- Domoticz v2025.1 -=- Dashticz v3.14b on Tab8" =-
- madpatrick
- Posts: 667
- Joined: Monday 26 December 2016 12:17
- Target OS: Linux
- Domoticz version: 2025.1
- Location: Netherlands
- Contact:
Re: Reverse On/Off icon
This is working.madpatrick wrote: ↑Sunday 17 December 2023 21:28Lokonli 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 }
Not sure why it didn't work earlier
Thanks for the support !
-= HP server GEN11 =- OZW -=- Toon2 (rooted) -=- Domoticz v2025.1 -=- Dashticz v3.14b on Tab8" =-
Who is online
Users browsing this forum: No registered users and 1 guest