function numberToRgbColor(i){ var rgb = [61,153,63]; if ( i < 31 ) { rgb = [217,22,22]; // GrĂ¼n } else { if ( i < 66 ) { rgb = [255,204,0]; // Gelb } else { rgb = [61,153,63]; // Rot } } return 'rgb(' + rgb[0] + ',' + rgb[1] + ',' + rgb[2] + ')'; } function fBattery(i){ if (i < 0) { swert = 0; } else if (i <= 5) { swert = 1; } else if (i <= 11) { swert = 2; } else if (i <= 18) { swert = 3; } else if (i <= 25) { swert = 4; } else if (i <= 32) { swert = 5; } else if (i <= 38) { swert = 6; } else if (i <= 44) { swert = 7; } else if (i <= 50) { swert = 8; } else if (i <= 58) { swert = 9; } else if (i <= 67) { swert = 10; } else if (i <= 75) { swert = 11; } else if (i <= 83) { swert = 12; } else if (i <= 92) { swert = 13; } else if (i <= 98) { swert = 14; } else { swert = 15; } sBild = "/vis.0/battery/" + swert + ".png"; return sBild; } function CurrentWeatherIcon(i){ swert = "/vis.0/wetter_tag/" + i + ".png"; return swert; } function UVIcon(i){ swert = "/vis.0/dashboard/uv-index-" + i + ".svg"; return swert; } function MondIcon(i){ swert = "/vis.0/mond/" + i + ".png"; return swert; } function AlexaMediaStream(i){ if (i==='') { swert = "/vis.0/tunein.png"; } else { swert = i; } return swert; } function CPU(i){ swert = ((i*100)/4).toFixed(2); if (swert > 100) { swert = 100; } return swert; } function WetterKorrektur(s){ if (s==='Sonne') { swert = "Wolkenlos"; } else { swert = s; } return swert; } function TF(i){ if (i > 60) { swert = "zu feucht"; } else if (i < 40) { swert = "zu trocken"; } else { swert = ""; } return swert; } function BF(i){ if (i > 60) { swert = "blink"; } else if (i < 40) { swert = "blink"; } else { swert = ""; } return swert; } function VF(i){ if (i > 60) { swert = "/vis.0/dashboard/raindrops.svg"; } else if (i < 40) { swert = "/vis.0/dashboard/raindrop-measure.svg"; } else { swert = "/vis.0/leer.png"; } return swert; } function DeviceColor(i) { if (i === 'true') { farbcode = "#61805e"; } else if (i === 'active') { farbcode = "#61805e"; } else { farbcode = "#992929"; } return farbcode; } function DeviceOnOff(i){ if (i === 'true') { swert = "Online"; } else if (i === 'active') { swert = "Online"; } else { swert = "Offline"; } return swert; } function SignalIcon(i){ swert = "/vis.0/signal_" + i + ".svg"; return swert; } function WifiIcon(i){ swert = "/vis.0/wifi_" + i + ".svg"; return swert; } function COFarbe(i){ if (i > 2250) { swert = "#FF0000"; } else if (i > 1700) { swert = "#ffa600"; } else if (i > 1180) { swert = "#FFFF00"; } else { swert = "#03ff03"; } return swert; } function NoiseFarbe(i){ if (i > 95) { swert = "#FF0000"; } else if (i > 85) { swert = "#ffa600"; } else if (i > 65) { swert = "#FFFF00"; } else { swert = "#03ff03"; } return swert; }