Dashticz change temperature text color

Topics (not sure which fora)
when not sure where to post, post here and mods will move it to right forum.

Moderators: leecollings, remb0

Post Reply
cornesch
Posts: 19
Joined: Sunday 10 November 2019 19:10
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Contact:

Dashticz change temperature text color

Post by cornesch »

Hello,


Is it possible to change the text color of a temperature block when another block changes status in Dashticz?

I display the temperature of the living room in white, when the boiler starts heating I want the text color to change from white to red.

I have already tried a few things in the custom.js file, but I am not getting a good result.


I hope someone can help me with this,

Corné
>>Raspberry Pi 4<<>>Raspberry Pi 3 + 7-inch Touchscreen<<>>Ikea Tradfri<<>>Nefit Easy<<>>ESP-Easy<<>>Netatmo<<>>Sonos<<
User avatar
HansieNL
Posts: 957
Joined: Monday 28 September 2015 15:13
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Dashticz change temperature text color

Post by HansieNL »

An example if device 123 is on change color of col-data of device 234 to red.
custom.js:

Code: Select all

function afterGetDevices(){
  if (alldevices[123].Data == 'On') {
    $('.block_234 .col-data').addClass('textred');
  }
  else {
    $('.block_234 .col-data').removeClass('textred');
  }
}
custom.css:

Code: Select all

.textred {
	color: red !important;
}
Blah blah blah
cornesch
Posts: 19
Joined: Sunday 10 November 2019 19:10
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Contact:

Re: Dashticz change temperature text color

Post by cornesch »

@HansieNL

Thanks, it works.

This code is even simpler than what I was trying
>>Raspberry Pi 4<<>>Raspberry Pi 3 + 7-inch Touchscreen<<>>Ikea Tradfri<<>>Nefit Easy<<>>ESP-Easy<<>>Netatmo<<>>Sonos<<
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest