Hi ! I am figuring out an issue with the styling.
Today i added air quality.
Domoticz:
Dashticz
What i can style =
Text and class, but not the ICON.
I can do it with other things perfectly, but here the icon doesnt change. So i thought maybe i used an icon from the newest fontawesome, so i took one i use with other data, but still it doesnt change. Could it be that its not scripted? For what i can see its just a data block.
in the mean time i will update to 3.7.5 > 3.7.5 gives also the same result.
Lucht now 10 and shows green how it supposed to be.
custom.js
Code: Select all
// Luchtkwaliteit
function getStatus_13344(block){
var Data = block.device.Data;
if(parseFloat(Data)>300){
block.addClass='luchtbovendriehonderd';
block.icon = 'fas fa-skull-crossbones';
}
else if(parseFloat(Data) >201){
block.addClass='luchtboventweehonderd';
block.icon = 'far fa-sad-tear';
}
else if(parseFloat(Data) >151){
block.addClass='luchtbovenhonderdvijftig';
block.icon = 'far fa-frown';
}
else if(parseFloat(Data) >101){
block.addClass='luchtbovenhonderd';
block.icon = 'far fa-meh';
}
else if(parseFloat(Data) >51){
block.addClass='luchtbovenvijtig';
block.icon = 'far fa-smile';
}
else if(parseFloat(Data) >0){
block.addClass='luchtbovennul';
block.icon = 'fas fa-battery-full';
}
else {
block.addClass= 'none';
block.icon = 'far fa-smile-beam';
}
}
Output JSON idx 13344
Code: Select all
{
"AddjMulti" : 1.0,
"AddjMulti2" : 1.0,
"AddjValue" : 0.0,
"AddjValue2" : 0.0,
"BatteryLevel" : 255,
"CustomImage" : 0,
"Data" : "10 ppm",
"Description" : "",
"Favorite" : 0,
"HardwareID" : 7,
"HardwareName" : "DUMMY",
"HardwareType" : "Dummy (Does nothing, use for virtual switches only)",
"HardwareTypeVal" : 15,
"HaveTimeout" : false,
"ID" : "17470",
"LastUpdate" : "2021-03-05 15:20:01",
"Name" : "Lucht",
"Notifications" : "false",
"PlanID" : "0",
"PlanIDs" :
[
0
],
"Protected" : false,
"Quality" : "Excellent",
"ShowNotifications" : true,
"SignalLevel" : "-",
"SubType" : "Voltcraft CO-20",
"Timers" : "false",
"Type" : "Air Quality",
"TypeImg" : "air",
"Unit" : 1,
"Used" : 1,
"XOffset" : "0",
"YOffset" : "0",
"idx" : "13344"
},
edit:
This is what i see when i inspect the code:

edit1: 3.7.5 gives also the same result.