One of my million questions...
I would like to change a specific block background color (or title color) depending on the state it is in.
I have a block that tells me the Domoticz alarm state (Armed Home / Armed Away or Disarmed).
I know that it's possible to change styling, but I don't have enough CSS skills to do it myself.
Maybe the solution would be a nice extra for the wiki!
If block240 tells me "Disarmed", change that block background color, elseif ... but obviuously, that's the wrong language

I was thinking about something like this:
Code: Select all
function getStatus_240(block) {
var status = block.device.data;
if (status = 'Disarmed') {
block.background-color = red !important;
}
}
Code: Select all
function afterGetDevices() {
var devices = Domoticz.getAllDevices();
var device1=devices[240];
var value1=(device1.Data);
var newClass = '';
if (value1=Disarmed) newClass = 'danger';
Dashticz.setBlock('custom', { title: diff, addClass: newClass} );
}