-
Notifications
You must be signed in to change notification settings - Fork 0
/
main_raspberrypi.json
1 lines (1 loc) · 70.6 KB
/
main_raspberrypi.json
1
[{"id":"d5a4ac6e.7e43a","type":"tab","label":"Wetter","disabled":false,"info":""},{"id":"708b4165.aefbe","type":"inject","z":"d5a4ac6e.7e43a","name":"Refresh Timer","topic":"Refresh Timer","payload":"true","payloadType":"bool","repeat":"60","crontab":"","once":false,"onceDelay":"","x":180,"y":160,"wires":[["471aa7e1.c28c08","c0c55d77.2e601","92c50e42.03f8f","68f4de33.65c8a"]]},{"id":"b9a3c039.5f5bb","type":"ui_button","z":"d5a4ac6e.7e43a","name":"Weather Refresh","group":"968f93d7.ab3f2","order":1,"width":6,"height":1,"passthru":false,"label":"Aktualisieren","tooltip":"Wetterdaten aktualisieren","color":"","bgcolor":"","icon":"fa-refresh","payload":"true","payloadType":"bool","topic":"","x":170,"y":980,"wires":[["471aa7e1.c28c08","c0c55d77.2e601","92c50e42.03f8f","68f4de33.65c8a"]]},{"id":"edc29849.e738b8","type":"ui_text","z":"d5a4ac6e.7e43a","group":"968f93d7.ab3f2","order":3,"width":4,"height":1,"name":"Weather_details","label":"Jetzt: ","format":"{{msg.payload.detail}}","layout":"row-spread","x":1060,"y":120,"wires":[]},{"id":"86fd3da5.b1a27","type":"function","z":"d5a4ac6e.7e43a","name":"Prepare Dashboard Data","func":"var windDirection = {};\nvar windDirectionIcon = {};\nvar windSpeed = {};\nvar windSpeedIcon = {};\nvar sunRise = {};\nvar sunSet = {};\nvar conditionIcon = {};\nvar date = new Date ();\nvar humidity = {};\nvar temperature = {};\n\n/* function for converting meteorogical degree to text */\n\nvar degToCard = function(deg){\nif (deg>11.25 && deg<=33.75){\nreturn \"Nord-Nord-Ost\";\n }else if (deg>33.75 && deg<56.25){\nreturn \"Nord-Ost\";\n }else if (deg>56.25 && deg<78.75){\nreturn \"Ost-Nord-Ost\";\n }else if (deg>78.75 && deg<101.25){\nreturn \"Ost\";\n }else if (deg>101.25 && deg<123.75){\nreturn \"Ost-Süd-Ost\";\n }else if (deg>123.75 && deg<146.25){\nreturn \"Süd-Ost\";\n }else if (deg>146.25 && deg<168.75){\nreturn \"Süd-Süd-Ost\";\n }else if (deg>168.75 && deg<191.25){\nreturn \"Süd\";\n }else if (deg>191.25 && deg<213.75){\nreturn \"Süd-Süd-West\";\n }else if (deg>213.75 && deg<236.25){\nreturn \"Süd-West\";\n }else if (deg>236.25 && deg<258.75){\nreturn \"West-Süd-West\";\n }else if (deg>258.75 && deg<281.25){\nreturn \"West\";\n }else if (deg>281.25 && deg<303.75){\nreturn \"West-Nord-West\";\n }else if (deg>303.75 && deg<326.25){\nreturn \"Nord-West\";\n }else if (deg>326.25 && deg<348.75){\nreturn \"Nord-Nord-West\";\n }else{\nreturn \"Nord\"; \n }\n};\n\n/* function for converting meteorogical degree to weather icons */\n\nvar degToCardIcon = function(deg){\nif (deg>11.25 && deg<=33.75){\nreturn \"wi-from-nne\";\n }else if (deg>33.75 && deg<56.25){\nreturn \"wi-from-ne\";\n }else if (deg>56.25 && deg<78.75){\nreturn \"wi-from-ene\";\n }else if (deg>78.75 && deg<101.25){\nreturn \"wi-from-e\";\n }else if (deg>101.25 && deg<123.75){\nreturn \"wi-from-ese\";\n }else if (deg>123.75 && deg<146.25){\nreturn \"wi-from-se\";\n }else if (deg>146.25 && deg<168.75){\nreturn \"wi-from-sse\";\n }else if (deg>168.75 && deg<191.25){\nreturn \"wi-from-s\";\n }else if (deg>191.25 && deg<213.75){\nreturn \"wi-from-ssw\";\n }else if (deg>213.75 && deg<236.25){\nreturn \"wi-from-sw\";\n }else if (deg>236.25 && deg<258.75){\nreturn \"wi-from-wsw\";\n }else if (deg>258.75 && deg<281.25){\nreturn \"wi-from-w\";\n }else if (deg>281.25 && deg<303.75){\nreturn \"wi-from-wnw\";\n }else if (deg>303.75 && deg<326.25){\nreturn \"wi-from-nw\";\n }else if (deg>326.25 && deg<348.75){\nreturn \"wi-from-nnw\";\n }else{\nreturn \"wi-from-n\"; \n }\n};\n\n/* Function for converting wind speed into Beaufort scale icon */\n\nvar speedToCardIcon = function(speed){\nif (speed>0.5 && speed<=1.5){\nreturn \"wi-wind-beaufort-1\";\n }else if (speed>1.5 && speed<=3.3){\nreturn \"wi-wind-beaufort-2\";\n }else if (speed>3.3 && speed<=5.5){\nreturn \"wi-wind-beaufort-3\";\n }else if (speed>5.5 && speed<=7.9){\nreturn \"wi-wind-beaufort-4\";\n }else if (speed>7.9 && speed<=10.7){\nreturn \"wi-wind-beaufort-5\";\n }else if (speed>10.7 && speed<=13.8){\nreturn \"wi-wind-beaufort-6\";\n }else if (speed>13.8 && speed<=17.1){\nreturn \"wi-wind-beaufort-7\";\n }else if (speed>17.1 && speed<=20.7){\nreturn \"wi-wind-beaufort-8\";\n }else if (speed>20.7 && speed<=24.4){\nreturn \"wi-wind-beaufort-9\";\n }else if (speed>24.4 && speed<=28.4){\nreturn \"wi-wind-beaufort-10\";\n }else if (speed>28.4 && speed<=32.6){\nreturn \"wi-wind-beaufort-11\";\n }else if (speed>32.6){\nreturn \"wi-wind-beaufort-12\";\n }else{\nreturn \"wi-wind-beaufort-0\"; \n }\n};\n\n/* Function for Time Conversions */\n\nfunction timeConverter(UNIX_timestamp){\n var a = new Date(UNIX_timestamp * 1000);\n var hour = a.getHours();\n var min = a.getMinutes();\n if (min < 10) {min = \"0\" + min;}\n else {min = min;}\n var sec = a.getSeconds();\n if (sec < 10) {sec = \"0\" + sec;}\n else {sec = sec;}\n \n var time = hour + ':' + min + ':' + sec ;\n return time;\n};\n\n/* Convert OpenWeeather Map Icon to https://erikflowers.github.io/weather-icons/ */\n\nconst owIconMap = new Map();\n\nowIconMap.set('01d', 'wi-owm-01d'); // clear sky\nowIconMap.set('02d', 'wi-owm-02d'); // few clouds\nowIconMap.set('03d', 'wi-owm-03d'); // scattered clouds\nowIconMap.set('04d', 'wi-owm-04d'); // broken clouds\nowIconMap.set('09d', 'wi-owm-09d'); // shower rain\nowIconMap.set('10d', 'wi-owm-10d'); // rain\nowIconMap.set('11d', 'wi-owm-11d'); // thunderstorm\nowIconMap.set('13d', 'wi-owm-13d'); // snow\nowIconMap.set('50d', 'wi-owm-50d'); // mist\nowIconMap.set('01n', 'wi-owm-01n'); // clear sky\nowIconMap.set('02n', 'wi-owm-02n'); // few clouds\nowIconMap.set('03n', 'wi-owm-03n'); // scattered clouds\nowIconMap.set('04n', 'wi-owm-04n'); // broken clouds\nowIconMap.set('09n', 'wi-owm-09n'); // shower rain\nowIconMap.set('10n', 'wi-owm-10n'); // rain\nowIconMap.set('11n', 'wi-owm-11n'); // thunderstorm\nowIconMap.set('13n', 'wi-owm-13n'); // snow\nowIconMap.set('50n', 'wi-owm-50n'); // mist\n\nconditionIcon.topic = \"ConditionIcon\";\nconditionIcon.payload = owIconMap.get(msg.payload.icon);\n\nwindDirection.topic = \"WindDirection\";\nwindDirection.payload = degToCard(msg.payload.winddirection);\n\nwindDirectionIcon.topic = \"WindDirectionIcon\";\nwindDirectionIcon.payload = degToCardIcon(msg.payload.winddirection);\n\nwindSpeed.topic = \"WindSpeed\";\nwindSpeed.payload = msg.payload.windspeed + \" m/s\"; /* \" + windDirection.payload; */\n\nwindSpeedIcon.topic = \"WindSpeedIcon\";\nwindSpeedIcon.payload = speedToCardIcon(msg.payload.windspeed);\n\nsunRise.topic = \"SunRise\";\nsunRise.payload = timeConverter(msg.payload.sunrise);\n\nsunSet.topic = \"SunRet\";\nsunSet.payload = timeConverter(msg.payload.sunset);\n\nowIconMap.clear(); //freeing resource\n\nhumidity.topic = \"Humidity\";\nhumidity.payload = msg.payload.humidity;\nglobal.set(\"humiditynow\",msg.payload.humidity);\n\ntemperature.topic = \"Humidity\";\ntemperature.payload = msg.payload.tempc + \"℃\";\nglobal.set(\"temperaturenow\",msg.payload.tempc);\n\nreturn [conditionIcon, windSpeedIcon, windSpeed, windDirection, windDirectionIcon, sunRise, sunSet, humidity, temperature];","outputs":9,"noerr":0,"x":690,"y":300,"wires":[["badf90d3.335ab"],["c6fbb8e.d606048"],["9294c8a1.6458d8"],["9adb53da.2bc72"],["ec2edfdf.25b98"],["3ebabfc8.01775"],["e0bb0699.4994b8"],["cc46f9d3.959868"],["e84c4609.311308"]]},{"id":"471aa7e1.c28c08","type":"openweathermap","z":"d5a4ac6e.7e43a","name":"Current Weather","wtype":"current","lon":"","lat":"","city":"Bochum","country":"Deutschland","language":"de","x":440,"y":120,"wires":[["86fd3da5.b1a27","edc29849.e738b8"]]},{"id":"5d90fc4f.18c5f4","type":"comment","z":"d5a4ac6e.7e43a","name":"Open Weather API für aktuelles Wetter und Forecast","info":"","x":580,"y":420,"wires":[]},{"id":"badf90d3.335ab","type":"ui_template","z":"d5a4ac6e.7e43a","group":"968f93d7.ab3f2","name":"Condition Icon","order":4,"width":2,"height":2,"format":"<link rel=\"stylesheet\" href=\"/weather-icons/mycss/weather-icons.min.css\">\n<div style=\"display: flex;height: 100%;justify-content: center;align-items: center;\">\n<i class=\"fa-4x wi {{msg.payload}}\"></i>\n</div>\n","storeOutMessages":true,"fwdInMessages":true,"templateScope":"local","x":1060,"y":160,"wires":[[]]},{"id":"16311dec.907232","type":"debug","z":"d5a4ac6e.7e43a","name":"debug","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":630,"y":460,"wires":[]},{"id":"b38e6a31.8a5518","type":"debug","z":"d5a4ac6e.7e43a","name":"Forecast debug","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":660,"y":520,"wires":[]},{"id":"c0c55d77.2e601","type":"openweathermap","z":"d5a4ac6e.7e43a","name":"5 Day Forecast","wtype":"forecast","lon":"","lat":"","city":"Bochum","country":"Deutschland","language":"de","x":440,"y":760,"wires":[["3cd6f29f.ff219e","85927b11.3d2d48","b39f9d0.f3c146","a35179d.8f83988"]]},{"id":"3cd6f29f.ff219e","type":"function","z":"d5a4ac6e.7e43a","name":"Prepare Forecast Icon","func":"var wfcIcon1 = {};\nvar wfcIcon2 = {}; \nvar wfcIcon3 = {};\nvar wfcIcon4 = {};\nvar wfcIcon5 = {};\nvar wfcIcon6 = {};\nvar wfcIcon7 = {};\nvar wfcIcon8 = {};\n\n\nvar date = new Date ();\n\n/* Function for Time Conversions */\n\nfunction timeConverter(UNIX_timestamp){\n var a = new Date(UNIX_timestamp * 1000);\n var hour = a.getHours();\n var min = a.getMinutes();\n if (min < 10) {min = \"0\" + min;}\n else {min = min;}\n var sec = a.getSeconds();\n if (sec < 10) {sec = \"0\" + sec;}\n else {sec = sec;}\n \n var time = hour + ':' + min; /* + ':' + sec ;*/\n return time;\n}\n\n/* Convert OpenWeeather Map Icon to https://erikflowers.github.io/weather-icons/ */\n\nconst owIconMap = new Map();\n\nowIconMap.set('01d', 'wi-owm-01d'); // clear sky\nowIconMap.set('02d', 'wi-owm-02d'); // few clouds\nowIconMap.set('03d', 'wi-owm-03d'); // scattered clouds\nowIconMap.set('04d', 'wi-owm-04d'); // broken clouds\nowIconMap.set('09d', 'wi-owm-09d'); // shower rain\nowIconMap.set('10d', 'wi-owm-10d'); // rain\nowIconMap.set('11d', 'wi-owm-11d'); // thunderstorm\nowIconMap.set('13d', 'wi-owm-13d'); // snow\nowIconMap.set('50d', 'wi-owm-50d'); // mist\nowIconMap.set('01n', 'wi-owm-01n'); // clear sky\nowIconMap.set('02n', 'wi-owm-02n'); // few clouds\nowIconMap.set('03n', 'wi-owm-03n'); // scattered clouds\nowIconMap.set('04n', 'wi-owm-04n'); // broken clouds\nowIconMap.set('09n', 'wi-owm-09n'); // shower rain\nowIconMap.set('10n', 'wi-owm-10n'); // rain\nowIconMap.set('11n', 'wi-owm-11n'); // thunderstorm\nowIconMap.set('13n', 'wi-owm-13n'); // snow\nowIconMap.set('50n', 'wi-owm-50n'); // mist\n\nwfcIcon1.topic = msg.payload[0].dt_txt;\nwfcIcon1.payload = owIconMap.get(msg.payload[0].weather[0].icon);\n\nwfcIcon2.topic = msg.payload[1].dt_txt;\nwfcIcon2.payload = owIconMap.get(msg.payload[1].weather[0].icon);\n\nwfcIcon3.topic = msg.payload[2].dt_txt;\nwfcIcon3.payload = owIconMap.get(msg.payload[2].weather[0].icon);\n\nwfcIcon4.topic = msg.payload[3].dt_txt;\nwfcIcon4.payload = owIconMap.get(msg.payload[3].weather[0].icon);\n\nwfcIcon5.topic = msg.payload[4].dt_txt;\nwfcIcon5.payload = owIconMap.get(msg.payload[4].weather[0].icon);\n\nwfcIcon6.topic = msg.payload[5].dt_txt;\nwfcIcon6.payload = owIconMap.get(msg.payload[5].weather[0].icon);\n\nwfcIcon7.topic = msg.payload[6].dt_txt;\nwfcIcon7.payload = owIconMap.get(msg.payload[6].weather[0].icon);\n\nwfcIcon8.topic = msg.payload[7].dt_txt;\nwfcIcon8.payload = owIconMap.get(msg.payload[7].weather[0].icon);\n\n\nowIconMap.clear(); //freeing resource\n\nreturn [wfcIcon1, wfcIcon2, wfcIcon3, wfcIcon4, wfcIcon5, wfcIcon6, wfcIcon7, wfcIcon8];","outputs":8,"noerr":0,"x":680,"y":680,"wires":[["b8ce5a8a.024868"],["3bdadb80.4887b4"],["32ad93ff.f00bfc"],["bf29d6d8.eaaf58"],["6737bbd6.003874"],["c81a6420.40b008"],["624c8d9b.5fbf04"],["6fbfaf8c.62665"]]},{"id":"b8ce5a8a.024868","type":"ui_template","z":"d5a4ac6e.7e43a","group":"37b19686.0a7c0a","name":"WFc Icon 1","order":8,"width":3,"height":1,"format":"<link rel=\"stylesheet\" href=\"/weather-icons/mycss/weather-icons.min.css\">\n<div style=\"display: flex;height: 100%;justify-content: center;align-items: center;\">\n<i class=\"fa-2x wi {{msg.payload}}\"></i>\n</div>","storeOutMessages":true,"fwdInMessages":true,"templateScope":"local","x":1050,"y":540,"wires":[[]]},{"id":"3bdadb80.4887b4","type":"ui_template","z":"d5a4ac6e.7e43a","group":"37b19686.0a7c0a","name":"WFc Icon 2","order":9,"width":3,"height":1,"format":"<link rel=\"stylesheet\" href=\"/weather-icons/mycss/weather-icons.min.css\">\n<div style=\"display: flex;height: 100%;justify-content: center;align-items: center;\">\n<i class=\"fa-2x wi {{msg.payload}}\"></i>\n</div>","storeOutMessages":true,"fwdInMessages":true,"templateScope":"local","x":1050,"y":580,"wires":[[]]},{"id":"32ad93ff.f00bfc","type":"ui_template","z":"d5a4ac6e.7e43a","group":"37b19686.0a7c0a","name":"WFc Icon 3","order":10,"width":3,"height":1,"format":"<link rel=\"stylesheet\" href=\"/weather-icons/mycss/weather-icons.min.css\">\n<div style=\"display: flex;height: 100%;justify-content: center;align-items: center;\">\n<i class=\"fa-2x wi {{msg.payload}}\"></i>\n</div>","storeOutMessages":true,"fwdInMessages":true,"templateScope":"local","x":1050,"y":620,"wires":[[]]},{"id":"bf29d6d8.eaaf58","type":"ui_template","z":"d5a4ac6e.7e43a","group":"37b19686.0a7c0a","name":"WFc Icon 4","order":11,"width":3,"height":1,"format":"<link rel=\"stylesheet\" href=\"/weather-icons/mycss/weather-icons.min.css\">\n<div style=\"display: flex;height: 100%;justify-content: center;align-items: center;\">\n<i class=\"fa-2x wi {{msg.payload}}\"></i>\n</div>","storeOutMessages":true,"fwdInMessages":true,"templateScope":"local","x":1050,"y":660,"wires":[[]]},{"id":"6737bbd6.003874","type":"ui_template","z":"d5a4ac6e.7e43a","group":"37b19686.0a7c0a","name":"WFc Icon 5","order":12,"width":3,"height":1,"format":"<link rel=\"stylesheet\" href=\"/weather-icons/mycss/weather-icons.min.css\">\n<div style=\"display: flex;height: 100%;justify-content: center;align-items: center;\">\n<i class=\"fa-2x wi {{msg.payload}}\"></i>\n</div>","storeOutMessages":true,"fwdInMessages":true,"templateScope":"local","x":1050,"y":700,"wires":[[]]},{"id":"c81a6420.40b008","type":"ui_template","z":"d5a4ac6e.7e43a","group":"37b19686.0a7c0a","name":"WFc Icon 6","order":13,"width":3,"height":1,"format":"<link rel=\"stylesheet\" href=\"/weather-icons/mycss/weather-icons.min.css\">\n<div style=\"display: flex;height: 100%;justify-content: center;align-items: center;\">\n<i class=\"fa-2x wi {{msg.payload}}\"></i>\n</div>","storeOutMessages":true,"fwdInMessages":true,"templateScope":"local","x":1050,"y":740,"wires":[[]]},{"id":"624c8d9b.5fbf04","type":"ui_template","z":"d5a4ac6e.7e43a","group":"37b19686.0a7c0a","name":"WFc Icon 7","order":14,"width":3,"height":1,"format":"<link rel=\"stylesheet\" href=\"/weather-icons/mycss/weather-icons.min.css\">\n<div style=\"display: flex;height: 100%;justify-content: center;align-items: center;\">\n<i class=\"fa-2x wi {{msg.payload}}\"></i>\n</div>","storeOutMessages":true,"fwdInMessages":true,"templateScope":"local","x":1050,"y":780,"wires":[[]]},{"id":"6fbfaf8c.62665","type":"ui_template","z":"d5a4ac6e.7e43a","group":"37b19686.0a7c0a","name":"WFc Icon 8","order":15,"width":3,"height":1,"format":"<link rel=\"stylesheet\" href=\"/weather-icons/mycss/weather-icons.min.css\">\n<div style=\"display: flex;height: 100%;justify-content: center;align-items: center;\">\n<i class=\"fa-2x wi {{msg.payload}}\"></i>\n</div>","storeOutMessages":true,"fwdInMessages":true,"templateScope":"local","x":1050,"y":820,"wires":[[]]},{"id":"85927b11.3d2d48","type":"function","z":"d5a4ac6e.7e43a","name":"Prepare Forecast Data","func":"var fcdata = {};\n\nfcdata.payload = {\n forecast: {\n dt00: {\n dt_txt: msg.payload[0].dt_txt,\n temp_min: msg.payload[0].main.temp_min,\n temp_max: msg.payload[0].main.temp_max,\n temp: msg.payload[0].main.temp,\n desc: msg.payload[0].weather[0].description\n },\n dt01: {\n dt_txt: msg.payload[1].dt_txt,\n temp_min: msg.payload[1].main.temp_min,\n temp_max: msg.payload[1].main.temp_max,\n temp: msg.payload[1].main.temp,\n desc: msg.payload[1].weather[0].description\n },\n dt02: {\n dt_txt: msg.payload[2].dt_txt,\n temp_min: msg.payload[2].main.temp_min,\n temp_max: msg.payload[2].main.temp_max,\n temp: msg.payload[2].main.temp,\n desc: msg.payload[2].weather[0].description\n },\n dt03: {\n dt_txt: msg.payload[3].dt_txt,\n temp_min: msg.payload[3].main.temp_min,\n temp_max: msg.payload[3].main.temp_max,\n temp: msg.payload[3].main.temp,\n desc: msg.payload[3].weather[0].description\n },\n dt04: {\n dt_txt: msg.payload[4].dt_txt,\n temp_min: msg.payload[4].main.temp_min,\n temp_max: msg.payload[4].main.temp_max,\n temp: msg.payload[4].main.temp,\n desc: msg.payload[4].weather[0].description\n },\n dt05: {\n dt_txt: msg.payload[5].dt_txt,\n temp_min: msg.payload[5].main.temp_min,\n temp_max: msg.payload[5].main.temp_max,\n temp: msg.payload[5].main.temp,\n desc: msg.payload[5].weather[0].description\n },\n dt06: {\n dt_txt: msg.payload[6].dt_txt,\n temp_min: msg.payload[6].main.temp_min,\n temp_max: msg.payload[6].main.temp_max,\n temp: msg.payload[6].main.temp,\n desc: msg.payload[6].weather[0].description\n },\n dt07: {\n dt_txt: msg.payload[7].dt_txt,\n temp_min: msg.payload[7].main.temp_min,\n temp_max: msg.payload[7].main.temp_max,\n temp: msg.payload[7].main.temp,\n desc: msg.payload[7].weather[0].description\n }\n }\n}\n\nglobal.set(\"forecast\",msg.payload);\n\nreturn fcdata;","outputs":1,"noerr":0,"x":680,"y":800,"wires":[[]]},{"id":"69548907.88fcc8","type":"ui_template","z":"d5a4ac6e.7e43a","group":"37b19686.0a7c0a","name":"Forecast_Zeit","order":2,"width":27,"height":1,"format":"<div layout=\"row\" layout-align=\"space-around start\" ng-repeat=\"data in msg.payload.row\">\n <span flex style=\"color: black\">{{data.cell01}}</span>\n <span flex style=\"color: black\">{{data.cell02}}</span>\n <span flex style=\"color: black\">{{data.cell03}}</span>\n <span flex style=\"color: black\">{{data.cell04}}</span>\n <span flex style=\"color: black\">{{data.cell05}}</span>\n <span flex style=\"color: black\">{{data.cell06}}</span>\n <span flex style=\"color: black\">{{data.cell07}}</span>\n <span flex style=\"color: black\">{{data.cell08}}</span>\n <span flex style=\"color: black\">{{data.cell09}}</span>\n</div>","storeOutMessages":true,"fwdInMessages":true,"templateScope":"local","x":1060,"y":860,"wires":[[]]},{"id":"b39f9d0.f3c146","type":"function","z":"d5a4ac6e.7e43a","name":"Prepare forecast for UI widget","func":"var fcdata1 = {};\nvar fcdata2 = {};\nvar fcdata3 = {};\nvar fcdata4 = {};\n\n// prepare forecast data for CSS based ui widget\n\nfcdata1.payload = {\n row: {\n \tdata01: {\n \t cell01:\"zukünftige Zeit um: \",\n \t\tcell02: msg.payload[0].dt_txt.substring(11, 16),\n \t\tcell03: msg.payload[1].dt_txt.substring(11, 16),\n \t\tcell04: msg.payload[2].dt_txt.substring(11, 16),\n \t\tcell05: msg.payload[3].dt_txt.substring(11, 16),\n \t\tcell06: msg.payload[4].dt_txt.substring(11, 16),\n \t\tcell07: msg.payload[5].dt_txt.substring(11, 16),\n \t\tcell08: msg.payload[6].dt_txt.substring(11, 16),\n \t\tcell09: msg.payload[7].dt_txt.substring(11, 16)\n \t},\n }\n}\nfcdata2.payload = {\n row: {\n \tdata02: {\n \t cell01:\"Temperatur:\",\n \t\tcell02: msg.payload[0].main.temp + \"℃\",\n \t\tcell03: msg.payload[1].main.temp + \"℃\",\n \t\tcell04: msg.payload[2].main.temp + \"℃\",\n \t\tcell05: msg.payload[3].main.temp + \"℃\",\n \t\tcell06: msg.payload[4].main.temp + \"℃\",\n \t\tcell07: msg.payload[5].main.temp + \"℃\",\n \t\tcell08: msg.payload[6].main.temp + \"℃\",\n \t\tcell09: msg.payload[7].main.temp + \"℃\"\n \t}\n }\n}\nfcdata3.payload = {\n row: {\n \tdata03: {\n \t cell01:\"Freutigkeit:\",\n \t\tcell02: msg.payload[0].main.humidity + \"%\",\n \t\tcell03: msg.payload[1].main.humidity + \"%\",\n \t\tcell04: msg.payload[2].main.humidity + \"%\",\n \t\tcell05: msg.payload[3].main.humidity + \"%\",\n \t\tcell06: msg.payload[4].main.humidity + \"%\",\n \t\tcell07: msg.payload[5].main.humidity + \"%\",\n \t\tcell08: msg.payload[6].main.humidity + \"%\",\n \t\tcell09: msg.payload[7].main.humidity + \"%\"\n \t}\n }\n}\nfcdata4.payload = {\n row: {\n \tdata03: {\n \t cell01:\"Wetter:\",\n \t\tcell02: msg.payload[0].weather[0].description,\n \t\tcell03: msg.payload[1].weather[0].description,\n \t\tcell04: msg.payload[2].weather[0].description,\n \t\tcell05: msg.payload[3].weather[0].description,\n \t\tcell06: msg.payload[4].weather[0].description,\n \t\tcell07: msg.payload[5].weather[0].description,\n \t\tcell08: msg.payload[6].weather[0].description,\n \t\tcell09: msg.payload[7].weather[0].description\n \t}\n }\n}\nreturn [fcdata1,fcdata2,fcdata3,fcdata4];","outputs":4,"noerr":0,"x":710,"y":880,"wires":[["69548907.88fcc8"],["6459fd2f.436254"],["a00c82ac.0b89c"],["d338e5b3.e77ce8"]]},{"id":"9294c8a1.6458d8","type":"ui_text","z":"d5a4ac6e.7e43a","group":"9eb0630f.503e3","order":1,"width":6,"height":1,"name":"WindSpeed","label":"Geschwindigkeit:","format":"{{msg.payload}}","layout":"row-spread","x":1050,"y":240,"wires":[]},{"id":"3ebabfc8.01775","type":"ui_text","z":"d5a4ac6e.7e43a","group":"968f93d7.ab3f2","order":8,"width":2,"height":1,"name":"Sunrise","label":"","format":"{{msg.payload}}","layout":"col-center","x":1040,"y":360,"wires":[]},{"id":"e0bb0699.4994b8","type":"ui_text","z":"d5a4ac6e.7e43a","group":"968f93d7.ab3f2","order":11,"width":2,"height":1,"name":"Sunset","label":"","format":"{{msg.payload}}","layout":"col-center","x":1040,"y":400,"wires":[]},{"id":"251611f7.0a790e","type":"ui_template","z":"d5a4ac6e.7e43a","group":"968f93d7.ab3f2","name":"Sunrise Icon","order":7,"width":1,"height":1,"format":"<link rel=\"stylesheet\" href=\"/weather-icons/mycss/weather-icons.min.css\">\n<div style=\"display: flex;height: 100%;justify-content: left;align-items: center;\">\n<i class=\"fa-2x wi wi-sunrise\"></i>\n</div> ","storeOutMessages":true,"fwdInMessages":true,"templateScope":"local","x":1290,"y":320,"wires":[[]]},{"id":"26b03bc7.13eca4","type":"ui_template","z":"d5a4ac6e.7e43a","group":"968f93d7.ab3f2","name":"Sunset Icon","order":10,"width":1,"height":1,"format":"<link rel=\"stylesheet\" href=\"/weather-icons/mycss/weather-icons.min.css\">\n<div style=\"display: flex;height: 100%;justify-content: left;align-items: center;\">\n<i class=\"fa-2x wi wi-sunset\"></i>\n</div> ","storeOutMessages":true,"fwdInMessages":true,"templateScope":"local","x":1290,"y":400,"wires":[[]]},{"id":"ec2edfdf.25b98","type":"ui_template","z":"d5a4ac6e.7e43a","group":"9eb0630f.503e3","name":"WindDirection icon","order":3,"width":1,"height":1,"format":"<link rel=\"stylesheet\" href=\"/weather-icons/mycss/weather-icons-wind.css\">\n<div style=\"display: flex;height: 100%;justify-content: center;align-items: center;\">\n<i class=\"fa-2x wi wi-wind {{msg.payload}}\"></i>\n</div> ","storeOutMessages":true,"fwdInMessages":true,"templateScope":"local","x":1070,"y":320,"wires":[[]]},{"id":"c6fbb8e.d606048","type":"ui_template","z":"d5a4ac6e.7e43a","group":"9eb0630f.503e3","name":"WindSpeed Icon","order":5,"width":1,"height":1,"format":"<link rel=\"stylesheet\" href=\"/weather-icons/mycss/weather-icons-wind.css\">\n<div style=\"display: flex;height: 100%;justify-content: left;align-items: center;\">\n<i class=\"fa-2x wi wi-wind {{msg.payload}}\"></i>\n</div>","storeOutMessages":true,"fwdInMessages":true,"templateScope":"local","x":1060,"y":200,"wires":[[]]},{"id":"c084f669.c1a978","type":"ui_text","z":"d5a4ac6e.7e43a","group":"9eb0630f.503e3","order":4,"width":5,"height":1,"name":"Wind-Niveau","label":"Niveau (Beaufort):","format":"","layout":"row-spread","x":1290,"y":280,"wires":[]},{"id":"9adb53da.2bc72","type":"ui_text","z":"d5a4ac6e.7e43a","group":"9eb0630f.503e3","order":2,"width":5,"height":1,"name":"Wind-Direktion","label":"Direktion:","format":"{{msg.payload}}","layout":"row-spread","x":1060,"y":280,"wires":[]},{"id":"e84c4609.311308","type":"ui_text","z":"d5a4ac6e.7e43a","group":"968f93d7.ab3f2","order":5,"width":4,"height":1,"name":"Temperature","label":"Temperatur:","format":"{{msg.payload}}","layout":"row-spread","x":1040,"y":480,"wires":[]},{"id":"6459fd2f.436254","type":"ui_template","z":"d5a4ac6e.7e43a","group":"37b19686.0a7c0a","name":"Forecast_Temp","order":18,"width":27,"height":1,"format":"<div layout=\"row\" layout-align=\"space-around start\" ng-repeat=\"data in msg.payload.row\">\n <span flex style=\"color: black\">{{data.cell01}}</span>\n <span flex style=\"color: black\">{{data.cell02}}</span>\n <span flex style=\"color: black\">{{data.cell03}}</span>\n <span flex style=\"color: black\">{{data.cell04}}</span>\n <span flex style=\"color: black\">{{data.cell05}}</span>\n <span flex style=\"color: black\">{{data.cell06}}</span>\n <span flex style=\"color: black\">{{data.cell07}}</span>\n <span flex style=\"color: black\">{{data.cell08}}</span>\n <span flex style=\"color: black\">{{data.cell09}}</span>\n</div>","storeOutMessages":true,"fwdInMessages":true,"templateScope":"local","x":1060,"y":900,"wires":[[]]},{"id":"91ef4a72.2d4748","type":"ui_text","z":"d5a4ac6e.7e43a","group":"968f93d7.ab3f2","order":6,"width":3,"height":1,"name":"Sonnenaufgang","label":"Sonnenaufgang:","format":"","layout":"row-spread","x":1300,"y":360,"wires":[]},{"id":"ee54be29.db47b","type":"ui_text","z":"d5a4ac6e.7e43a","group":"968f93d7.ab3f2","order":9,"width":3,"height":1,"name":"Sonnenuntergang","label":"Sonnenuntergang:","format":"","layout":"row-spread","x":1310,"y":440,"wires":[]},{"id":"beb46ffa.e47b9","type":"ui_text","z":"d5a4ac6e.7e43a","group":"968f93d7.ab3f2","order":2,"width":6,"height":1,"name":"TIme","label":"Zeit:","format":"{{msg.payload}}","layout":"row-spread","x":1030,"y":60,"wires":[]},{"id":"92c50e42.03f8f","type":"change","z":"d5a4ac6e.7e43a","name":"Current Time","rules":[{"t":"set","p":"payload","pt":"msg","to":"","tot":"date"}],"action":"","property":"","from":"","to":"","reg":false,"x":430,"y":60,"wires":[["54fd8b8c.d16254"]]},{"id":"54fd8b8c.d16254","type":"function","z":"d5a4ac6e.7e43a","name":"get time","func":"var d = new Date();\nd.setHours(d.getHours() + 1);\ntime= d.toISOString();\nmsg.payload = time;\nreturn msg;","outputs":1,"noerr":0,"x":620,"y":60,"wires":[["65963c5e.ffea14"]]},{"id":"65963c5e.ffea14","type":"function","z":"d5a4ac6e.7e43a","name":"change time type","func":"var year = msg.payload.substring(0, 4);\nvar month = msg.payload.substring(5, 7);\nvar date = msg.payload.substring(8, 10);\nvar others = msg.payload.substring(11, 16);\nmsg.payload = date + \" / \" + month + \" / \" + year + \" \"+ others;\nreturn msg;","outputs":1,"noerr":0,"x":810,"y":60,"wires":[["beb46ffa.e47b9"]]},{"id":"a00c82ac.0b89c","type":"ui_template","z":"d5a4ac6e.7e43a","group":"37b19686.0a7c0a","name":"Forecast_Humidity","order":21,"width":27,"height":1,"format":"<div layout=\"row\" layout-align=\"space-around start\" ng-repeat=\"data in msg.payload.row\">\n <span flex style=\"color: black\">{{data.cell01}}</span>\n <span flex style=\"color: black\">{{data.cell02}}</span>\n <span flex style=\"color: black\">{{data.cell03}}</span>\n <span flex style=\"color: black\">{{data.cell04}}</span>\n <span flex style=\"color: black\">{{data.cell05}}</span>\n <span flex style=\"color: black\">{{data.cell06}}</span>\n <span flex style=\"color: black\">{{data.cell07}}</span>\n <span flex style=\"color: black\">{{data.cell08}}</span>\n <span flex style=\"color: black\">{{data.cell09}}</span>\n</div>","storeOutMessages":true,"fwdInMessages":true,"templateScope":"local","x":1070,"y":940,"wires":[[]]},{"id":"d338e5b3.e77ce8","type":"ui_template","z":"d5a4ac6e.7e43a","group":"37b19686.0a7c0a","name":"Forecast_Weather","order":5,"width":27,"height":1,"format":"<div layout=\"row\" layout-align=\"space-around start\" ng-repeat=\"data in msg.payload.row\">\n <span flex style=\"color: black\">{{data.cell01}}</span>\n <span flex style=\"color: black\">{{data.cell02}}</span>\n <span flex style=\"color: black\">{{data.cell03}}</span>\n <span flex style=\"color: black\">{{data.cell04}}</span>\n <span flex style=\"color: black\">{{data.cell05}}</span>\n <span flex style=\"color: black\">{{data.cell06}}</span>\n <span flex style=\"color: black\">{{data.cell07}}</span>\n <span flex style=\"color: black\">{{data.cell08}}</span>\n <span flex style=\"color: black\">{{data.cell09}}</span>\n</div>","storeOutMessages":true,"fwdInMessages":true,"templateScope":"local","x":1070,"y":980,"wires":[[]]},{"id":"46a0557b.be270c","type":"e-mail","z":"d5a4ac6e.7e43a","server":"smtp.gmail.com","port":"465","secure":true,"tls":true,"name":"[email protected]","dname":"Send_Email","x":1770,"y":1080,"wires":[]},{"id":"d6575941.a71908","type":"ui_text","z":"d5a4ac6e.7e43a","group":"7014e357.18188c","order":6,"width":6,"height":1,"name":"Judgement good weather","label":"Für Kleidungtrocknung geeignet?","format":"<font color= {{msg.color}} > {{msg.payload}} </font>","layout":"row-spread","x":1800,"y":1020,"wires":[]},{"id":"97d4b696.772458","type":"function","z":"d5a4ac6e.7e43a","name":"Judgement good weather and Alarm","func":"var judge = \"Ja\";\nvar icon = \"0\";\nvar k = 0;\nvar msg2 = {};\nvar msg1 = {};\n\nvar msg3 = {};\nvar testclothes = global.get(\"clothes\");\nvar judgeget11 = global.get(\"get11\");\nvar judgeget66 = global.get(\"get66\");\nvar judgesudo = global.get(\"sudo\");\nvar forecastdata = global.get(\"forecast\");\nmsg3.payload = testclothes;\n\nif (judgesudo === 1){\n if (judgeget66 == \"ja\"){\n judge = \"ja\";\n }else if (judgeget66 == \"nein\"){\n judge = \"nein\";}\n if (judgeget11 == \"ja\"){\n msg3.payload = \"ja\";\n alarm0 = forecastdata[0].weather[0].icon;\n alarm1 = forecastdata[1].weather[0].icon;\n alarm2 = forecastdata[2].weather[0].icon;\n if (alarm0 === \"09d\" || alarm0 === \"10d\" || alarm0 === \"11d\" || alarm0 === \"13d\" || alarm0 === \"50d\" ||\n alarm0 === \"09n\" || alarm0 === \"10n\" || alarm0 === \"11n\" || alarm0 === \"13n\" || alarm0 === \"50n\" ){\n msg2.payload = \"Vorsicht! Es regnet in drei Stunden, bitte nehmen Sie Ihre Kleidungen zurück!\";\n }else if (alarm1 === \"09d\" || alarm1 === \"10d\" || alarm1 === \"11d\" || alarm1 === \"13d\" || alarm1 === \"50d\" ||\n alarm1 === \"09n\" || alarm1 === \"10n\" || alarm1 === \"11n\" || alarm1 === \"13n\" || alarm1 === \"50n\" ){\n msg2.payload = \"Vorsicht! Es regnet in drei bis sechs Stunden, bitte nehmen Sie Ihre Kleidungen zurück!\";\n }else if (alarm2 === \"09d\" || alarm2 === \"10d\" || alarm2 === \"11d\" || alarm2 === \"13d\" || alarm2 === \"50d\" ||\n alarm2 === \"09n\" || alarm2 === \"10n\" || alarm2 === \"11n\" || alarm2 === \"13n\" || alarm2 === \"50n\" ){\n msg2.payload = \"Vorsicht! Es regnet in sechs bins neun Stunden, bitte nehmen Sie Ihre Kleidungen zurück!\";\n } \n }else if (judgeget11 == \"nein\"){\n msg2 = null;\n msg3.payload = \"nein\";\n }\n msg1.payload = judge;\n return [msg1,msg2,msg3];\n}else{\n for (k =0;k<=7;k++){\n icon = msg.payload[k].weather[0].icon;\n if(icon === \"09d\" || \n icon === \"10d\" ||\n icon === \"11d\" ||\n icon === \"13d\" ||\n icon === \"50d\" ||\n icon === \"09n\" ||\n icon === \"10n\" ||\n icon === \"11n\" ||\n icon === \"13n\" ||\n icon === \"50n\" ){judge = \"nein\";}\n }\n msg1.payload = judge;\n// Es alärmt sich nur, wenn es Kleidung gibt.--globale Variable \"clothes\" //\n if (testclothes === 1 ){\n msg3.payload = \"ja\";\n alarm0 = msg.payload[0].weather[0].icon;\n alarm1 = msg.payload[1].weather[0].icon;\n alarm2 = msg.payload[2].weather[0].icon;\n if (alarm0 === \"09d\" || alarm0 === \"10d\" || alarm0 === \"11d\" || alarm0 === \"13d\" || alarm0 === \"50d\" ||\n alarm0 === \"09n\" || alarm0 === \"10n\" || alarm0 === \"11n\" || alarm0 === \"13n\" || alarm0 === \"50n\" ){\n msg2.payload = \"Vorsicht! Es regnet in drei Stunden, bitte nehmen Sie Ihre Kleidungen zurück!\";\n }else if (alarm1 === \"09d\" || alarm1 === \"10d\" || alarm1 === \"11d\" || alarm1 === \"13d\" || alarm1 === \"50d\" ||\n alarm1 === \"09n\" || alarm1 === \"10n\" || alarm1 === \"11n\" || alarm1 === \"13n\" || alarm1 === \"50n\" ){\n msg2.payload = \"Vorsicht! Es regnet in drei bis sechs Stunden, bitte nehmen Sie Ihre Kleidungen zurück!\";\n }else if (alarm2 === \"09d\" || alarm2 === \"10d\" || alarm2 === \"11d\" || alarm2 === \"13d\" || alarm2 === \"50d\" ||\n alarm2 === \"09n\" || alarm2 === \"10n\" || alarm2 === \"11n\" || alarm2 === \"13n\" || alarm2 === \"50n\" ){\n msg2.payload = \"Vorsicht! Es regnet in sechs bins neun Stunden, bitte nehmen Sie Ihre Kleidungen zurück!\";\n }\n }else{\n msg2 = null;\n msg3.payload = \"nein\";\n }\n}\n\n\nreturn [msg1,msg2,msg3];","outputs":3,"noerr":0,"x":730,"y":1080,"wires":[["5b5901ee.a306d"],["e33fc50c.c631d8"],["3fd822bb.dfe37e"]],"info":"owIconMap.set('01d', 'wi-owm-01d'); // clear sky\nowIconMap.set('02d', 'wi-owm-02d'); // few clouds\nowIconMap.set('03d', 'wi-owm-03d'); // scattered clouds\nowIconMap.set('04d', 'wi-owm-04d'); // broken clouds\nowIconMap.set('09d', 'wi-owm-09d'); // shower rain\nowIconMap.set('10d', 'wi-owm-10d'); // rain\nowIconMap.set('11d', 'wi-owm-11d'); // thunderstorm\nowIconMap.set('13d', 'wi-owm-13d'); // snow\nowIconMap.set('50d', 'wi-owm-50d'); // mist\nowIconMap.set('01n', 'wi-owm-01n'); // clear sky\nowIconMap.set('02n', 'wi-owm-02n'); // few clouds\nowIconMap.set('03n', 'wi-owm-03n'); // scattered clouds\nowIconMap.set('04n', 'wi-owm-04n'); // broken clouds\nowIconMap.set('09n', 'wi-owm-09n'); // shower rain\nowIconMap.set('10n', 'wi-owm-10n'); // rain\nowIconMap.set('11n', 'wi-owm-11n'); // thunderstorm\nowIconMap.set('13n', 'wi-owm-13n'); // snow\nowIconMap.set('50n', 'wi-owm-50n'); // mist\n\n"},{"id":"e33fc50c.c631d8","type":"timed-counter","z":"d5a4ac6e.7e43a","name":"Alarm for each 9 hours","timelimit":"9","timeunit":"3600000","withhold":false,"fixedtimeout":true,"pertopic":false,"x":1080,"y":1080,"wires":[["ff58196a.623a78"]]},{"id":"ff58196a.623a78","type":"function","z":"d5a4ac6e.7e43a","name":"conter process","func":"if(msg.count === 1){\nreturn msg;}\nelse{\nreturn null;\n}","outputs":1,"noerr":0,"x":1520,"y":1080,"wires":[["46a0557b.be270c"]]},{"id":"31a1179.9bf62e8","type":"rpi-gpio in","z":"d5a4ac6e.7e43a","name":"status of clothes","pin":"15","intype":"tri","debounce":"25","read":true,"x":440,"y":580,"wires":[["ed2261fa.a995d"]]},{"id":"ed2261fa.a995d","type":"function","z":"d5a4ac6e.7e43a","name":"set status of clothes","func":"global.set(\"clothes\",msg.payload);\n\nreturn msg;","outputs":1,"noerr":0,"x":670,"y":580,"wires":[[]]},{"id":"bc832858.5b8d58","type":"inject","z":"d5a4ac6e.7e43a","name":"","topic":"","payload":"1","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":1310,"y":1560,"wires":[["7ee6fa05.271124"]]},{"id":"c0371024.bf708","type":"inject","z":"d5a4ac6e.7e43a","name":"","topic":"","payload":"0","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":1310,"y":1500,"wires":[["7ee6fa05.271124"]]},{"id":"7ee6fa05.271124","type":"rpi-gpio out","z":"d5a4ac6e.7e43a","name":"","pin":"15","set":"","level":"0","freq":"","out":"out","x":1460,"y":1540,"wires":[]},{"id":"be3b1ef1.0ec4f","type":"ui_text","z":"d5a4ac6e.7e43a","group":"7014e357.18188c","order":1,"width":6,"height":1,"name":"existence of clothes","label":"Gibt es jetzt Kleidung?","format":"<font color= {{msg.color}} > {{msg.payload}} </font>","layout":"row-spread","x":1800,"y":1140,"wires":[]},{"id":"cced6a32.35ef08","type":"rpi-dht22","z":"d5a4ac6e.7e43a","d":true,"name":"DHT11 Sensor1","topic":"Sensor1","dht":"11","pintype":"0","pin":"23","x":1620,"y":1520,"wires":[["1e8abc91.e5ed83"]]},{"id":"4001b514.54514c","type":"rpi-dht22","z":"d5a4ac6e.7e43a","d":true,"name":"DHT11 Sensor2","topic":"Sensor2","dht":"11","pintype":"0","pin":"24","x":1620,"y":1560,"wires":[["748e4af8.a74ac4"]]},{"id":"1e8abc91.e5ed83","type":"function","z":"d5a4ac6e.7e43a","d":true,"name":"set Sensor1 Data","func":"if (msg.isValid === true){\n global.set(\"condition1\",1);\n global.set(\"errors1\",msg.errors);\n global.set(\"humidity1\",msg.humidity);\n global.set(\"temperature1\",msg.payload);\n}\nelse {\n global.set(\"condition1\",0);\n}\nreturn msg;","outputs":1,"noerr":0,"x":1810,"y":1520,"wires":[[]]},{"id":"748e4af8.a74ac4","type":"function","z":"d5a4ac6e.7e43a","d":true,"name":"set Sensor2 Data","func":"if (msg.isValid === true){\n global.set(\"condition2\",1);\n global.set(\"errors2\",msg.errors);\n global.set(\"humidity2\",msg.humidity);\n global.set(\"temperature2\",msg.payload);\n}\nelse{\n global.set(\"condition2\",0);\n}\nreturn msg;","outputs":1,"noerr":0,"x":1810,"y":1560,"wires":[[]]},{"id":"e3048712.1d8438","type":"function","z":"d5a4ac6e.7e43a","name":"Analyse Sensor Data","func":"var con1 = global.get(\"condition1\");\nvar con2 = global.get(\"condition2\");\nvar msg1 = {};\nvar err1 = global.get(\"errors1\");\nvar err2 = global.get(\"errors2\");\nvar humi1 = global.get(\"humidity1\");\nvar humi2 = global.get(\"humidity2\");\nvar temp1 = global.get(\"temperature1\");\nvar temp2 = global.get(\"temperature2\");\n\nvar tempnow = global.get(\"temperaturenow\");\nvar huminow = global.get(\"humiditynow\");\nvar tempmax = tempnow * 1.1;\nvar tempmin = tempnow * 0.9;\nvar humimax = huminow * 1.1;\nvar humimin = huminow * 0.9;\nvar testclothes = global.get(\"clothes\");\n\nvar msg2 = {};\nvar msg3 = {};\nvar msg4 = {};\nvar msg5 = {};\n\nvar judgesudo = global.get(\"sudo\");\nvar judgeget11 = global.get(\"get11\");\nvar judgeget22 = global.get(\"get22\");\nvar judgeget33 = global.get(\"get33\");\nvar judgeget44 = global.get(\"get44\");\nvar judgeget55 = global.get(\"get55\");\n\nif (judgesudo === 1){\n if (judgeget22 == \"ja\" && judgeget11 == \"ja\"){\n msg4.payload = \"ja\";\n msg5.payload = \"Die Kleidung ist schon getrocknet.\";\n }else if(judgeget22 == \"nein\" && judgeget11 == \"ja\"){\n msg4.payload = \"nein\";\n msg5 = null;\n }else{\n msg4.payload = \"keine Kleidung!\";\n msg5 = null;\n }\n msg1.condition = judgeget55;\n msg2.payload = judgeget33 + \"℃\";\n msg3.payload = judgeget44 + \"%\";\n}\nelse{\n if (con1 == 1 && con2 == 1){\n if (err1 < err2){\n msg1.temperature = temp1;\n msg1.humidity = humi1;\n }\n else{\n msg1.temperature = temp2;\n msg1.humidity = humi2;\n }\n msg1.condition = \"In Ordnung\";\n }\n else if (con1 == 1 && con2 === 0){\n msg1.temperature = temp1;\n msg1.humidity = humi1; \n msg1.condition = \"Sensor2 arbeitet nicht\";\n }\n else if (con1 === 0 && con2 == 1){\n msg1.temperature = temp2;\n msg1.humidity = humi2; \n msg1.condition = \"Sensor1 arbeitet nicht\";\n }\n else if (con1 === 0 && con2 === 0){\n msg1.temperature = \"0.000\";\n msg1.humidity = \"0.000\"; \n msg1.condition = \"Nicht in Ordnung\";\n }\n else{\n msg1.condition = \"Fehler\";\n }\n msg2.payload = msg1.temperature.substring(0,2) + \"℃\";\n msg3.payload = msg1.humidity.substring(0,2) + \"%\";\n \n if (testclothes === 1){\n if (msg1.tempature > tempmin && msg1.tempature < tempmax && msg1.humidity > humimin && msg1.humidity < humimax ){\n msg4.payload = \"ja\";\n msg5.payload = \"Die Kleidung ist schon getrocknet.\"\n }else {\n msg4.payload = \"nein\";\n msg5 = null;\n }\n }else{\n msg4.payload = \"keine Kleidung!\";\n msg5 = null;\n }\n}\nreturn [msg1,msg2,msg3,msg4,msg5];\n","outputs":5,"noerr":0,"x":900,"y":1360,"wires":[["e0cd21e7.a4cc6"],["e0e5d0c.dab9a3"],["5cafe475.62340c"],["66cfbba2.121724"],["4b9fe5e1.821b1c"]]},{"id":"e0e5d0c.dab9a3","type":"ui_text","z":"d5a4ac6e.7e43a","group":"7014e357.18188c","order":3,"width":6,"height":1,"name":"Temperature of clothes","label":"Temperatur der Kleidung:","format":"{{msg.payload}}","layout":"row-spread","x":1200,"y":1320,"wires":[]},{"id":"5cafe475.62340c","type":"ui_text","z":"d5a4ac6e.7e43a","group":"7014e357.18188c","order":4,"width":6,"height":1,"name":"Humidity of clothes","label":"Freutigkeit der Kleidung:","format":"{{msg.payload}}","layout":"row-spread","x":1190,"y":1360,"wires":[]},{"id":"e2237761.23ab38","type":"ui_text","z":"d5a4ac6e.7e43a","group":"7014e357.18188c","order":5,"width":6,"height":1,"name":"Condition of Sensors","label":"Zustand des Sensors:","format":"<font color= {{msg.color}} > {{msg.condition}} </font>","layout":"row-spread","x":1810,"y":1240,"wires":[],"info":"<font color= {{msg.strongcolor}} > Zustand des Sensors </font>"},{"id":"c66d2ef1.fd58","type":"ui_text","z":"d5a4ac6e.7e43a","group":"7014e357.18188c","order":2,"width":6,"height":1,"name":"Condition of clothes","label":"Trocknung fertig?","format":"<font color= {{msg.color}} > {{msg.payload}} </font>","layout":"row-spread","x":1800,"y":1400,"wires":[]},{"id":"9bb4aac5.ddd658","type":"change","z":"d5a4ac6e.7e43a","name":"change color to lime","rules":[{"t":"set","p":"color","pt":"msg","to":"lime","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1540,"y":1200,"wires":[["e2237761.23ab38"]]},{"id":"e0cd21e7.a4cc6","type":"switch","z":"d5a4ac6e.7e43a","name":"change color of sensor-condition","property":"condition","propertyType":"msg","rules":[{"t":"eq","v":"In Ordnung","vt":"str"},{"t":"eq","v":"Sensor2 arbeitet nicht","vt":"str"},{"t":"eq","v":"Sensor1 arbeitet nicht","vt":"str"},{"t":"eq","v":"Nicht in Ordnung","vt":"str"},{"t":"eq","v":"Fehler","vt":"str"}],"checkall":"true","repair":false,"outputs":5,"x":1240,"y":1240,"wires":[["9bb4aac5.ddd658"],["f25d6c78.2e"],["f25d6c78.2e"],["81c0a6b8.038d28"],["81c0a6b8.038d28"]]},{"id":"f25d6c78.2e","type":"change","z":"d5a4ac6e.7e43a","name":"change color to orange","rules":[{"t":"set","p":"color","pt":"msg","to":"orange","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1550,"y":1240,"wires":[["e2237761.23ab38"]]},{"id":"81c0a6b8.038d28","type":"change","z":"d5a4ac6e.7e43a","name":"change color to red","rules":[{"t":"set","p":"color","pt":"msg","to":"red","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1540,"y":1280,"wires":[["e2237761.23ab38"]]},{"id":"3fd822bb.dfe37e","type":"switch","z":"d5a4ac6e.7e43a","name":"change color of existence of clothes","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"ja","vt":"str"},{"t":"eq","v":"nein","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":1140,"y":1140,"wires":[["e4bd5ada.bed958"],["433a2d31.a09a14"]]},{"id":"66cfbba2.121724","type":"switch","z":"d5a4ac6e.7e43a","name":"change color of condition of clothes","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"ja","vt":"str"},{"t":"eq","v":"nein","vt":"str"},{"t":"eq","v":"keine Kleidung!","vt":"str"}],"checkall":"true","repair":false,"outputs":3,"x":1250,"y":1400,"wires":[["f5158ea5.303fa"],["b001a60c.acbbb8"],["65072eeb.435ce"]]},{"id":"5b5901ee.a306d","type":"switch","z":"d5a4ac6e.7e43a","name":"change color of judgement","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"ja","vt":"str"},{"t":"eq","v":"nein","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":1100,"y":1020,"wires":[["b61a2528.d4db18"],["3ff6f053.9da72"]]},{"id":"b61a2528.d4db18","type":"change","z":"d5a4ac6e.7e43a","name":"change color to lime","rules":[{"t":"set","p":"color","pt":"msg","to":"lime","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1540,"y":1000,"wires":[["d6575941.a71908"]]},{"id":"3ff6f053.9da72","type":"change","z":"d5a4ac6e.7e43a","name":"change color to red","rules":[{"t":"set","p":"color","pt":"msg","to":"red","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1540,"y":1040,"wires":[["d6575941.a71908"]]},{"id":"e4bd5ada.bed958","type":"change","z":"d5a4ac6e.7e43a","name":"change color to lime","rules":[{"t":"set","p":"color","pt":"msg","to":"lime","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1540,"y":1120,"wires":[["be3b1ef1.0ec4f"]]},{"id":"433a2d31.a09a14","type":"change","z":"d5a4ac6e.7e43a","name":"change color to red","rules":[{"t":"set","p":"color","pt":"msg","to":"red","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1540,"y":1160,"wires":[["be3b1ef1.0ec4f"]]},{"id":"f5158ea5.303fa","type":"change","z":"d5a4ac6e.7e43a","name":"change color to lime","rules":[{"t":"set","p":"color","pt":"msg","to":"lime","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1550,"y":1340,"wires":[["c66d2ef1.fd58"]]},{"id":"b001a60c.acbbb8","type":"change","z":"d5a4ac6e.7e43a","name":"change color to red","rules":[{"t":"set","p":"color","pt":"msg","to":"red","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1540,"y":1380,"wires":[["c66d2ef1.fd58"]]},{"id":"fa5a0220.fea14","type":"delay","z":"d5a4ac6e.7e43a","name":"","pauseType":"delay","timeout":"2","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":670,"y":1360,"wires":[["e3048712.1d8438"]]},{"id":"faada2e3.e0512","type":"e-mail","z":"d5a4ac6e.7e43a","server":"smtp.gmail.com","port":"465","secure":true,"tls":true,"name":"[email protected]","dname":"Send_Email","x":1800,"y":1460,"wires":[]},{"id":"4b9fe5e1.821b1c","type":"timed-counter","z":"d5a4ac6e.7e43a","name":"Alarm for each 3 hours","timelimit":"3","timeunit":"3600000","withhold":false,"fixedtimeout":true,"pertopic":false,"x":1200,"y":1460,"wires":[["4478e3eb.517fdc"]]},{"id":"4478e3eb.517fdc","type":"function","z":"d5a4ac6e.7e43a","name":"conter process","func":"if(msg.count === 1){\nreturn msg;}\nelse{\nreturn null;\n}","outputs":1,"noerr":0,"x":1520,"y":1460,"wires":[["faada2e3.e0512"]]},{"id":"cc46f9d3.959868","type":"ui_gauge","z":"d5a4ac6e.7e43a","name":"","group":"9eb0630f.503e3","order":7,"width":6,"height":3,"gtype":"gage","title":"Luftfreutigkeit","label":"","format":"{{value}}%","min":0,"max":"100","colors":["#12ede3","#0980f6","#1631d7"],"seg1":"33","seg2":"67","x":1050,"y":440,"wires":[]},{"id":"58b46d7d.4d3944","type":"ui_text","z":"d5a4ac6e.7e43a","d":true,"group":"9eb0630f.503e3","order":6,"width":6,"height":1,"name":"Humidity","label":"Freutigkeit:","format":"{{msg.payload}}","layout":"row-spread","x":1280,"y":480,"wires":[]},{"id":"90712ce8.eefe4","type":"ui_switch","z":"d5a4ac6e.7e43a","name":"switch","label":"Schalter","tooltip":"","group":"f5f8af29.a1599","order":1,"width":4,"height":1,"passthru":true,"decouple":"false","topic":"key","style":"","onvalue":"1","onvalueType":"num","onicon":"","oncolor":"","offvalue":"0","offvalueType":"num","officon":"","offcolor":"","x":80,"y":2020,"wires":[["b1badba6.ee7e28"]]},{"id":"bf7f4831.2bb958","type":"ui_text_input","z":"d5a4ac6e.7e43a","name":"","label":"Password: ","tooltip":"","group":"f5f8af29.a1599","order":3,"width":4,"height":1,"passthru":true,"mode":"password","delay":"300","topic":"password","x":100,"y":1960,"wires":[["134ec910.6d3cb7"]]},{"id":"b1badba6.ee7e28","type":"function","z":"d5a4ac6e.7e43a","name":"set global key","func":"global.set(\"key\",msg.payload);\nvar msg2 = {};\n\nif (msg.payload === 1){\n msg2.payload = \"Öffnen\";\n}else{\n msg2.payload = \"Schließen\";\n}\n\n\nreturn [msg,msg2];","outputs":2,"noerr":0,"x":470,"y":2020,"wires":[["1d54740e.2cebfc","ecbed7f5.7117d8"],["d4de8279.5d6a6"]]},{"id":"4c92df48.0dbc7","type":"function","z":"d5a4ac6e.7e43a","name":"check password","func":"var key1 = global.get(\"key\");\nvar submit1 = global.get(\"submit\");\nvar password1 = global.get(\"passwordin\");\n\nvar check = function (pass){\n if (pass == \"88569638\"){\n return \"richtig\";\n }else {\n return \"falsch\";\n }\n}\n\nif (key1 === 0){\n return null;\n}\nelse{if (submit1 === 1){\n msg.payload = check(password1);\n \n return msg;}\n else{\n return null;\n}\n}","outputs":1,"noerr":0,"x":780,"y":2100,"wires":[["7b52df87.a14c4","e16168b7.fed5f8","ecbed7f5.7117d8"]]},{"id":"4b2ef22.893060c","type":"ui_button","z":"d5a4ac6e.7e43a","name":"","group":"f5f8af29.a1599","order":4,"width":2,"height":1,"passthru":false,"label":"submit","tooltip":"","color":"","bgcolor":"","icon":"","payload":"1","payloadType":"num","topic":"","x":100,"y":2080,"wires":[["56b52191.51fcb"]]},{"id":"56b52191.51fcb","type":"function","z":"d5a4ac6e.7e43a","name":"set global submit","func":"global.set(\"submit\",msg.payload);\n\nreturn msg;","outputs":1,"noerr":0,"x":480,"y":2080,"wires":[["730e8874.a1bc18","4c92df48.0dbc7"]]},{"id":"730e8874.a1bc18","type":"delay","z":"d5a4ac6e.7e43a","name":"","pauseType":"delay","timeout":"2","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":750,"y":2240,"wires":[["4d0a9e44.e71e1"]]},{"id":"4d0a9e44.e71e1","type":"function","z":"d5a4ac6e.7e43a","name":"reset global submit","func":"global.set(\"submit\",0);\n\nreturn msg;","outputs":1,"noerr":0,"x":1310,"y":2240,"wires":[[]]},{"id":"134ec910.6d3cb7","type":"function","z":"d5a4ac6e.7e43a","name":"set global passwordin","func":"global.set(\"passwordin\",msg.payload);\nreturn msg;","outputs":1,"noerr":0,"x":420,"y":1960,"wires":[[]]},{"id":"495827ac.14b8a8","type":"ui_template","z":"d5a4ac6e.7e43a","group":"f5f8af29.a1599","name":"light display","order":7,"width":1,"height":1,"format":"<div style=\"display:flex; overflow: hidden;tex-align:left\"><p> \n<svg height=\"40\" width=\"80\">\n<circle cx=\"30\" cy=\"30\" r=\"10\" style=\"stroke: none; fill: {{msg.payload}};\"/>\n</svg></p>\n\n</div>","storeOutMessages":true,"fwdInMessages":true,"templateScope":"local","x":1280,"y":1980,"wires":[[]],"info":"Light Status "},{"id":"7b52df87.a14c4","type":"function","z":"d5a4ac6e.7e43a","name":"color change","func":"\nif(msg.payload == \"richtig\")\n{\n\tvar newmsg = {\n payload: \"lime\" \n\t};\n\treturn newmsg;\n}\nelse if(msg.payload == \"falsch\")\n{\n\tvar newmsg = {\n payload: \"red\" \n\t};\n\treturn newmsg;\n}","outputs":1,"noerr":0,"x":1040,"y":1980,"wires":[["495827ac.14b8a8"]]},{"id":"457afc28.b396f4","type":"ui_text","z":"d5a4ac6e.7e43a","group":"f5f8af29.a1599","order":5,"width":3,"height":1,"name":"","label":"Gültigkeit des Modus:","format":"","layout":"row-spread","x":1080,"y":1940,"wires":[]},{"id":"e16168b7.fed5f8","type":"change","z":"d5a4ac6e.7e43a","name":"change payload","rules":[{"t":"change","p":"payload","pt":"msg","from":"richtig","fromt":"str","to":"EIN","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":"falsch","fromt":"str","to":"AUS","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1060,"y":2100,"wires":[["ee0c6f4c.17afb","4aaa06e4.fc0d48","67fd4443.4d645c"]]},{"id":"1d54740e.2cebfc","type":"function","z":"d5a4ac6e.7e43a","name":"judgement function","func":"if (msg.payload === 0){\n msg.payload = \"falsch\";\n return msg;\n}\nreturn null;","outputs":1,"noerr":0,"x":790,"y":1980,"wires":[["7b52df87.a14c4","e16168b7.fed5f8"]]},{"id":"743449eb.1cfb68","type":"function","z":"d5a4ac6e.7e43a","name":"global set sudo","func":"global.set(\"sudo\",msg.payload);\nreturn msg;","outputs":1,"noerr":0,"x":1590,"y":2100,"wires":[[]]},{"id":"ee0c6f4c.17afb","type":"change","z":"d5a4ac6e.7e43a","name":"change payload","rules":[{"t":"change","p":"payload","pt":"msg","from":"EIN","fromt":"str","to":"1","tot":"num"},{"t":"change","p":"payload","pt":"msg","from":"AUS","fromt":"str","to":"0","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":1300,"y":2100,"wires":[["743449eb.1cfb68"]]},{"id":"d4de8279.5d6a6","type":"ui_text","z":"d5a4ac6e.7e43a","group":"f5f8af29.a1599","order":2,"width":2,"height":1,"name":"Switchzustand","label":"","format":"{{msg.payload}}","layout":"row-spread","x":770,"y":2040,"wires":[]},{"id":"4aaa06e4.fc0d48","type":"ui_text","z":"d5a4ac6e.7e43a","group":"f5f8af29.a1599","order":6,"width":2,"height":1,"name":"word display","label":"","format":"{{msg.payload}}","layout":"row-spread","x":1280,"y":2060,"wires":[]},{"id":"477befbf.2c471","type":"ui_switch","z":"d5a4ac6e.7e43a","name":"Gibt es jetzt Kleidung?","label":"Gibt es jetzt Kleidung?","tooltip":"","group":"8c3e6f35.f6726","order":1,"width":4,"height":1,"passthru":true,"decouple":"false","topic":"m1","style":"","onvalue":"1","onvalueType":"num","onicon":"","oncolor":"","offvalue":"0","offvalueType":"num","officon":"","offcolor":"","x":140,"y":1580,"wires":[["4b19b326.548bec"]]},{"id":"6486484a.1b79f8","type":"ui_switch","z":"d5a4ac6e.7e43a","name":"Für Kleidungtrocknung geeignet?","label":"Für Kleidungtrocknung geeignet?","tooltip":"","group":"8c3e6f35.f6726","order":12,"width":5,"height":1,"passthru":true,"decouple":"false","topic":"6","style":"","onvalue":"1","onvalueType":"num","onicon":"","oncolor":"","offvalue":"0","offvalueType":"num","officon":"","offcolor":"","x":190,"y":1880,"wires":[["71480c71.26cce4"]]},{"id":"eff64c25.14dc","type":"ui_switch","z":"d5a4ac6e.7e43a","name":"","label":"Trocknung fertig?","tooltip":"","group":"8c3e6f35.f6726","order":4,"width":4,"height":1,"passthru":true,"decouple":"false","topic":"2","style":"","onvalue":"1","onvalueType":"num","onicon":"","oncolor":"","offvalue":"0","offvalueType":"num","officon":"","offcolor":"","x":120,"y":1640,"wires":[["645d570.9c958a8"]]},{"id":"a2abd1e5.dcc5b","type":"ui_slider","z":"d5a4ac6e.7e43a","name":"Freutigkeit der Kleidung:","label":"Freutigkeit der Kleidung:","tooltip":"","group":"8c3e6f35.f6726","order":8,"width":5,"height":1,"passthru":true,"outs":"all","topic":"4","min":0,"max":"100","step":1,"x":150,"y":1760,"wires":[["707aff81.8733f"]]},{"id":"ec37476.280c4b8","type":"ui_slider","z":"d5a4ac6e.7e43a","name":"Zustand des Sensors:","label":"Zustand des Sensors:","tooltip":"","group":"8c3e6f35.f6726","order":10,"width":4,"height":1,"passthru":true,"outs":"all","topic":"5","min":0,"max":"19","step":1,"x":140,"y":1820,"wires":[["81978648.159e78"]]},{"id":"261f6c11.9a2fc4","type":"ui_slider","z":"d5a4ac6e.7e43a","name":"Temperatur der Kleidung:","label":"Temperatur der Kleidung:","tooltip":"","group":"8c3e6f35.f6726","order":6,"width":5,"height":1,"passthru":true,"outs":"all","topic":"3","min":0,"max":"100","step":1,"x":150,"y":1700,"wires":[["be638a63.8e75d8"]]},{"id":"88004cb.ed149b","type":"ui_text","z":"d5a4ac6e.7e43a","group":"779f3205.8de5fc","order":2,"width":6,"height":1,"name":"Interface (below)","label":"","format":"{{msg.payload}}","layout":"row-spread","x":1300,"y":2180,"wires":[]},{"id":"67fd4443.4d645c","type":"function","z":"d5a4ac6e.7e43a","name":"interface (above) control","func":"var msg1 = {};\n\nif (msg.payload == \"AUS\"){\n msg1.payload = \"Der Entwicklermodus ist jetzt nicht verfügbar.\";\n}else{\n msg1.payload = \"Jetzt können Sie Entwicklermodus benutzen.\";\n}\n\nreturn msg1;","outputs":1,"noerr":0,"x":1330,"y":2140,"wires":[["382a0b7f.d749f4"]]},{"id":"382a0b7f.d749f4","type":"ui_text","z":"d5a4ac6e.7e43a","group":"779f3205.8de5fc","order":1,"width":6,"height":1,"name":"Interface (above)","label":"","format":"{{msg.payload}}","layout":"row-spread","x":1600,"y":2140,"wires":[]},{"id":"ecbed7f5.7117d8","type":"function","z":"d5a4ac6e.7e43a","name":"interface (below) control","func":"var key2 = global.get(\"key\");\nvar msg1 = {};\nvar get0 = global.get(\"sichern\");\n\n\n \nif (key2 === 0){\nmsg.payload = \"Bitte Öffnen Sie zuerst den Schalter!\";\n}else if (key2 === 1){\n if (msg.payload == \"richtig\"){\n msg.payload = \"Bitte nach der Veränderung 'sichern'!\";\n return msg;\n }else if (msg.payload == \"falsch\"){\n msg.payload = \"Falsches Geheimzahl!\";\n return msg;\n }else if (get0 == 1){\n msg.payload = \"Veränderungen werden erfolgreich gespeichert.\";\n return msg;\n}\n msg.payload = \"Bitte geben Sie dann das Geheimzahl und 'Submit'!\";\n}\n\n\nreturn msg;","outputs":1,"noerr":0,"x":810,"y":2180,"wires":[["88004cb.ed149b"]]},{"id":"4a39508.a1344b","type":"ui_text","z":"d5a4ac6e.7e43a","group":"8c3e6f35.f6726","order":2,"width":1,"height":1,"name":"Gibt es jetzt Kleidung?","label":"","format":"{{msg.payload}}","layout":"row-spread","x":1080,"y":1580,"wires":[]},{"id":"4b19b326.548bec","type":"change","z":"d5a4ac6e.7e43a","name":"change payload","rules":[{"t":"change","p":"payload","pt":"msg","from":"0","fromt":"num","to":"nein","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":"1","fromt":"num","to":"ja","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":480,"y":1580,"wires":[["44fa0225.fc6fdc"]]},{"id":"645d570.9c958a8","type":"change","z":"d5a4ac6e.7e43a","name":"change payload","rules":[{"t":"change","p":"payload","pt":"msg","from":"0","fromt":"num","to":"nein","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":"1","fromt":"num","to":"ja","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":480,"y":1640,"wires":[["e62fab4.fb06258"]]},{"id":"be34f253.e837f","type":"ui_text","z":"d5a4ac6e.7e43a","group":"8c3e6f35.f6726","order":5,"width":1,"height":1,"name":"Trocknung fertig?","label":"","format":"{{msg.payload}}","layout":"row-spread","x":1060,"y":1640,"wires":[]},{"id":"dc9479d1.4d73e8","type":"ui_text","z":"d5a4ac6e.7e43a","group":"8c3e6f35.f6726","order":7,"width":1,"height":1,"name":"Temperatur der Kleidung:","label":"","format":"{{msg.payload}}℃","layout":"row-spread","x":1090,"y":1700,"wires":[]},{"id":"4a0cc040.25f63","type":"ui_text","z":"d5a4ac6e.7e43a","group":"8c3e6f35.f6726","order":9,"width":1,"height":1,"name":"Freutigkeit der Kleidung:","label":"","format":"{{msg.payload}}%","layout":"row-spread","x":1090,"y":1760,"wires":[]},{"id":"81978648.159e78","type":"function","z":"d5a4ac6e.7e43a","name":"change payload","func":"if (msg.payload <= 4){\n msg.payload = \"In Ordnung\";\n}else if (msg.payload <= 9){\n msg.payload = \"Sensor1 arbeitet nicht\";\n}else if (msg.payload <= 14){\n msg.payload = \"Sensor2 arbeitet nicht\";\n}else {\n msg.payload = \"nicht in Ordnung\";\n}\nreturn msg;","outputs":1,"noerr":0,"x":480,"y":1820,"wires":[["ce2bca00.978618"]]},{"id":"4ee9a27b.a0403c","type":"ui_text","z":"d5a4ac6e.7e43a","group":"8c3e6f35.f6726","order":11,"width":2,"height":1,"name":"Zustand des Sensors:","label":"","format":"{{msg.payload}}","layout":"row-spread","x":1080,"y":1820,"wires":[]},{"id":"4d4491f5.cd1e","type":"ui_text","z":"d5a4ac6e.7e43a","group":"8c3e6f35.f6726","order":13,"width":1,"height":1,"name":"Für Kleidungtrocknung geeignet?","label":"","format":"{{msg.payload}}","layout":"row-spread","x":1130,"y":1880,"wires":[]},{"id":"71480c71.26cce4","type":"change","z":"d5a4ac6e.7e43a","name":"change payload","rules":[{"t":"change","p":"payload","pt":"msg","from":"0","fromt":"num","to":"nein","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":"1","fromt":"num","to":"ja","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":480,"y":1880,"wires":[["e3ce3abb.5ad208"]]},{"id":"8761e762.c494f8","type":"ui_button","z":"d5a4ac6e.7e43a","name":"Sichern","group":"8c3e6f35.f6726","order":3,"width":1,"height":2,"passthru":false,"label":"Sichern","tooltip":"","color":"","bgcolor":"","icon":"","payload":"1","payloadType":"num","topic":"sichern","x":80,"y":1520,"wires":[["c1b08861.ea7ef8"]]},{"id":"251adb9c.648094","type":"function","z":"d5a4ac6e.7e43a","name":"just transfer function","func":"return msg;","outputs":1,"noerr":0,"x":490,"y":1520,"wires":[["13996e4c.8033a2","ecbed7f5.7117d8","97d4b696.772458","e3048712.1d8438"]],"info":" var get1 = global.get(\"get11\");\n var get2 = global.get(\"get22\");\n var get3 = global.get(\"get33\");\n var get4 = global.get(\"get44\");\n var get5 = global.get(\"get55\");\n var get6 = global.get(\"get66\");"},{"id":"13996e4c.8033a2","type":"delay","z":"d5a4ac6e.7e43a","name":"","pauseType":"delay","timeout":"2","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":790,"y":1520,"wires":[["87e2ba68.6b13d8"]]},{"id":"87e2ba68.6b13d8","type":"function","z":"d5a4ac6e.7e43a","name":"set global sichern","func":"global.set(\"sichern\",0);\n\nreturn msg;","outputs":1,"noerr":0,"x":1060,"y":1520,"wires":[[]]},{"id":"c1b08861.ea7ef8","type":"function","z":"d5a4ac6e.7e43a","name":"sudo judgement","func":"var jsudo = global.get(\"sudo\");\nif (jsudo == 1){\nglobal.set(\"sichern\",msg.payload);\nreturn msg;\n}else{\n return null;\n}\n","outputs":1,"noerr":0,"x":260,"y":1520,"wires":[["251adb9c.648094"]]},{"id":"44fa0225.fc6fdc","type":"function","z":"d5a4ac6e.7e43a","name":"sudo judgement","func":"var jsudo = global.get(\"sudo\");\nif (jsudo == 1){\nglobal.set(\"get11\",msg.payload);\nreturn msg;\n}else{\n msg.payload = \"---\";\n return msg;\n}","outputs":1,"noerr":0,"x":820,"y":1580,"wires":[["4a39508.a1344b"]]},{"id":"e62fab4.fb06258","type":"function","z":"d5a4ac6e.7e43a","name":"sudo judgement","func":"var jsudo = global.get(\"sudo\");\nif (jsudo == 1){\nglobal.set(\"get22\",msg.payload);\nreturn msg;\n}else{\n msg.payload = \"---\";\n return msg;\n}","outputs":1,"noerr":0,"x":820,"y":1640,"wires":[["be34f253.e837f"]]},{"id":"be638a63.8e75d8","type":"function","z":"d5a4ac6e.7e43a","name":"sudo judgement","func":"var jsudo = global.get(\"sudo\");\nif (jsudo == 1){\nglobal.set(\"get33\",msg.payload);\nreturn msg;\n}else{\n msg.payload = \"---\";\n return msg;\n}","outputs":1,"noerr":0,"x":820,"y":1700,"wires":[["dc9479d1.4d73e8"]]},{"id":"707aff81.8733f","type":"function","z":"d5a4ac6e.7e43a","name":"sudo judgement","func":"var jsudo = global.get(\"sudo\");\nif (jsudo == 1){\nglobal.set(\"get44\",msg.payload);\nreturn msg;\n}else{\n msg.payload = \"---\";\n return msg;\n}","outputs":1,"noerr":0,"x":820,"y":1760,"wires":[["4a0cc040.25f63"]]},{"id":"ce2bca00.978618","type":"function","z":"d5a4ac6e.7e43a","name":"sudo judgement","func":"var jsudo = global.get(\"sudo\");\nif (jsudo == 1){\nglobal.set(\"get55\",msg.payload);\nreturn msg;\n}else{\n msg.payload = \"---\";\n return msg;\n}","outputs":1,"noerr":0,"x":820,"y":1820,"wires":[["4ee9a27b.a0403c"]]},{"id":"e3ce3abb.5ad208","type":"function","z":"d5a4ac6e.7e43a","name":"sudo judgement","func":"var jsudo = global.get(\"sudo\");\nif (jsudo == 1){\nglobal.set(\"get66\",msg.payload);\nreturn msg;\n}else{\n msg.payload = \"---\";\n return msg;\n}","outputs":1,"noerr":0,"x":820,"y":1880,"wires":[["4d4491f5.cd1e"]]},{"id":"a35179d.8f83988","type":"function","z":"d5a4ac6e.7e43a","name":"modus judgement","func":"var judgesudo = global.get(\"sudo\");\n\nif (judgesudo == 1){\n return null;\n}\nreturn msg;","outputs":1,"noerr":0,"x":670,"y":980,"wires":[["97d4b696.772458"]]},{"id":"68f4de33.65c8a","type":"function","z":"d5a4ac6e.7e43a","name":"modus judgement","func":"var judgesudo = global.get(\"sudo\");\n\nif (judgesudo == 1){\n return null;\n}\nreturn msg;","outputs":1,"noerr":0,"x":430,"y":1300,"wires":[["fa5a0220.fea14","1054ae35.1599a2","aa89e12.fcdc82"]]},{"id":"1054ae35.1599a2","type":"mqtt out","z":"d5a4ac6e.7e43a","name":"DHT11 Sensor1 send","topic":"DHT11 Sensor1 send","qos":"","retain":"","broker":"2bf2d585.30c47a","x":720,"y":1300,"wires":[]},{"id":"4f46f4a7.b7cc0c","type":"mqtt in","z":"d5a4ac6e.7e43a","name":"DHT11 Sensor1 temp","topic":"DHT11 Sensor1 temp","qos":"2","datatype":"auto","broker":"2bf2d585.30c47a","x":1480,"y":1800,"wires":[["5a155536.56b76c"]]},{"id":"1e1d885.6bbf778","type":"mqtt in","z":"d5a4ac6e.7e43a","name":"DHT11 Sensor2 temp","topic":"DHT11 Sensor2 temp","qos":"0","datatype":"auto","broker":"2bf2d585.30c47a","x":1480,"y":1620,"wires":[["e8421136.ae534"]]},{"id":"aa89e12.fcdc82","type":"mqtt out","z":"d5a4ac6e.7e43a","name":"DHT11 Sensor2 send","topic":"DHT11 Sensor2 send","qos":"","retain":"","broker":"2bf2d585.30c47a","x":720,"y":1240,"wires":[]},{"id":"584e5354.3eecac","type":"mqtt in","z":"d5a4ac6e.7e43a","name":"DHT11 Sensor1 humi","topic":"DHT11 Sensor1 humi","qos":"2","datatype":"auto","broker":"2bf2d585.30c47a","x":1480,"y":1840,"wires":[["b50bc500.851ce8"]]},{"id":"61fef866.ce3988","type":"mqtt in","z":"d5a4ac6e.7e43a","name":"DHT11 Sensor2 humi","topic":"DHT11 Sensor2 humi","qos":"0","datatype":"auto","broker":"2bf2d585.30c47a","x":1480,"y":1660,"wires":[["8b2558db.546948"]]},{"id":"e363b888.2391c8","type":"mqtt in","z":"d5a4ac6e.7e43a","name":"DHT11 Sensor1 valid","topic":"DHT11 Sensor1 valid","qos":"2","datatype":"auto","broker":"2bf2d585.30c47a","x":1480,"y":1880,"wires":[["c3ac154.6f9f8e8"]]},{"id":"e96a9377.c6239","type":"mqtt in","z":"d5a4ac6e.7e43a","name":"DHT11 Sensor2 valid","topic":"DHT11 Sensor2 valid","qos":"0","datatype":"auto","broker":"2bf2d585.30c47a","x":1480,"y":1700,"wires":[["f2ed3eaa.fa36e"]]},{"id":"a86ce4e.c8bf218","type":"mqtt in","z":"d5a4ac6e.7e43a","name":"DHT11 Sensor1 error","topic":"DHT11 Sensor1 error","qos":"2","datatype":"auto","broker":"2bf2d585.30c47a","x":1480,"y":1920,"wires":[["bed6b477.6f8218"]]},{"id":"3d09cb07.7d9a04","type":"mqtt in","z":"d5a4ac6e.7e43a","name":"DHT11 Sensor2 error","topic":"DHT11 Sensor2 error","qos":"0","datatype":"auto","broker":"2bf2d585.30c47a","x":1480,"y":1740,"wires":[["b60c45.125153b8"]]},{"id":"c3ac154.6f9f8e8","type":"function","z":"d5a4ac6e.7e43a","name":"set global condition1","func":"if (msg.payload === \"true\"){\n global.set(\"condition1\",1);\n}else{\n global.set(\"condition1\",0);\n}\nmsg.payload = global.get(\"condition1\");\nreturn msg;","outputs":1,"noerr":0,"x":1700,"y":1880,"wires":[[]]},{"id":"5a155536.56b76c","type":"delay","z":"d5a4ac6e.7e43a","name":"","pauseType":"delay","timeout":"1","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":1660,"y":1800,"wires":[["9c7c2828.b133b8"]]},{"id":"9c7c2828.b133b8","type":"function","z":"d5a4ac6e.7e43a","name":"","func":"var judge1 = global.get(\"condition1\");\nif (judge1 === 1){\n global.set(\"temperature1\",msg.payload);\n}\n\n\nreturn msg;\n","outputs":1,"noerr":0,"x":1790,"y":1800,"wires":[[]]},{"id":"b50bc500.851ce8","type":"delay","z":"d5a4ac6e.7e43a","name":"","pauseType":"delay","timeout":"1","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":1660,"y":1840,"wires":[["304a1fb8.61b01"]]},{"id":"304a1fb8.61b01","type":"function","z":"d5a4ac6e.7e43a","name":"","func":"var judge1 = global.get(\"condition1\");\nif (judge1 === 1){\n global.set(\"humidity1\",msg.payload);\n}\n\n\n\n\n\nreturn msg;\n","outputs":1,"noerr":0,"x":1790,"y":1840,"wires":[[]]},{"id":"bed6b477.6f8218","type":"delay","z":"d5a4ac6e.7e43a","name":"","pauseType":"delay","timeout":"1","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":1660,"y":1920,"wires":[["f448304.a19abd"]]},{"id":"f448304.a19abd","type":"function","z":"d5a4ac6e.7e43a","name":"","func":"var judge1 = global.get(\"condition1\");\nif (judge1 === 1){\n global.set(\"errors1\",msg.payload);\n}\n\nreturn msg;\n","outputs":1,"noerr":0,"x":1790,"y":1920,"wires":[[]]},{"id":"f2ed3eaa.fa36e","type":"function","z":"d5a4ac6e.7e43a","name":"set global condition2","func":"if (msg.payload === \"true\"){\n global.set(\"condition2\",1);\n}else{\n global.set(\"condition2\",0);\n}\nreturn msg;","outputs":1,"noerr":0,"x":1700,"y":1700,"wires":[[]]},{"id":"e8421136.ae534","type":"delay","z":"d5a4ac6e.7e43a","name":"","pauseType":"delay","timeout":"1","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":1660,"y":1620,"wires":[["e08fd9f.6d5a828"]]},{"id":"e08fd9f.6d5a828","type":"function","z":"d5a4ac6e.7e43a","name":"","func":"var judge1 = global.get(\"condition2\");\nif (judge1 === 1){\n global.set(\"temperature2\",msg.payload);\n}\n\n\nreturn msg;\n","outputs":1,"noerr":0,"x":1790,"y":1620,"wires":[[]]},{"id":"8b2558db.546948","type":"delay","z":"d5a4ac6e.7e43a","name":"","pauseType":"delay","timeout":"1","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":1660,"y":1660,"wires":[["a99ac659.c4a888"]]},{"id":"a99ac659.c4a888","type":"function","z":"d5a4ac6e.7e43a","name":"","func":"var judge1 = global.get(\"condition2\");\nif (judge1 === 1){\n global.set(\"humidity2\",msg.payload);\n}\n\n\n\n\n\nreturn msg;\n","outputs":1,"noerr":0,"x":1790,"y":1660,"wires":[[]]},{"id":"b60c45.125153b8","type":"delay","z":"d5a4ac6e.7e43a","name":"","pauseType":"delay","timeout":"1","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":1660,"y":1740,"wires":[["46ebdfe0.4796c"]]},{"id":"46ebdfe0.4796c","type":"function","z":"d5a4ac6e.7e43a","name":"","func":"var judge1 = global.get(\"condition2\");\nif (judge1 === 1){\n global.set(\"errors2\",msg.payload);\n}\n\nreturn msg;\n","outputs":1,"noerr":0,"x":1790,"y":1740,"wires":[[]]},{"id":"65072eeb.435ce","type":"change","z":"d5a4ac6e.7e43a","name":"change color to blue","rules":[{"t":"set","p":"color","pt":"msg","to":"blue","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1550,"y":1420,"wires":[["c66d2ef1.fd58"]]},{"id":"968f93d7.ab3f2","type":"ui_group","z":"","name":"Aktuelle Wetterinfomationen","tab":"17a04fab.621d9","order":1,"disp":true,"width":"6","collapse":false},{"id":"37b19686.0a7c0a","type":"ui_group","z":"","name":"Voraussagen","tab":"17a04fab.621d9","order":7,"disp":true,"width":"30","collapse":false},{"id":"9eb0630f.503e3","type":"ui_group","z":"","name":"Aktuelle Windsinfomationen","tab":"17a04fab.621d9","order":2,"disp":true,"width":6,"collapse":false},{"id":"7014e357.18188c","type":"ui_group","z":"","name":"Aktuelle Kleidungsinfomationen","tab":"17a04fab.621d9","order":3,"disp":true,"width":"6","collapse":false},{"id":"f5f8af29.a1599","type":"ui_group","z":"","name":"Entwicklermodus - Einloggen","tab":"17a04fab.621d9","order":4,"disp":true,"width":6,"collapse":false},{"id":"8c3e6f35.f6726","type":"ui_group","z":"","name":"Entwicklermodus - Funktionen","tab":"17a04fab.621d9","order":5,"disp":true,"width":6,"collapse":false},{"id":"779f3205.8de5fc","type":"ui_group","z":"","name":"Entwicklermodus - Interface","tab":"17a04fab.621d9","order":6,"disp":true,"width":"6","collapse":false},{"id":"2bf2d585.30c47a","type":"mqtt-broker","z":"","name":"","broker":"http://test.mosquitto.org/","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""},{"id":"17a04fab.621d9","type":"ui_tab","z":"","name":"Wetterstation","icon":"fa-thermometer-half","order":5,"disabled":false,"hidden":false}]