ACHTUNG missing ALIAS: ");
}
} */
htmlDP.push("ALIAS DP ASSIGNMENT");
htmlMSG.push("ALIAS STATUS");
htmlDP.push("-col-geprüftes Alias");
htmlMSG.push("-col-Anzahl: "+aliasArr.length+"");
htmlDP.push("");
htmlMSG.push("");
if (htmlDP.length != htmlMSG.length) {console.log("-------- !!! FEHLER in ANZAHL AUSGABE CHECK ALIAS : "+ "AnzahlDP: "+htmlDP.length+" AnzahlMSG: "+htmlMSG.length,"error");}
helplog("bin raus aus check aliase");
resolve();
} catch (e) {console.log("------------ERROR: "+e ); reject(); return alarmInstanz1=true}
}); //end promise
} //end function
//-----------------------------------------------SCHALTER MAIN------------------------------------------------
on({id:dpPrefix + "ProofingDatapoints.RunScript", ack: false, val: true}, function (obj) {
mainScript();
});
async function mainScript(){
setState(dpPrefix + "ProofingDatapoints.RunSuccessful",false);
let java= getState(dpPrefix + "ProofingDatapoints.JavaInstanzCheck").val;
let instanzAnzahl= getState(dpPrefix + "ProofingDatapoints.ObjectAnzahlCheck").val;
monster= getState(dpPrefix + "ProofingDatapoints.MonsterSearch").val;
var ohneInstanz = getState(dpPrefix + "ProofingDatapoints.ohneInstanzAnzeige").val;
unusedDayFactor = getState(dpPrefix + "ProofingDatapoints.LatestChangeDP_Factor").val;
ali = getState(dpPrefix + "ProofingDatapoints.CheckAliase").val;
unusedDay = getState(dpPrefix + "ProofingDatapoints.LatestChangeDP").val;
var endehtmlConst= "Letztes File Update: "+formatDate(getDateObject((parseFloat((new Date().getTime())))), "SS:mm:ss")+"
";
var endehtmlDPConst= "Letztes Table Update: "+formatDate(getDateObject((parseFloat((new Date().getTime())))), "SS:mm:ss")+"
";
setState(dpPrefix + "ProofingDatapoints.ScriptVersion",versionNr);
htmlHelper="";
htmlHelperFile="";
counterAll=0;
instanzArrHelp=[];
allInstArr=[];
htmlDP=[];
htmlMSG=[];
aliasArr=[];
setState(dpPrefix + "ProofingDatapoints.HTMLTable",htmlReset+endehtml+htmlError);
setStateDelayed(dpPrefix + "ProofingDatapoints.RunScript",false,2500);
writeFile(null, "/ProofingDatapoints/htmlputz.html" ,htmlReset+endehtml+htmlError+"", function (error) {mylog('file written'); });
await instanzCount(); //überprüft instanzen und stellt allInstArr her
htmlDP.push("-col-INSTANZ INFO"); htmlMSG.push(""); htmlDP.push(""); htmlMSG.push("");
mylog(instanzArr.length+"==================="+instanzArr.toString());
if (monster) {instanzArrHelp=allInstArr;} else {instanzArrHelp=instanzArr} //ACHTUNG MONSTERSEARCH
if (directSearch) {instanzArrHelp=[]; instanzArrHelp.push(getState(dpPrefix + "ProofingDatapoints.OrdnerCheck").val);}
for(let name in instanzArrHelp){
await checkWerte(instanzArrHelp[name]+".*").then(console.log("Funktion Check Werte erfolgreich")).catch(); //checkt alle werte in intanzArr
mylog("!!!!!!!!!!!!!!!!!!!!: "+instanzArrHelp[name]);}
if (instanzAnzahl){
htmlDP.unshift(""); htmlMSG.unshift("");htmlDP.unshift("OBJECTE IN INSTANZ"); htmlMSG.unshift("Anzahl");
for(let name in instanzArrHelp){
countDP(instanzArrHelp[name]);mylog("bin in zählen");}
if (java && !monster) countDP("javascript")
htmlDP.unshift("-col-GESAMT GEPRÜFTE OBJECTE IN INSTANZEN"); htmlMSG.unshift("-col-"+counterAll.toString()+"");
}
mylog("=============: "+counterAll);
if (java && !monster && !ohneInstanz && !directSearch) await checkWerte('javascript.*').catch().then(); //checkt alle javainstanzen
htmlDP.push("-col-ID's OHNE WERT:");
htmlMSG.push("");
for(let name in instanzArrHelp){
await checkTypes(instanzArrHelp[name]+".*").catch().then();
mylog("!!!!!!!!!!!!!!!!!!!!: "+instanzArrHelp[name])};
htmlDP.push("");
htmlMSG.push("");
htmlDP.push("-col-IDs MIT FALSCHEN TYPE:");
htmlMSG.push("");
if (java && !monster && !ohneInstanz && !directSearch ) await checkTypes('javascript.*').catch().then(); //checkt java instanz dp auf type
//log(allInstArr.toString(),"error");
if(ali) await checkAlias();
//ab hier geht es um die ausgabe
if (htmlDP.length != htmlMSG.length) {console.log("-------- !!! FEHLER in ANZAHL DATENAUSGABE : "+ "AnzahlDP: "+htmlDP.length+" AnzahlMSG: "+htmlMSG.length,"error");}
else {
//console.log(htmlMSG.length+"--"+htmlDP.length)
for(var i= htmlDP.length-1; i>-1; i--) {
//console.log(htmlDP[i]+"anerer :"+htmlMSG[i]);
// if (htmlMSG[i].includes("-col-")) console.log(htmlMSG[i]);
let htmlDPVis; let htmlDPFile;let htmlMSGVis;let htmlMSGFile;
if(htmlDP[i].includes("-col-")) {htmlDPVis=htmlDP[i].replace("-col-", (htmlHeadersDP+">")); htmlDPVis=" "+htmlDPVis } else {htmlDPVis=">"+htmlDP[i]}
if(htmlMSG[i].includes("-col-")) {htmlMSGVis=htmlMSG[i].replace("-col-", (htmlHeadersDP+">"));htmlMSGVis=" "+htmlMSGVis } else {htmlMSGVis=">"+htmlMSG[i]}
htmlHelper= htmlHelper+" | |
"
// if(htmlDP[i].includes("-col-")) {htmlDP[i]=htmlDP[i].replace("-col-", (htmlHeaders+">")); htmlDPFile=htmlDP[i]; htmlDPFile= " "+htmlDPFile ; } else {htmlDPFile=">"+htmlDP[i]}
if(htmlDP[i].includes("-col-")) {htmlDPFile=htmlDP[i].replace("-col-", (htmlHeaders+">")); htmlDPFile= " "+htmlDPFile ; } else {htmlDPFile=">"+htmlDP[i]}
if(htmlMSG[i].includes("-col-")) {htmlMSGFile=htmlMSG[i].replace("-col-", (htmlHeaders+">")); htmlMSGFile=" "+htmlMSGFile; } else {htmlMSGFile=">"+htmlMSG[i]}
htmlHelperFile= htmlHelperFile+" | |
"
}
var endehtml=endehtmlConst;
var endehtmlDP=endehtmlDPConst;
if (monster){endehtml="!!! Monster Suche wird automatisch deaktiviert !!!
"+endehtml;
endehtmlDP="!!! ACHTUNG: SYSTEM WIRD BELASTET !!! !!! Monster Suche wird automatisch deaktiviert !!! BERICHT/AUSWERTUNG NUR ÜBER WEBSEITE
"+endehtmlDP;}
if (!instanzAnzahl){endehtml="!!! Auswertung ohne DatenpunktZählung !!! kann enabled werden
"+endehtml;
endehtmlDP="!!! Auswertung ohne DatenpunktZählung !!! kann enabled werden
"+endehtmlDP;}
if (!java){ endehtml="!!! Auswertung ohne Javascript Instanzen !!! kann enabled werden
"+endehtml;
endehtmlDP="!!! Auswertung ohne Javascript Instanzen !!! kann enabled werden
"+endehtmlDP;}
if(!monster) { setStateDelayed(dpPrefix + "ProofingDatapoints.HTMLTable",endehtmlDP+""+htmlHelper,900);} else{setStateDelayed(dpPrefix + "ProofingDatapoints.HTMLTable",endehtmlDP,900);}
mylog("================================schreibe file") ;
writeFile(null, "/ProofingDatapoints/htmlputz.html" ,format+endehtml+htmlTable+htmlHelperFile+"
", function (error) { mylog('file written'); });
// endehtml=endehtmlConst;
// endehtmlDP=endehtmlDPConst;
setState(dpPrefix + "ProofingDatapoints.MonsterSearch",false); //setzt monstersearch zurück
directSearch=false;
setState(dpPrefix + "ProofingDatapoints.RunSuccessful",true);
} //ende else bei fehler im array zur ausgabe
}
const typesIO = ["boolean", "number", "string", "object", "array", "mixed", "sensor.window", "sensor.door", "sensor.alarm", "sensor.alarm.flood", "sensor.alarm.fire", "sensor.alarm.secure", "sensor.alarm.flood", "sensor.alarm.power", "sensor.alarm.secure", "sensor.door", "sensor.light", "sensor.lock", "sensor.motion", "sensor.rain", "sensor.noise", "sensor.rain", "sensor.window", "button", "button.long", "button.stop", "button.start", "button.open.door", "button.open.window", "button.mode", "button.mode.auto", "button.mode.manual", "button.mode.silent", "button.open.door", "button.open.window", "button.start", "button.stop", "value", "value.window", "value.temperature", "value.humidity", "value.battery", "value.blind", "value.brightness", "value.min", "value.max", "value.current", "value.curtain", "value.default", "value.battery", "value.valve", "value.time", "value.direction", "value.distance", "value.distance.visibility", "value.gps", "value.gps.elevation", "value.gps.latitude", "value.gps.longitude", "value.humidity", "value.interval", "value.gps.longitude", "value.gps.latitude", "value.gps.elevation", "value.gps", "value.power.consumption", "value.direction", "value.curtain", "value.blind", "value.tilt", "value.lock", "value.speed", "value.max", "value.min", "value.power.consumption", "value.pressure", "value.distance", "value.distance.visibility", "value.severity", "value.warning", "value.sun.elevation", "value.speed", "value.sun.azimuth", "value.sun.elevation", "value.temperature", "value.tilt", "value.time", "value.valve", "value.voltage", "value.current", "value.warning", "value.window", "indicator", "indicator.working", "indicator.reachable", "indicator.connected", "indicator.maintenance", "indicator.maintenance.lowbat", "indicator.maintenance.unreach", "indicator.maintenance.alarm", "indicator.lowbat", "indicator.alarm", "indicator.alarm.fire", "indicator.alarm.flood", "indicator.alarm.secure", "indicator.connected", "indicator.lowbat", "indicator.maintenance", "indicator.maintenance.alarm", "indicator.maintenance.lowbat", "indicator.maintenance.unreach", "indicator.reachable", "indicator.working", "level", "level.co2", "level.dimmer", "level.blind", "level.temperature", "level.valve", "level.color.red", "level.color.green", "level.co2", "level.color.blue", "level.color.white", "level.color.green", "level.color.hue", "level.color.saturation", "level.color.rgb", "level.color.luminance", "level.color.red", "level.color.rgb", "level.color.saturation", "level.color.temperature", "level.color.white", "level.curtain", "level.dimmer", "level.temperature", "level.tilt", "level.timer", "level.timer.sleep", "level.valve", "level.volume", "level.volume.group", "level.curtain", "level.tilt", "switch", "switch.lock", "switch.lock.door", "switch.lock.window", "switch.boost", "switch.light", "switch.comfort", "switch.enable", "switch.power", "switch.light", "switch.lock", "switch.lock.door", "switch.lock.window", "switch.mode.*", "switch.mode.auto", "switch.mode.color", "switch.mode.manual", "switch.mode.silent", "switch.mode.moonlight", "switch.mode.color", "switch.mode.silent", "switch.power", "button.stop", "button.play", "button.fastforward", "button.fastreverse", "button.forward", "button.next", "button.prev", "button.pause", "switch.pause", "button.forward", "button.play", "button.prev", "button.reverse", "button.fastforward", "button.fastreverse", "button.volume.up", "button.stop", "button.volume.down", "media.seek", "media.mode.shuffle", "media.mode.repeat", "media.state", "media.artist", "button.volume.up", "level.bass", "level.treble", "media.add", "media.album", "media.title", "media.title.next", "media.artist", "media.bitrate", "media.broadcastDate", "media.clear", "media.content", "media.cover", "media.cover.big", "media.cover.small", "media.duration.text", "media.date", "media.duration", "media.elapsed.text", "media.duration.text", "media.elapsed", "media.broadcastDate", "media.mute", "media.season", "media.elapsed.text", "media.episode", "media.mute.group", "media.tts", "media.bitrate", "media.genre", "media.date", "media.track", "media.input", "media.jump", "media.link", "media.mode.repeat", "media.mode.shuffle", "media.mute", "media.mute.group", "media.playid", "media.add", "media.clear", "media.playlist", "media.season", "media.seek", "media.state", "media.title", "media.title.next", "media.track", "media.tts", "media.url", "media.url.announcement", "media.jump", "media.content", "media.link", "media.input", "level.bass", "level.treble", "switch.pause", "switch.power.zone", "value.temperature", "value.temperature.windchill", "value.temperature.dewpoint", "value.temperature.feelslike", "value.temperature.min", "value.temperature.max", "value.humidity", "value.humidity.min", "value.humidity.max", "value.speed.wind", "value.speed.max.wind", "value.speed.min.wind", "value.speed.wind.gust", "value.direction.wind", "value.direction.max.wind", "value.direction.min.wind", "weather.direction.wind", "date", "date.forecast.1", "date.sunrise", "date.sunset", "dayofweek", "location", "weather.icon", "weather.icon.wind", "weather.icon.name", "weather.state", "value.clouds", "value.direction.max.wind", "value.direction.min.wind", "value.direction.wind", "value.direction.wind.forecast.0", "value.direction.wind.forecast.1", "value.humidity", "value.humidity.max", "value.humidity.min", "value.precipitation", "value.precipitation.day.forecast.0", "value.precipitation.forecast.0", "value.precipitation.forecast.0", "value.precipitation.forecast.1", "value.precipitation.forecast.1", "value.precipitation.hour", "value.precipitation.night.forecast.0", "value.precipitation.today", "value.pressure.forecast.0", "value.pressure.forecast.1", "value.radiation", "value.uv", "value.clouds", "value.rain", "value.rain.hour", "value.rain.today", "value.snow", "value.snow.hour", "value.snow.today", "value.snowline", "value.speed.max.wind", "value.speed.min.wind", "value.speed.wind", "value.speed.wind.forecast.0", "value.speed.wind.forecast.1", "value.speed.wind.gust", "value.temperature", "value.temperature.dewpoint", "value.temperature.feelslike", "value.temperature.max", "value.temperature.max.forecast.0", "value.temperature.max.forecast.1", "value.temperature.min", "value.temperature.min.forecast.0", "value.temperature.min.forecast.1", "value.temperature.windchill", "value.uv", "weather.chart.url", "weather.chart.url.forecast", "weather.direction.wind", "weather.direction.wind.forecast.0", "weather.html", "weather.title", "weather.title.short", "weather.type", "weather.icon", "weather.icon.forecast.1", "weather.icon.name", "weather.icon.wind", "weather.json", "value.speed.wind.forecast.0", "weather.state", "weather.state.forecast.0", "value.direction.wind.forecast.0", "weather.direction.wind.forecast.0", "value.pressure.forecast.0", "value.temperature.min.forecast.0", "value.temperature.max.forecast.0", "value.precipitation.forecast.0", "value.precipitation.forecast.0", "weather.state.forecast.1", "weather.title", "weather.title.forecast.0", "value.precipitation.day.forecast.0", "value.precipitation.night.forecast.0", "weather.title.short", "weather.type", "date.forecast.1", "weather.icon.forecast.1", "weather.state.forecast.1", "value.temperature.min.forecast.1", "value.temperature.max.forecast.1", "value.precipitation.forecast.1", "value.precipitation.forecast.1", "value.direction.wind.forecast.1", "value.speed.wind.forecast.1", "value.pressure.forecast.1", "date.end", "date.start", "info.address", "info.display", "info.ip", "info.mac", "info.name", "info.address", "info.port", "info.standby", "info.status", "info.display", "date.start", "date.end", "text.phone", "url.icon", "url.cam", "url.audio", "url.blank", "url.cam", "url.icon", "url.same", "url.audio", "text.phone", "adapter.messagebox", "adapter.wakeup",]