NEWS
ems-esp (km200) Schaltprogramm darstellen/später auch ändern
-
Hallo,
ich suche jemanden, welcher eine Buderus bzw km200 benutzt und auch node-red als HMI/VISU.
Gibt es bereits Lösungen die km200 Zeiteinstellung extern anzupassen ohne App bzw Wandregler?
Gibt es bereits Lösungen um das Zeitprogramm auf Node-Red anzuzeigen?was ich bereits erstellt habe:
- Die Daten von der Heizung splitten in einzelne Tage und lesbare Zeit integrieren:
- eine Tabelle erstellt, mit "checkboxen" welche zurück an Node-red gesendet werden können:
Jetzt würde ich gern als erstes die Checkboxen bereits als "checked" setzen, was im Moment von km200 aktiv ist.
Ich bekomme jedoch die Daten nicht in die Tabelle integriert.Falls jemand die Sache mal selbst testen möchte hier mein Flow:
(Aufruf der Seite: http://IP_NODE_RED:1880/site_km200_switchProgramm)
[{"id":"d838b487d73a043b","type":"tab","label":"Flow 3","disabled":false,"info":"","env":[]},{"id":"61626a1ae3ab6608","type":"http in","z":"d838b487d73a043b","name":"","url":"/site_km200_switchProgramm","method":"get","upload":false,"swaggerDoc":"","x":160,"y":280,"wires":[["35ea212cb42c1ea5"]]},{"id":"d6a2d51ef6a46008","type":"http in","z":"d838b487d73a043b","name":"","url":"/sitepost","method":"post","upload":false,"swaggerDoc":"","x":110,"y":520,"wires":[["af641c1594ded66c","e65a9a92699f98d9"]]},{"id":"35ea212cb42c1ea5","type":"function","z":"d838b487d73a043b","name":"msg.url = \"sitepost\";","func":"msg.url = \"sitepost\";\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":420,"y":280,"wires":[["b0f75ca5e0cc5b79"]]},{"id":"af641c1594ded66c","type":"debug","z":"d838b487d73a043b","name":"mysitepost","active":true,"tosidebar":true,"console":false,"complete":"payload","statusVal":"","statusType":"auto","x":760,"y":520,"wires":[]},{"id":"0bb50d25790c1461","type":"http response","z":"d838b487d73a043b","name":"","x":780,"y":480,"wires":[]},{"id":"b0f75ca5e0cc5b79","type":"template","z":"d838b487d73a043b","name":"msg.payload.script (JavaScript)","field":"payload.script","fieldType":"msg","format":"javascript","syntax":"plain","template":"$(document).ready(function(e) {\n \n $(\"form[ajax=true]\").submit(function(e) {\n \n e.preventDefault();\n \n var form_data = $(this).serialize();\n var form_url = $(this).attr(\"action\");\n var form_method = $(this).attr(\"method\").toUpperCase();\n \n $(\"#loadingimg\").show();\n \n $.ajax({\n url: form_url, \n type: form_method, \n data: form_data, \n cache: false,\n success: function(returnhtml){ \n $(\"#result\").html(returnhtml); \n $(\"#loadingimg\").hide(); \n } \n }); \n }); \n});","x":450,"y":320,"wires":[["86bbb475651a31b5"]]},{"id":"a565b23f2eacf77c","type":"http response","z":"d838b487d73a043b","name":"","x":1110,"y":360,"wires":[]},{"id":"97dc905525f2ab56","type":"template","z":"d838b487d73a043b","name":"msg.payload (HTML)","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"<html>\n <head>\n <meta name=\"viewport\" content=\"initial-scale=1.0, user-scalable=no\">\n <meta charset=\"utf-8\">\n <script src=\"http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.0/jquery.min.js\"></script>\n <style>{{{payload.style}}}</style>\n </head>\n\n<div>\n <form method=\"post\" action=\"/{{url}}\" ajax=\"true\">\n\n<table cellpadding=\"0\" cellspacing=\"0\" id=\"our_table\" border=\"1\">\n <thead>\n <tr>\n <th></th>\n <th bgcolor=\"grey\">0</th>\n <th></th>\n <th></th>\n <th></th>\n <th bgcolor=\"grey\">1</th>\n <th></th>\n <th></th>\n <th></th> \n <th bgcolor=\"grey\">2</th>\n <th></th>\n <th></th>\n <th></th>\n <th bgcolor=\"grey\">3</th>\n <th></th>\n <th></th>\n <th></th>\n <th bgcolor=\"grey\">4</th>\n <th></th>\n <th></th>\n <th></th>\n <th bgcolor=\"grey\">5</th>\n <th></th>\n <th></th>\n <th></th>\n <th bgcolor=\"grey\">6</th>\n <th></th>\n <th></th>\n <th></th>\n <th bgcolor=\"grey\">7</th>\n <th></th>\n <th></th>\n <th></th>\n <th bgcolor=\"grey\">8</th>\n <th></th>\n <th></th>\n <th></th>\n <th bgcolor=\"grey\">9</th>\n <th></th>\n <th></th>\n <th></th>\n <th bgcolor=\"grey\">10</th>\n <th></th>\n <th></th>\n <th></th> \n <th bgcolor=\"grey\">11</th>\n <th></th>\n <th></th>\n <th></th>\n <th bgcolor=\"grey\">12</th>\n <th></th>\n <th></th>\n <th></th>\n <th bgcolor=\"grey\">13</th>\n <th></th>\n <th></th>\n <th></th>\n <th bgcolor=\"grey\">14</th>\n <th></th>\n <th></th>\n <th></th>\n <th bgcolor=\"grey\">15</th>\n <th></th>\n <th></th>\n <th></th>\n <th bgcolor=\"grey\">16</th>\n <th></th>\n <th></th>\n <th></th>\n <th bgcolor=\"grey\">17</th>\n <th></th>\n <th></th>\n <th></th>\n <th bgcolor=\"grey\">18</th>\n <th></th>\n <th></th>\n <th></th>\n <th bgcolor=\"grey\">19</th>\n <th></th>\n <th></th>\n <th></th>\n <th bgcolor=\"grey\">20</th>\n <th></th>\n <th></th>\n <th></th>\n <th bgcolor=\"grey\">21</th>\n <th></th>\n <th></th>\n <th></th>\n <th bgcolor=\"grey\">22</th>\n <th></th>\n <th></th>\n <th></th>\n <th bgcolor=\"grey\">23</th>\n <th></th>\n <th></th>\n <th></th> \n </tr>\n </thead>\n <tbody>\n {{{payload.TableLines}}}\n </tbody>\n</table>\n <input type=\"submit\" value=\"Submit\">\n </form>\n</div>\n<div>\n <span id=\"result\"></span>\n</div>\n\n</body>\n</html>\n<script>{{{payload.script}}}</script>","x":940,"y":360,"wires":[["a565b23f2eacf77c"]]},{"id":"28a8821ccf9c863f","type":"function","z":"d838b487d73a043b","name":"return msg.payload to client","func":"msg.payload = 'msg.payload: '+msg.payload;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":510,"y":480,"wires":[["0bb50d25790c1461"]]},{"id":"367f7d041d7b4d09","type":"comment","z":"d838b487d73a043b","name":"Inject msg object properties","info":"","x":440,"y":240,"wires":[]},{"id":"e65a9a92699f98d9","type":"json","z":"d838b487d73a043b","name":"","x":320,"y":480,"wires":[["28a8821ccf9c863f"]]},{"id":"42cb554109f99a60","type":"comment","z":"d838b487d73a043b","name":"Website (http://IP_NODE_RED:1880/site_km200_switchProgramm)","info":"","x":260,"y":200,"wires":[]},{"id":"7120e9d144e8d9d7","type":"comment","z":"d838b487d73a043b","name":"Form Submission","info":"","x":120,"y":460,"wires":[]},{"id":"86bbb475651a31b5","type":"template","z":"d838b487d73a043b","name":"msg.payload.style (CSS)","field":"payload.style","fieldType":"msg","format":"html","syntax":"mustache","template":"input[type=submit] {\n //width: 100%;\n background-color: #4CAF50;\n color: white;\n padding: 14px 20px;\n margin: 8px 0;\n border: none;\n border-radius: 4px;\n cursor: pointer;\n}\n\ninput[type=submit]:hover {\n background-color: #45a049;\n}\n//##############\n.checkbox_color {\ndisplay: inline-flex;\ncursor: pointer;\nposition: relative;\n}\n\n.checkbox_color > input {\nheight: 12px;\nwidth: 10px;\n-webkit-appearance: none;\n-moz-appearance: none;\n-o-appearance: none;\nappearance: none;\noutline: none;\ntransition-duration: 0.3s;\nbackground-color: blue;\ncursor: pointer;\n}\n\n.checkbox_color > input:checked {\nheight: 25px;\nwidth: 10px;\nbackground-color: red;\n}","x":430,"y":360,"wires":[["68cc99075a593cf0"]]},{"id":"1e9bdf58af557a76","type":"ioBroker get","z":"d838b487d73a043b","name":"ems-esp.0.heatingCircuits.hc1.switchPrograms.A","topic":"ems-esp.0.heatingCircuits.hc1.switchPrograms.A","attrname":"Data","payloadType":"value","x":370,"y":120,"wires":[["aea39cfd99b6bb61"]]},{"id":"aea39cfd99b6bb61","type":"json","z":"d838b487d73a043b","name":"","property":"Data","action":"obj","pretty":false,"x":630,"y":120,"wires":[["da1467957105598f","95f290e946f0b169"]]},{"id":"da1467957105598f","type":"function","z":"d838b487d73a043b","name":"function trenne Tage + hh:mm aus time","func":"var array = msg.Data;\nvar Mo = []\nvar Tu = []\nvar We = []\nvar Th = []\nvar Fr = []\nvar Sa = []\nvar Su = [] \nvar Week = []\n\narray.forEach(function(n) {\n var timeHH = n.time / 60;\n timeHH = timeHH | 0;\n timeHH = (\"00\" + timeHH).slice(-2);\n\n var timeMM = (n.time - (timeHH * 60));\n timeMM = (\"00\" + timeMM).slice(-2);\n\n var inhalt = {\n \"dayOfWeek\": n.dayOfWeek,\n \"setpoint\": n.setpoint,\n \"time\": n.time, \n \"zeit\": timeHH + \":\" + timeMM\n }\n\n if (n.dayOfWeek == \"Mo\")\n Mo.push(inhalt) \n if (n.dayOfWeek == \"Tu\")\n Tu.push(inhalt)\n if (n.dayOfWeek == \"We\") \n We.push(inhalt)\n if (n.dayOfWeek == \"Th\")\n Th.push(inhalt)\n if (n.dayOfWeek == \"Fr\")\n Fr.push(inhalt)\n if (n.dayOfWeek == \"Sa\")\n Sa.push(inhalt)\n if (n.dayOfWeek == \"Su\")\n Su.push(inhalt)\n})\n\nWeek.push({\n \"Mo\": Mo,\n \"Tu\": Tu,\n \"We\": We,\n \"Th\": Th, \n \"Fr\": Fr,\n \"Sa\": Sa,\n \"Su\": Su, \n})\n\nreturn [ \n { Data: Mo },\n { Data: Tu }, \n { Data: We }, \n { Data: Th }, \n { Data: Fr }, \n { Data: Sa }, \n { Data: Su }, \n { Data: Week }\n ];","outputs":8,"noerr":0,"initialize":"","finalize":"","libs":[],"x":850,"y":120,"wires":[["eb5b352c30153c20"],[],[],[],[],[],["c8f6a82418e33793"],["dd2c80f8a061a6f7"]]},{"id":"432ddfb11f3bab4a","type":"comment","z":"d838b487d73a043b","name":"Ausgabe der Programme nach Tagen","info":"","x":850,"y":40,"wires":[]},{"id":"467b268b95fa4e9c","type":"inject","z":"d838b487d73a043b","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":100,"y":120,"wires":[["1e9bdf58af557a76"]]},{"id":"8132fdf457b8716c","type":"comment","z":"d838b487d73a043b","name":"IoBroker Datenpunkt switchPrograms.?","info":"","x":330,"y":80,"wires":[]},{"id":"dd2c80f8a061a6f7","type":"debug","z":"d838b487d73a043b","name":"msg.Data (Woche)","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"Data","targetType":"msg","statusVal":"","statusType":"auto","x":1130,"y":180,"wires":[]},{"id":"68cc99075a593cf0","type":"function","z":"d838b487d73a043b","name":"msg.payload.TableLines","func":"var days = ['Mo','Tu','We','Th','Fr','Sa','Su'];\nvar possible_times = [0, 15, 30, 45, 60, 75, 90, 105, 120, 135, 150, 165, 180, 195, 210, 225, 240, 255, 270, 285, 300, 315, 330, 345, 360, 375, 390, 405, 420, 435, 450, 465, 480, 495, 510, 525, 540, 555, 570, 585, 600, 615, 630, 645, 660, 675, 690, 705, 720, 735, 750, 765, 780, 795, 810, 825, 840, 855, 870, 885, 900, 915, 930, 945, 960, 975, 990, 1005, 1020, 1035, 1050, 1065, 1080, 1095, 1110, 1125, 1140, 1155, 1170, 1185, 1200, 1215, 1230, 1245, 1260, 1275, 1290, 1305, 1320, 1335, 1350, 1365, 1380, 1395, 1410,1425]\nvar woche_zeilen = '';\n\ndays.forEach(function (actual_day) {\n \n var tag_spalten = '';\n var bgcolor = '';\n var i = 0;\n possible_times.forEach(function (minuten) {\n if(i > 3)i = 0\n if(i == 0)bgcolor = 'bgcolor=\"grey\"'\n\n tag_spalten += '<td class=\"checkbox_color\" valign=\"bottom\" ' + bgcolor + '><input type=\"checkbox\" name=\"' + actual_day + '[]\" value=\"' + minuten + '\"></td>';\n bgcolor = ''\n i++\n \n });\n var tag_zeile = '<tr><th align=\"left\">' + actual_day + '</th>' + tag_spalten + '</tr>';\n woche_zeilen += tag_zeile;\n});\n\nmsg.payload.TableLines = woche_zeilen;\nreturn msg;\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":710,"y":360,"wires":[["97dc905525f2ab56"]]},{"id":"95f290e946f0b169","type":"debug","z":"d838b487d73a043b","name":"msg.Data (Woche) ORIGINAL","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"Data","targetType":"msg","statusVal":"","statusType":"auto","x":770,"y":200,"wires":[]},{"id":"c8f6a82418e33793","type":"debug","z":"d838b487d73a043b","name":"msg.Data (Sonntag)","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"Data","targetType":"msg","statusVal":"","statusType":"auto","x":1140,"y":140,"wires":[]},{"id":"eb5b352c30153c20","type":"debug","z":"d838b487d73a043b","name":"msg.Data (Montag)","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"Data","targetType":"msg","statusVal":"","statusType":"auto","x":1130,"y":80,"wires":[]}]
- Die Daten von der Heizung splitten in einzelne Tage und lesbare Zeit integrieren: