dockerized_openAger/nodered/rootfs/data/flows.json

1 line
200 KiB
JSON
Executable File

[{"id":"bfb0b9c4.4e1408","type":"tab","label":"OpenAger","disabled":false,"info":""},{"id":"efbc7696.354458","type":"subflow","name":"DashBoard","info":"","in":[],"out":[{"x":1440,"y":260,"wires":[]},{"x":240,"y":20,"wires":[]}]},{"id":"2a3766ff.038c4a","type":"subflow","name":"Aging_6W","info":"","in":[{"x":80,"y":240,"wires":[{"id":"83d0caf4.339f28"}]}],"out":[{"x":1540,"y":440,"wires":[{"id":"2f44d915.2e19c6","port":0},{"id":"800fdb5d.0a1af8","port":0},{"id":"44cde4f9.bd9cfc","port":0},{"id":"e55f99e0.2bc5d8","port":0},{"id":"e6cefa25.cfff58","port":0},{"id":"306cd77d.bbba98","port":0},{"id":"9f261ee6.5b263","port":0},{"id":"44d4c8e1.05fdd8","port":0},{"id":"6c532696.285458","port":0},{"id":"e82ecb2d.55bb88","port":0},{"id":"7147e8ca.46bc78","port":0}]}]},{"id":"acee58da.9b1998","type":"subflow","name":"Aging_8W","info":"","in":[{"x":60,"y":140,"wires":[{"id":"c7c4b82f.246598"}]}],"out":[{"x":1280,"y":520,"wires":[{"id":"51c2a2b3.38cdbc","port":0},{"id":"eff7a6a6.8cbb28","port":0},{"id":"58b08142.347cc","port":0},{"id":"623f070f.357158","port":0},{"id":"51fd7786.ea91a8","port":0},{"id":"e7458a57.feafc8","port":0},{"id":"c8290c74.3e776","port":0},{"id":"ec8f26eb.d2cdc8","port":0},{"id":"f8b84854.7649d8","port":0},{"id":"9a11a6af.29eed8","port":0},{"id":"639f7dec.426074","port":0},{"id":"817febc.bfb5e18","port":0},{"id":"752bd367.59bf2c","port":0}]}]},{"id":"533bb4f2.f3493c","type":"subflow","name":"Manuell","info":"","in":[{"x":40,"y":40,"wires":[{"id":"54c5a54e.1eacfc"}]}],"out":[{"x":500,"y":40,"wires":[{"id":"54c5a54e.1eacfc","port":0}]}]},{"id":"58f7dc96.300d44","type":"subflow","name":"Speck","info":"","in":[{"x":60,"y":240,"wires":[{"id":"d520ea5b.d49528"}]}],"out":[{"x":1420,"y":620,"wires":[{"id":"91004e06.de7ed","port":0},{"id":"30ce3567.ea8ffa","port":0},{"id":"517246ed.ac6eb8","port":0},{"id":"41a8dd64.285414","port":0},{"id":"ad0cba22.186628","port":0}]}]},{"id":"14f8e14b.f5db7f","type":"subflow","name":"Override","info":"","in":[{"x":50,"y":30,"wires":[]}],"out":[]},{"id":"37fce5bb.18d03a","type":"subflow","name":"Test_6W","info":"","in":[{"x":80,"y":280,"wires":[{"id":"18b1ebc6.2bf6b4"}]}],"out":[{"x":1760,"y":500,"wires":[{"id":"ecf2c17f.474c5","port":0},{"id":"7941a271.22490c","port":0},{"id":"44463589.dd5e2c","port":0},{"id":"61af5b93.e11b34","port":0},{"id":"2d22ebe9.1c64e4","port":0},{"id":"5b5c3114.9cbbb","port":0},{"id":"b5670245.b7064","port":0},{"id":"aa815c3f.d8875","port":0},{"id":"7468fdad.ecbb94","port":0},{"id":"e4218595.e63ab8","port":0},{"id":"98cff5a3.9b1638","port":0}]}]},{"id":"f44824d.57101d8","type":"subflow","name":"Bruno 7 Wochen","info":"","in":[{"x":100,"y":160,"wires":[{"id":"685589b6.4e19f8"}]}],"out":[{"x":1280,"y":220,"wires":[{"id":"d0b0bdae.3dab5","port":0},{"id":"600b186b.af6308","port":0},{"id":"f2d99b09.d996c8","port":0}]}]},{"id":"91eb6541.4fd558","type":"subflow","name":"Salami","info":"","in":[{"x":100,"y":220,"wires":[{"id":"e385f317.1fcff"}]}],"out":[{"x":1500,"y":600,"wires":[{"id":"6909a133.33f36","port":0},{"id":"296c01be.065d5e","port":0},{"id":"200ab38a.5967ac","port":0},{"id":"cc6c20e.f7015e","port":0},{"id":"50abe31.dcee21c","port":0},{"id":"d58a6b46.3973a8","port":0},{"id":"5a155601.4317c8","port":0},{"id":"32bac649.37809a","port":0},{"id":"7c55c812.c8f168","port":0},{"id":"8c3eeb7c.5ca1b8","port":0},{"id":"87be4386.86e6d","port":0}]}]},{"id":"abcf932e.43e39","type":"subflow","name":"Scales Dashboard","info":"","in":[],"out":[]},{"id":"53ff1e9.5b961e","type":"subflow","name":"Desinfection","info":"","in":[],"out":[]},{"id":"4d0dc15f.1a937","type":"subflow","name":"Save to SQL","info":"","in":[{"x":40,"y":140,"wires":[{"id":"5184119d.393e"}]}],"out":[]},{"id":"13f2ae94.2080c1","type":"tls-config","z":"","name":"","cert":"","key":"","ca":"","certname":"","keyname":"","caname":"","servername":"","verifyservercert":false},{"id":"4841307a.c2f52","type":"mqtt-broker","z":"","name":"iot.valki.com","broker":"iot.valki.com","port":"1883","tls":"13f2ae94.2080c1","clientid":"openager_valki","usetls":false,"compatmode":true,"keepalive":"15","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closePayload":"","willTopic":"","willQos":"0","willPayload":""},{"id":"ca61f135.42042","type":"ui_group","z":"","name":"openAger","tab":"646e27f9.71dba8","order":2,"disp":true,"width":"6","collapse":false},{"id":"452932b5.62f74c","type":"ui_tab","z":"","name":"Charts","icon":"dashboard","order":4},{"id":"bffb08b3.1b1fa8","type":"ui_group","z":"efbc7696.354458","name":"Home","tab":"646e27f9.71dba8","order":3,"disp":true,"width":"6","collapse":false},{"id":"43f2495e.96eb28","type":"ui_group","z":"efbc7696.354458","name":"Special","tab":"9955a5f0.c78318","order":5,"disp":true,"width":"6","collapse":false},{"id":"9955a5f0.c78318","type":"ui_tab","z":"","name":"Gauges","icon":"dashboard","order":3},{"id":"91134a7a.5c7bb8","type":"ui_group","z":"","name":"Scale 1","tab":"fbd1baaf.5443c8","order":1,"disp":true,"width":"6","collapse":false},{"id":"2d255ce.e9e82a4","type":"ui_group","z":"efbc7696.354458","name":"Special","tab":"452932b5.62f74c","order":3,"disp":true,"width":"6","collapse":false},{"id":"b7af05c9.acc5c8","type":"ui_group","z":"","name":"Temperatures","tab":"9955a5f0.c78318","order":2,"disp":true,"width":"6","collapse":false},{"id":"c1fcc324.6a01","type":"ui_group","z":"","name":"Internal","tab":"452932b5.62f74c","order":1,"disp":true,"width":"6","collapse":false},{"id":"fbd1baaf.5443c8","type":"ui_tab","z":"","name":"Scales","icon":"dashboard","order":5},{"id":"88d811d7.ca6bf","type":"ui_group","z":"","name":"Scale Calibration","tab":"5f57f062.9dde8","order":5,"disp":true,"width":"6","collapse":false},{"id":"66bacdef.786e04","type":"MySQLdatabase","z":"","host":"db.valki.com","port":"3306","db":"nodered","tz":""},{"id":"f95bc692.43b5a8","type":"ui_group","z":"","name":"Report","tab":"df5027dd.7517b8","order":2,"disp":false,"width":"24"},{"id":"3ead58e1.865bd8","type":"ui_group","z":"","name":"Filters","tab":"df5027dd.7517b8","disp":true,"width":"24"},{"id":"df5027dd.7517b8","type":"ui_tab","z":"","name":"Report","icon":"event_note","order":7},{"id":"e7c3e799.f86b28","type":"ui_group","z":"","name":"Scale 2","tab":"fbd1baaf.5443c8","order":3,"disp":true,"width":"6","collapse":false},{"id":"5f57f062.9dde8","type":"ui_tab","z":"","name":"Configuration","icon":"dashboard","order":6},{"id":"b09a98a.6139868","type":"ui_group","z":"","name":"Modes","tab":"5f57f062.9dde8","order":4,"disp":true,"width":"6","collapse":false},{"id":"77fea715.4f11c8","type":"ui_group","z":"","name":"Humidity","tab":"9955a5f0.c78318","order":3,"disp":true,"width":"6","collapse":false},{"id":"39b2ec86.601ea4","type":"ui_group","z":"","name":"Scale 3","tab":"fbd1baaf.5443c8","order":3,"disp":true,"width":"6","collapse":false},{"id":"fbe9ae29.de1a7","type":"ui_group","z":"","name":"Scale 4","tab":"fbd1baaf.5443c8","order":4,"disp":true,"width":"6","collapse":false},{"id":"cc0499bb.626ad8","type":"ui_group","z":"","name":"Humidity 2","tab":"9955a5f0.c78318","order":4,"disp":true,"width":"6","collapse":false},{"id":"d02bb676.9c8768","type":"ui_group","z":"","name":"Sensors","tab":"5f57f062.9dde8","order":1,"disp":true,"width":"6","collapse":false},{"id":"4b96690f.894e08","type":"ui_group","z":"","name":"Misc","tab":"5f57f062.9dde8","order":3,"disp":true,"width":"6","collapse":false},{"id":"a7c01b2c.6f7df8","type":"ui_group","z":"","name":"Lights","tab":"5f57f062.9dde8","order":2,"disp":true,"width":"6","collapse":false},{"id":"418bab59.fac9d4","type":"ui_group","z":"","name":"Temp/Hum","tab":"5f57f062.9dde8","order":6,"disp":true,"width":"6","collapse":false},{"id":"37137413.a3425c","type":"ui_group","z":"","name":"Environment","tab":"452932b5.62f74c","order":4,"disp":true,"width":"6","collapse":false},{"id":"df011129.4ebef","type":"ui_group","z":"","name":"External","tab":"452932b5.62f74c","order":2,"disp":true,"width":"6","collapse":false},{"id":"d54ee9a0.347778","type":"ui_group","z":"","name":"Timings","tab":"9955a5f0.c78318","order":6,"disp":true,"width":"6","collapse":false},{"id":"ec3e3b54.4a8598","type":"telegrambot-config","z":"","botname":"openager_bot","usernames":"","chatIds":"","pollInterval":"300"},{"id":"646e27f9.71dba8","type":"ui_tab","z":"","name":"Home","icon":"dashboard","order":1,"disabled":false,"hidden":false},{"id":"801bafd8.09a2","type":"ui_group","z":"","name":"Settings","tab":"646e27f9.71dba8","order":4,"disp":true,"width":"6","collapse":false},{"id":"63a78f03.20929","type":"ui_group","z":"","name":"Sensors","tab":"646e27f9.71dba8","order":1,"disp":true,"width":"6","collapse":false},{"id":"7ec0c1dc.cf4b3","type":"influxdb","z":"efbc7696.354458","hostname":"influxdb.valki.com","port":"8086","protocol":"http","database":"openAger","name":"","usetls":true,"tls":"13f2ae94.2080c1"},{"id":"eba91e98.1456e","type":"influxdb","z":"b061b303.4f9e5","hostname":"127.0.0.1","port":"8086","database":"aTimeSeries","name":"aTimeSeries"},{"id":"e76331b.fcbf9d","type":"ui_base","theme":{"name":"theme-dark","lightTheme":{"default":"#0094CE","baseColor":"#0094CE","baseFont":"-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif","edited":true,"reset":false},"darkTheme":{"default":"#097479","baseColor":"#097479","baseFont":"-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif","edited":true,"reset":false},"customTheme":{"name":"Untitled Theme 1","default":"#4B7930","baseColor":"#4B7930","baseFont":"-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif"},"themeState":{"base-color":{"default":"#097479","value":"#097479","edited":false},"page-titlebar-backgroundColor":{"value":"#097479","edited":false},"page-backgroundColor":{"value":"#111111","edited":false},"page-sidebar-backgroundColor":{"value":"#000000","edited":false},"group-textColor":{"value":"#0eb8c0","edited":false},"group-borderColor":{"value":"#555555","edited":false},"group-backgroundColor":{"value":"#333333","edited":false},"widget-textColor":{"value":"#eeeeee","edited":false},"widget-backgroundColor":{"value":"#097479","edited":false},"widget-borderColor":{"value":"#333333","edited":false},"base-font":{"value":"-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif"}},"angularTheme":{"primary":"indigo","accents":"blue","warn":"red","background":"grey"}},"site":{"name":"Node-RED Dashboard","hideToolbar":"false","allowSwipe":"false","lockMenu":"false","allowTempTheme":"true","dateFormat":"DD/MM/YYYY","sizes":{"sx":48,"sy":48,"gx":6,"gy":6,"cx":6,"cy":6,"px":0,"py":0}}},{"id":"110b89b3.3d8416","type":"comment","z":"efbc7696.354458","name":"Dashboard","info":"","x":100,"y":20,"wires":[]},{"id":"d70b1d6f.845c5","type":"comment","z":"2a3766ff.038c4a","name":"Aging Programm 6 Wochen","info":"","x":180,"y":120,"wires":[]},{"id":"cc4f87dc.b00118","type":"mqtt out","z":"efbc7696.354458","name":"fridge1 retain","topic":"","qos":"","retain":"true","broker":"4841307a.c2f52","x":1470,"y":720,"wires":[]},{"id":"44ff4d33.5a1554","type":"ui_switch","z":"efbc7696.354458","name":"","label":"Light","group":"bffb08b3.1b1fa8","order":8,"width":0,"height":0,"passthru":false,"decouple":"true","topic":"openAger/fridge1/actuators/light","style":"","onvalue":"1","onvalueType":"str","onicon":"","oncolor":"","offvalue":"0","offvalueType":"str","officon":"","offcolor":"","x":790,"y":140,"wires":[["635e9835.fd2ab8"]]},{"id":"3b69da02.2a8c56","type":"ui_slider","z":"efbc7696.354458","name":"set temp","label":"Set Temp","tooltip":"","group":"801bafd8.09a2","order":3,"width":0,"height":0,"passthru":false,"outs":"all","topic":"openAger/fridge1/set/temp","min":0,"max":"30","step":"0.1","x":800,"y":480,"wires":[["cc4f87dc.b00118"]]},{"id":"ed29ff62.3ba3f","type":"ui_slider","z":"efbc7696.354458","name":"sethyst","label":"Set Hysterese","tooltip":"","group":"801bafd8.09a2","order":7,"width":0,"height":0,"passthru":false,"outs":"all","topic":"openAger/fridge1/set/hyst","min":0,"max":"4","step":"0.1","x":800,"y":560,"wires":[["cc4f87dc.b00118"]]},{"id":"9f09a0d0.110b4","type":"ui_slider","z":"efbc7696.354458","name":"sethum","label":"Set Humidity","tooltip":"","group":"801bafd8.09a2","order":4,"width":0,"height":0,"passthru":false,"outs":"all","topic":"openAger/fridge1/set/hum","min":"30","max":"100","step":1,"x":800,"y":520,"wires":[["cc4f87dc.b00118"]]},{"id":"41d2d4c5.91712c","type":"ui_slider","z":"efbc7696.354458","name":"humhyst","label":"Set Humidity Hysterese","tooltip":"","group":"801bafd8.09a2","order":8,"width":0,"height":0,"passthru":false,"outs":"all","topic":"openAger/fridge1/set/humhyst","min":0,"max":"30","step":".1","x":800,"y":600,"wires":[["cc4f87dc.b00118"]]},{"id":"45ac43ce.9c400c","type":"ui_gauge","z":"efbc7696.354458","name":"H_Temp_int","group":"63a78f03.20929","order":1,"width":"0","height":"0","gtype":"gage","title":"Temperature int.","label":"°C","format":"{{value | number:2}}","min":"-5","max":"30","colors":["#00b500","#e6e600","#ca3838"],"seg1":"4","seg2":"10","x":1070,"y":2380,"wires":[]},{"id":"4218e5f4.24faac","type":"ui_gauge","z":"efbc7696.354458","name":"set temp","group":"801bafd8.09a2","order":1,"width":"3","height":"3","gtype":"gage","title":"Set Temp","label":"°C","format":"{{value}}","min":"-5","max":"35","colors":["#00b500","#e6e600","#ca3838"],"seg1":"4","seg2":"10","x":1440,"y":900,"wires":[]},{"id":"f8d90005.32e08","type":"ui_gauge","z":"efbc7696.354458","name":"Hysterese","group":"801bafd8.09a2","order":5,"width":"3","height":"3","gtype":"gage","title":"Hysterese","label":"K","format":"{{value}}","min":0,"max":10,"colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":1440,"y":980,"wires":[]},{"id":"78aa9286.fc652c","type":"ui_gauge","z":"efbc7696.354458","name":"set hum","group":"801bafd8.09a2","order":2,"width":"3","height":"3","gtype":"gage","title":"Set Humidity","label":"%","format":"{{value |number:1 }}","min":0,"max":"100","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":1440,"y":940,"wires":[]},{"id":"11e69b78.e74665","type":"ui_gauge","z":"efbc7696.354458","name":"","group":"801bafd8.09a2","order":6,"width":"3","height":"3","gtype":"gage","title":"Set Hum Hysterese","label":"%","format":"{{value}}","min":0,"max":"20","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":1470,"y":1020,"wires":[]},{"id":"2ad62b2f.bc7a94","type":"ui_chart","z":"efbc7696.354458","name":"C_Temp_int","group":"c1fcc324.6a01","order":1,"width":0,"height":0,"label":"Temperature","chartType":"line","legend":"false","xformat":"HH:mm:ss","interpolate":"bezier","nodata":"loading","dot":false,"ymin":"","ymax":"30","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":true,"outputs":2,"x":1530,"y":2380,"wires":[[],[]]},{"id":"9a56849b.6b7838","type":"ui_dropdown","z":"efbc7696.354458","name":"mode","label":"Mode","tooltip":"","place":"","group":"ca61f135.42042","order":2,"width":0,"height":0,"passthru":false,"options":[{"label":"manual","value":"0","type":"str"},{"label":"Aging_6W","value":"1","type":"str"},{"label":"Aging_8W","value":"2","type":"str"},{"label":"Salami","value":"3","type":"str"},{"label":"Speck","value":"4","type":"str"},{"label":"Desinfection","value":"90","type":"str"},{"label":"Bruno 7 Wochen","value":"97","type":"str"},{"label":"Test 6W","value":"98","type":"str"},{"label":"Override","value":"99","type":"str"}],"payload":"","topic":"openAger/fridge1/set/mode","x":790,"y":960,"wires":[["cc4f87dc.b00118"]]},{"id":"4c14ee01.fc641","type":"ui_switch","z":"efbc7696.354458","name":"UVC","label":"UVC","group":"bffb08b3.1b1fa8","order":7,"width":0,"height":0,"passthru":false,"decouple":"false","topic":"openAger/fridge1/actuators/uvc","style":"","onvalue":"1","onvalueType":"str","onicon":"","oncolor":"","offvalue":"0","offvalueType":"str","officon":"","offcolor":"","x":790,"y":100,"wires":[["635e9835.fd2ab8"]]},{"id":"38bab156.ad305e","type":"ui_switch","z":"efbc7696.354458","name":"booster","label":"Booster","group":"bffb08b3.1b1fa8","order":3,"width":0,"height":0,"passthru":false,"decouple":"true","topic":"openAger/fridge1/actuators/booster","style":"","onvalue":"1","onvalueType":"str","onicon":"","oncolor":"","offvalue":"0","offvalueType":"str","officon":"","offcolor":"","x":800,"y":180,"wires":[["635e9835.fd2ab8"]]},{"id":"230fafe8.b6f3a","type":"ui_switch","z":"efbc7696.354458","name":"Circu","label":"Circulation","group":"bffb08b3.1b1fa8","order":4,"width":0,"height":0,"passthru":false,"decouple":"true","topic":"openAger/fridge1/actuators/circulation","style":"","onvalue":"1","onvalueType":"str","onicon":"","oncolor":"","offvalue":"0","offvalueType":"str","officon":"","offcolor":"","x":790,"y":220,"wires":[["635e9835.fd2ab8"]]},{"id":"c7f7b411.d8af98","type":"ui_switch","z":"efbc7696.354458","name":"Cool","label":"Cooling","group":"bffb08b3.1b1fa8","order":1,"width":0,"height":0,"passthru":false,"decouple":"true","topic":"openAger/fridge1/actuators/cooling","style":"","onvalue":"1","onvalueType":"str","onicon":"","oncolor":"","offvalue":"0","offvalueType":"str","officon":"","offcolor":"","x":790,"y":260,"wires":[["635e9835.fd2ab8"]]},{"id":"25d7eee4.ffda22","type":"ui_switch","z":"efbc7696.354458","name":"","label":"Heating","group":"bffb08b3.1b1fa8","order":2,"width":0,"height":0,"passthru":false,"decouple":"true","topic":"openAger/fridge1/actuators/heating","style":"","onvalue":"1","onvalueType":"str","onicon":"","oncolor":"","offvalue":"0","offvalueType":"str","officon":"","offcolor":"","x":800,"y":300,"wires":[["635e9835.fd2ab8"]]},{"id":"d6eab50f.39ab68","type":"ui_switch","z":"efbc7696.354458","name":"moist","label":"Moistening","group":"bffb08b3.1b1fa8","order":5,"width":0,"height":0,"passthru":false,"decouple":"true","topic":"openAger/fridge1/actuators/moistening","style":"","onvalue":"1","onvalueType":"str","onicon":"","oncolor":"","offvalue":"0","offvalueType":"str","officon":"","offcolor":"","x":790,"y":340,"wires":[["635e9835.fd2ab8"]]},{"id":"9f8ef02.e1ba51","type":"ui_switch","z":"efbc7696.354458","name":"dry","label":"Drying","group":"bffb08b3.1b1fa8","order":6,"width":0,"height":0,"passthru":false,"decouple":"true","topic":"openAger/fridge1/actuators/drying","style":"","onvalue":"1","onvalueType":"str","onicon":"","oncolor":"","offvalue":"0","offvalueType":"str","officon":"","offcolor":"","x":790,"y":380,"wires":[["635e9835.fd2ab8"]]},{"id":"511b0d14.dfe9f4","type":"ui_gauge","z":"efbc7696.354458","name":"H_Hum_int","group":"63a78f03.20929","order":2,"width":"0","height":"0","gtype":"gage","title":"Humidity int.","label":"%","format":"{{value | number:2}}","min":0,"max":"100","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":1070,"y":2680,"wires":[]},{"id":"946012c2.726e3","type":"function","z":"bfb0b9c4.4e1408","name":"Set Global","func":"// restore last state from dump\n\n\nglobal.set(\"startzeit\",msg.payload.startzeit);\nglobal.set(\"mode\",msg.payload.mode);\nglobal.set(\"state\",msg.payload.state);\n\n//msg.payload = msg.startzeit;\n//return msg;","outputs":1,"noerr":0,"x":870,"y":180,"wires":[["54fd06cf.5ad438"]]},{"id":"54fd06cf.5ad438","type":"debug","z":"bfb0b9c4.4e1408","name":"Debug","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":1230,"y":180,"wires":[]},{"id":"9e8c5afb.d57288","type":"inject","z":"bfb0b9c4.4e1408","name":"Trigger 10 sek","repeat":"10","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":140,"y":740,"wires":[["d71ad172.f9505","828e3bd3.a6a5a8"]]},{"id":"9c2297af.3d2028","type":"switch","z":"2a3766ff.038c4a","name":"Scheduler","property":"runtime","propertyType":"msg","rules":[{"t":"btwn","v":"0","vt":"jsonata","v2":"1000*60*60*24*12","v2t":"jsonata"},{"t":"btwn","v":"1000*60*60*24*12","vt":"jsonata","v2":"1000*60*60*24*21","v2t":"jsonata"},{"t":"btwn","v":"1000*60*60*24*21","vt":"jsonata","v2":"1000*60*60*24*30","v2t":"jsonata"},{"t":"btwn","v":"1000*60*60*24*30","vt":"jsonata","v2":"1000*60*60*24*39","v2t":"jsonata"},{"t":"btwn","v":"1000*60*60*24*39","vt":"jsonata","v2":"1000*60*60*24*48","v2t":"jsonata"},{"t":"gt","v":"1000*60*60*24*48","vt":"jsonata"}],"checkall":"true","repair":false,"outputs":6,"x":580,"y":240,"wires":[["59e7f43c.26a0dc"],["84829baa.ad9368"],["47b03e53.7a075"],["cb6f0c0f.613ce"],["262866c5.e512fa"],["2f44d915.2e19c6"]]},{"id":"2f44d915.2e19c6","type":"function","z":"2a3766ff.038c4a","name":"Finished!","func":" /*\nData format:\n\nmsg.startzeit = timestamp\nmsg.mode = mode\nmsg.state = state\nmsg.runtime\nmsg.restzeit\nmsg.phase\n\n*/\n global.set(\"state\",\"off\");\n global.set(\"mode\", 0);\n\tglobal.set(\"startzeit\",0);\n\tmsg.state = \"off\";\n\tmsg.mode = '0';\n\tmsg.finito = '1';\n return msg;\n\n","outputs":1,"noerr":0,"x":840,"y":440,"wires":[[]]},{"id":"50f1400b.f5a62","type":"subflow:efbc7696.354458","z":"bfb0b9c4.4e1408","name":"Dashboard","env":[],"x":860,"y":60,"wires":[["54fd06cf.5ad438"],[]]},{"id":"6dc5f58d.dc582c","type":"comment","z":"bfb0b9c4.4e1408","name":"Autostarter+ recover state","info":"","x":170,"y":80,"wires":[]},{"id":"6fa49634.bf0518","type":"switch","z":"bfb0b9c4.4e1408","name":"Mode?","property":"mode","propertyType":"msg","rules":[{"t":"eq","v":"0","vt":"str"},{"t":"eq","v":"1","vt":"str"},{"t":"eq","v":"2","vt":"str"},{"t":"eq","v":"3","vt":"str"},{"t":"eq","v":"4","vt":"str"},{"t":"eq","v":"90","vt":"str"},{"t":"eq","v":"97","vt":"str"},{"t":"eq","v":"98","vt":"str"},{"t":"eq","v":"99","vt":"str"}],"checkall":"true","repair":false,"outputs":9,"x":530,"y":760,"wires":[["166d8f60.9f9d81"],["d37d4323.2440d"],["85012ca1.75c3d"],["377eaa0c.2fa036"],["ed6a56a8.a73d28"],["3a6261c6.832a5e"],["31401bfa.904924"],["dd7a5bbd.8f9bf8"],["22e44764.17b538"]]},{"id":"d37d4323.2440d","type":"subflow:2a3766ff.038c4a","z":"bfb0b9c4.4e1408","name":"Aging_6W","x":750,"y":700,"wires":[["f3079c9f.ee374"]]},{"id":"ef94c2f6.af0e9","type":"function","z":"acee58da.9b1998","name":"Day 1-12","func":"msg.phase = \"Phase 1\";\nreturn msg;","outputs":1,"noerr":0,"x":820,"y":60,"wires":[["752bd367.59bf2c","817febc.bfb5e18"]]},{"id":"7e79120e.fbc2fc","type":"function","z":"acee58da.9b1998","name":"Day 13-21","func":"msg.phase = \"Phase 2\";\nreturn msg;","outputs":1,"noerr":0,"x":830,"y":140,"wires":[["639f7dec.426074","9a11a6af.29eed8"]]},{"id":"81e16629.03f858","type":"function","z":"acee58da.9b1998","name":"Day 22-34","func":"msg.phase = \"Phase 3\";\nreturn msg;","outputs":1,"noerr":0,"x":830,"y":220,"wires":[["f8b84854.7649d8","ec8f26eb.d2cdc8"]]},{"id":"5b17f770.afa448","type":"function","z":"acee58da.9b1998","name":"Day 35-43","func":"msg.phase = \"Phase 4\";\nreturn msg;","outputs":1,"noerr":0,"x":830,"y":300,"wires":[["e7458a57.feafc8","c8290c74.3e776"]]},{"id":"6d1eed66.0f95c4","type":"function","z":"acee58da.9b1998","name":"Day 44-56","func":"msg.payload = \"Phase 5\";\nreturn msg;","outputs":1,"noerr":0,"x":830,"y":380,"wires":[["623f070f.357158","51fd7786.ea91a8"]]},{"id":"b63aff0f.ca2b7","type":"comment","z":"acee58da.9b1998","name":"Aging Programm 6 Wochen","info":"","x":160,"y":40,"wires":[]},{"id":"ead52de1.975f4","type":"function","z":"acee58da.9b1998","name":"Day 57-75","func":"msg.phase = \"Phase 6: Eat!\";\nreturn msg;","outputs":1,"noerr":0,"x":830,"y":460,"wires":[["58b08142.347cc","eff7a6a6.8cbb28"]]},{"id":"58b08142.347cc","type":"function","z":"acee58da.9b1998","name":"H=30","func":"msg.topic = 'openAger/fridge1/set/hum';\nmsg.payload = '30';\nreturn msg;","outputs":1,"noerr":0,"x":1030,"y":440,"wires":[[]]},{"id":"85012ca1.75c3d","type":"subflow:acee58da.9b1998","z":"bfb0b9c4.4e1408","x":750,"y":740,"wires":[["f3079c9f.ee374"]]},{"id":"166d8f60.9f9d81","type":"subflow:533bb4f2.f3493c","z":"bfb0b9c4.4e1408","name":"","x":740,"y":660,"wires":[["f3079c9f.ee374"]]},{"id":"ed6a56a8.a73d28","type":"subflow:58f7dc96.300d44","z":"bfb0b9c4.4e1408","name":"","x":730,"y":820,"wires":[[]]},{"id":"22e44764.17b538","type":"subflow:14f8e14b.f5db7f","z":"bfb0b9c4.4e1408","x":740,"y":940,"wires":[]},{"id":"9aff2532.c06098","type":"function","z":"efbc7696.354458","name":"set global ","func":"//context.global.mode = msg.payload;\nglobal.set(\"mode\",msg.payload);\nreturn msg;","outputs":1,"noerr":0,"x":800,"y":1040,"wires":[["20e1ad86.d09692"]]},{"id":"20e1ad86.d09692","type":"ui_text","z":"efbc7696.354458","group":"bffb08b3.1b1fa8","order":9,"width":0,"height":0,"name":"","label":"MCU Mode","format":"{{msg.payload}}","layout":"row-spread","x":1450,"y":1140,"wires":[]},{"id":"d71ad172.f9505","type":"function","z":"bfb0b9c4.4e1408","name":"inject global mode","func":"/*\nData format:\n\nmsg.startzeit = timestamp\nmsg.mode = mode\nmsg.state = state\n*/\n\nmsg.startzeit = global.get(\"startzeit\");\nmsg.state = global.get(\"state\");\nmsg.mode = global.get(\"mode\");\n\nmsg.payload = global.get(\"mode\");\nreturn msg;\n","outputs":1,"noerr":0,"x":350,"y":760,"wires":[["6fa49634.bf0518"]]},{"id":"8a1f239.4522be","type":"ui_gauge","z":"efbc7696.354458","name":"G_uvrays","group":"43f2495e.96eb28","order":4,"width":0,"height":0,"gtype":"gage","title":"UVRays","label":"mW/cm²","format":"{{value | number:2}}","min":0,"max":10,"colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":1300,"y":3100,"wires":[]},{"id":"a15a8a1f.5ab588","type":"ui_gauge","z":"efbc7696.354458","name":"G_power","group":"43f2495e.96eb28","order":1,"width":0,"height":0,"gtype":"gage","title":"Power","label":"W","format":"{{value | number:1}}","min":0,"max":"200","colors":["#00b500","#e6e600","#ca3838"],"seg1":"80","seg2":"130","x":1300,"y":2940,"wires":[]},{"id":"be87177a.c89728","type":"ui_gauge","z":"efbc7696.354458","name":"G_tvoc","group":"43f2495e.96eb28","order":2,"width":0,"height":0,"gtype":"gage","title":"TVOC","label":"ppm","format":"{{value | number:2}}","min":0,"max":"1187","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":1060,"y":3820,"wires":[]},{"id":"2b02c3d5.4949ac","type":"ui_gauge","z":"efbc7696.354458","name":"weight1","group":"91134a7a.5c7bb8","order":5,"width":0,"height":0,"gtype":"gage","title":"Weight 1","label":"kg","format":"{{value | number:3}}","min":0,"max":"15","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":860,"y":3220,"wires":[]},{"id":"8f4cb609.d1e538","type":"ui_gauge","z":"efbc7696.354458","name":"weight2","group":"e7c3e799.f86b28","order":5,"width":0,"height":0,"gtype":"gage","title":"Weight 2","label":"kg","format":"{{value | number:3}}","min":0,"max":"15","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":860,"y":3260,"wires":[]},{"id":"a9f3c698.e073b8","type":"ui_gauge","z":"efbc7696.354458","name":"weight3","group":"39b2ec86.601ea4","order":5,"width":0,"height":0,"gtype":"gage","title":"Weight 3","label":"kg","format":"{{value | number:3}}","min":0,"max":"15","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":860,"y":3300,"wires":[]},{"id":"2b75b5a3.77d1fa","type":"ui_gauge","z":"efbc7696.354458","name":"weight4","group":"fbe9ae29.de1a7","order":5,"width":0,"height":0,"gtype":"gage","title":"Weight 4","label":"kg","format":"{{value | number:3}}","min":0,"max":"15","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":860,"y":3340,"wires":[]},{"id":"c0a8ffef.f2a05","type":"ui_gauge","z":"efbc7696.354458","name":"H_Hum ext","group":"63a78f03.20929","order":5,"width":"3","height":"3","gtype":"gage","title":"Humidity ext.","label":"%","format":"{{value | number:2}}","min":0,"max":"100","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":1070,"y":2720,"wires":[]},{"id":"373a1b57.b38ea4","type":"ui_gauge","z":"efbc7696.354458","name":"H_Temp_ext","group":"63a78f03.20929","order":4,"width":"3","height":"3","gtype":"gage","title":"Temperature ext.","label":"°C","format":"{{value | number:2}}","min":"-5","max":"30","colors":["#00b500","#e6e600","#ca3838"],"seg1":"20","seg2":"25","x":1070,"y":2420,"wires":[]},{"id":"2d296cb8.5e0894","type":"ui_chart","z":"efbc7696.354458","name":"C_tvoc","group":"37137413.a3425c","order":2,"width":0,"height":0,"label":"TVOC","chartType":"line","legend":"false","xformat":"HH:mm:ss","interpolate":"bezier","nodata":"","dot":false,"ymin":"","ymax":"","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":false,"outputs":2,"x":1500,"y":3820,"wires":[[],[]]},{"id":"17cd9975.d9d427","type":"ui_chart","z":"efbc7696.354458","name":"C_Power","group":"2d255ce.e9e82a4","order":1,"width":0,"height":0,"label":"Power","chartType":"line","legend":"false","xformat":"HH:mm:ss","interpolate":"bezier","nodata":"","dot":false,"ymin":"0","ymax":"200","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":false,"outputs":2,"x":1520,"y":2940,"wires":[[],[]]},{"id":"c00a6bf5.83a728","type":"ui_chart","z":"efbc7696.354458","name":"C_UV Rays","group":"37137413.a3425c","order":1,"width":0,"height":0,"label":"UV Rays","chartType":"line","legend":"false","xformat":"HH:mm:ss","interpolate":"bezier","nodata":"","dot":false,"ymin":"0","ymax":"10","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":false,"outputs":2,"x":1530,"y":3100,"wires":[[],[]]},{"id":"b18c1df6.cdfb8","type":"ui_chart","z":"efbc7696.354458","name":"C_Humidity int.","group":"c1fcc324.6a01","order":2,"width":0,"height":0,"label":"Humidity int.","chartType":"line","legend":"false","xformat":"HH:mm:ss","interpolate":"bezier","nodata":"","dot":false,"ymin":"","ymax":"","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":false,"outputs":2,"x":1540,"y":2680,"wires":[[],[]]},{"id":"131a219.892ccde","type":"ui_chart","z":"efbc7696.354458","name":"C_temp-ext","group":"df011129.4ebef","order":1,"width":0,"height":0,"label":"Temperature ext.","chartType":"line","legend":"false","xformat":"HH:mm:ss","interpolate":"bezier","nodata":"","dot":false,"ymin":"","ymax":"","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":false,"outputs":2,"x":1530,"y":2420,"wires":[[],[]]},{"id":"2a4ea03d.abf04","type":"ui_chart","z":"efbc7696.354458","name":"C_hum ext","group":"df011129.4ebef","order":2,"width":0,"height":0,"label":"Humidity ext.","chartType":"line","legend":"false","xformat":"HH:mm:ss","interpolate":"bezier","nodata":"","dot":false,"ymin":"","ymax":"","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":false,"outputs":2,"x":1530,"y":2720,"wires":[[],[]]},{"id":"cd8f46cc.d124e8","type":"ui_gauge","z":"efbc7696.354458","name":"G_Hum1","group":"77fea715.4f11c8","order":2,"width":0,"height":0,"gtype":"gage","title":"Humidity 1","label":"%","format":"{{value | number:2}}","min":0,"max":"100","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":1300,"y":2600,"wires":[]},{"id":"c3c278b3.2f25d8","type":"ui_gauge","z":"efbc7696.354458","name":"G_Hum2","group":"77fea715.4f11c8","order":3,"width":0,"height":0,"gtype":"gage","title":"Humidity 2","label":"%","format":"{{value | number:2}}","min":0,"max":"100","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":1300,"y":2640,"wires":[]},{"id":"49b35de3.332724","type":"ui_gauge","z":"efbc7696.354458","name":"G_Temp1","group":"b7af05c9.acc5c8","order":2,"width":0,"height":0,"gtype":"gage","title":"Temperature 1","label":"°C","format":"{{value | number:2}}","min":"-5","max":"30","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":1300,"y":2300,"wires":[],"inputLabels":["msg.t1"]},{"id":"a4157f54.9d5e5","type":"ui_gauge","z":"efbc7696.354458","name":"G_Temp2","group":"b7af05c9.acc5c8","order":3,"width":0,"height":0,"gtype":"gage","title":"Temperature 2","label":"°C","format":"{{value | number:2}}","min":"-5","max":"30","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":1300,"y":2340,"wires":[]},{"id":"9347bbcd.f19e38","type":"comment","z":"efbc7696.354458","name":"Gauges & Charts","info":"","x":140,"y":2200,"wires":[]},{"id":"1b9fd252.b6b39e","type":"comment","z":"efbc7696.354458","name":"Actuators","info":"","x":160,"y":120,"wires":[]},{"id":"f4ca98fc.dbbfd8","type":"comment","z":"efbc7696.354458","name":"<-- Output for debugging","info":"","x":1590,"y":260,"wires":[]},{"id":"7e43bddd.269404","type":"ui_button","z":"bfb0b9c4.4e1408","name":"","group":"ca61f135.42042","order":1,"width":0,"height":0,"passthru":false,"label":"Start","color":"","bgcolor":"","icon":"fa-play","payload":"","payloadType":"date","topic":"","x":170,"y":420,"wires":[["8da8c72d.d8b498"]]},{"id":"52fea353.d681dc","type":"ui_button","z":"bfb0b9c4.4e1408","name":"","group":"ca61f135.42042","order":8,"width":0,"height":0,"passthru":false,"label":"Stop","color":"","bgcolor":"darkred","icon":"fa-stop","payload":"STOP","payloadType":"str","topic":"","x":170,"y":460,"wires":[["8da8c72d.d8b498"]]},{"id":"8da8c72d.d8b498","type":"function","z":"bfb0b9c4.4e1408","name":"Set Global","func":"/*\nData format:\n\nmsg.startzeit = timestamp\nmsg.mode = mode\nmsg.state = state\n*/\n\nmsg2 = {}\n\nif (msg.payload == 'STOP' || global.get(\"mode\") == '0' || global.get(\"mode\") == '99') { \n\tglobal.set(\"state\",\"off\");\n\tglobal.set(\"startzeit\",0);\n\tmsg.startzeit = 0;\n\tmsg.state = \"off\";\n\n} else {\n\tglobal.set(\"state\",\"on\");\n\tglobal.set(\"startzeit\",msg.payload);\n\tmsg.startzeit = msg.payload;\n\tmsg.state = \"on\";\n}\nmsg.mode = global.get(\"mode\");\n\n// 2nd output - prepare javascript object for the dump\nmsg2.startzeit = msg.payload;\nmsg2.state = msg.state;\nmsg2.mode = msg.mode;\n\nmsg2.payload = {\n \"startzeit\": msg.payload,\n \"state\": msg.state,\n \"mode\": msg.mode\n}\n\nreturn [ msg, msg2 ];","outputs":2,"noerr":0,"x":430,"y":440,"wires":[["f3079c9f.ee374"],["47e34441.9c3e2c"]]},{"id":"e979e920.53bda8","type":"comment","z":"bfb0b9c4.4e1408","name":"Dashbutton-Trigger","info":"","x":130,"y":360,"wires":[]},{"id":"ab96af90.37534","type":"ui_text","z":"bfb0b9c4.4e1408","group":"ca61f135.42042","order":6,"width":0,"height":0,"name":"","label":"remaining time","format":"{{ msg.restzeit | number:1 }} Tage","layout":"row-spread","x":1880,"y":500,"wires":[]},{"id":"4fd9bd56.ff4f94","type":"ui_text","z":"bfb0b9c4.4e1408","group":"ca61f135.42042","order":3,"width":0,"height":0,"name":"","label":"Automatic ON/OFF","format":"{{msg.state}}","layout":"row-spread","x":1870,"y":340,"wires":[]},{"id":"f3079c9f.ee374","type":"function","z":"bfb0b9c4.4e1408","name":"collect","func":"return msg;","outputs":1,"noerr":0,"x":1150,"y":440,"wires":[["4fd9bd56.ff4f94","64cf8401.bdbabc","51be4eb1.0f324","5df2b7fa.54c378","4df5369a.1a0c88"]]},{"id":"87915ea3.04e8b","type":"comment","z":"bfb0b9c4.4e1408","name":"Mode-Manager / Programs","info":"","x":150,"y":620,"wires":[]},{"id":"50896bc6.b26544","type":"ui_text_input","z":"efbc7696.354458","name":"Set Scale1","label":"Set Scale1","group":"88d811d7.ca6bf","order":2,"width":0,"height":0,"passthru":false,"mode":"text","delay":"0","topic":"openAger/fridge1/set/scale1","x":810,"y":800,"wires":[["9c8d165.2f9aae8"]]},{"id":"fb5d33e9.72d9","type":"ui_text_input","z":"efbc7696.354458","name":"Set Scale2","label":"Set Scale2","group":"88d811d7.ca6bf","order":3,"width":0,"height":0,"passthru":false,"mode":"text","delay":"0","topic":"openAger/fridge1/set/scale2","x":810,"y":840,"wires":[["9c8d165.2f9aae8"]]},{"id":"33e4bb5b.6815f4","type":"ui_text_input","z":"efbc7696.354458","name":"Set Scale3","label":"Set Scale3","group":"88d811d7.ca6bf","order":4,"width":0,"height":0,"passthru":false,"mode":"text","delay":"0","topic":"openAger/fridge1/set/scale3","x":810,"y":880,"wires":[["9c8d165.2f9aae8"]]},{"id":"2f750627.bbee7a","type":"ui_text_input","z":"efbc7696.354458","name":"Set Scale4","label":"Set Scale4","group":"88d811d7.ca6bf","order":5,"width":0,"height":0,"passthru":false,"mode":"text","delay":"0","topic":"openAger/fridge1/set/scale4","x":810,"y":920,"wires":[["9c8d165.2f9aae8"]]},{"id":"ddd5c874.b71988","type":"ui_button","z":"efbc7696.354458","name":"R Scale 1","group":"91134a7a.5c7bb8","order":4,"width":0,"height":0,"passthru":false,"label":"Reset Scale 1","tooltip":"","color":"","bgcolor":"","icon":"fa-balance-scale","payload":"1","payloadType":"str","topic":"openAger/fridge1/set/reset_scale1","x":1120,"y":1180,"wires":[["9c8d165.2f9aae8"]]},{"id":"41e066a7.9118d8","type":"ui_button","z":"efbc7696.354458","name":"R Scale 2","group":"e7c3e799.f86b28","order":4,"width":0,"height":0,"passthru":false,"label":"Reset Scale 2","tooltip":"","color":"","bgcolor":"","icon":"fa-balance-scale","payload":"1","payloadType":"str","topic":"openAger/fridge1/set/reset_scale2","x":1120,"y":1220,"wires":[["9c8d165.2f9aae8"]]},{"id":"b4af0b11.2436d8","type":"ui_button","z":"efbc7696.354458","name":"R Scale 3","group":"39b2ec86.601ea4","order":4,"width":0,"height":0,"passthru":false,"label":"Reset Scale 3","tooltip":"","color":"","bgcolor":"","icon":"fa-balance-scale","payload":"1","payloadType":"str","topic":"openAger/fridge1/set/reset_scale3","x":1120,"y":1260,"wires":[["9c8d165.2f9aae8"]]},{"id":"9992e5b2.fd2e28","type":"ui_button","z":"efbc7696.354458","name":"R Scale 4","group":"fbe9ae29.de1a7","order":4,"width":0,"height":0,"passthru":false,"label":"Reset Scale 4","tooltip":"","color":"","bgcolor":"","icon":"fa-balance-scale","payload":"1","payloadType":"str","topic":"openAger/fridge1/set/reset_scale4","x":1120,"y":1300,"wires":[["9c8d165.2f9aae8"]]},{"id":"983c428e.8b466","type":"mqtt in","z":"efbc7696.354458","name":"MQTT fridge1 set","topic":"openAger/fridge1/set/#","qos":"0","datatype":"auto","broker":"4841307a.c2f52","x":120,"y":1140,"wires":[["ee4c0d06.51314"]]},{"id":"ee4c0d06.51314","type":"switch","z":"efbc7696.354458","name":"Topic Switch","property":"topic","propertyType":"msg","rules":[{"t":"eq","v":"openAger/fridge1/set/temp","vt":"str"},{"t":"eq","v":"openAger/fridge1/set/hum","vt":"str"},{"t":"eq","v":"openAger/fridge1/set/hyst","vt":"str"},{"t":"eq","v":"openAger/fridge1/set/humhyst","vt":"str"},{"t":"eq","v":"openAger/fridge1/set/scale1","vt":"str"},{"t":"eq","v":"openAger/fridge1/set/scale2","vt":"str"},{"t":"eq","v":"openAger/fridge1/set/scale3","vt":"str"},{"t":"eq","v":"openAger/fridge1/set/scale4","vt":"str"},{"t":"eq","v":"openAger/fridge1/set/mode","vt":"str"},{"t":"eq","v":"openAger/fridge1/set/pwm","vt":"str"},{"t":"eq","v":"openAger/fridge1/set/boostermode","vt":"str"},{"t":"eq","v":"openAger/fridge1/set/circmode","vt":"str"},{"t":"eq","v":"openAger/fridge1/set/uvcmode","vt":"str"},{"t":"eq","v":"openAger/fridge1/set/boostertime","vt":"str"},{"t":"eq","v":"openAger/fridge1/set/boosterdelay","vt":"str"},{"t":"eq","v":"openAger/fridge1/set/circtime","vt":"str"},{"t":"eq","v":"openAger/fridge1/set/circdelay","vt":"str"},{"t":"eq","v":"openAger/fridge1/set/uvctime","vt":"str"},{"t":"eq","v":"openAger/fridge1/set/uvcdelay","vt":"str"},{"t":"eq","v":"openAger/fridge1/set/offsetscale1","vt":"str"},{"t":"eq","v":"openAger/fridge1/set/offsetscale2","vt":"str"},{"t":"eq","v":"openAger/fridge1/set/offsetscale3","vt":"str"},{"t":"eq","v":"openAger/fridge1/set/offsetscale4","vt":"str"},{"t":"eq","v":"openAger/fridge1/set/hummode","vt":"str"},{"t":"eq","v":"openAger/fridge1/set/nosyscheck","vt":"str"},{"t":"eq","v":"openAger/fridge1/set/sensor1","vt":"str"},{"t":"eq","v":"openAger/fridge1/set/sensor2","vt":"str"},{"t":"eq","v":"openAger/fridge1/set/sensore","vt":"str"},{"t":"eq","v":"openAger/fridge1/set/sensors","vt":"str"},{"t":"eq","v":"openAger/fridge1/set/coolerpower","vt":"str"},{"t":"eq","v":"openAger/fridge1/set/dual","vt":"str"},{"t":"eq","v":"openAger/fridge1/set/checktempdiff","vt":"str"},{"t":"eq","v":"openAger/fridge1/set/checkhumdiff","vt":"str"},{"t":"eq","v":"openAger/fridge1/set/ticksensors","vt":"str"},{"t":"eq","v":"openAger/fridge1/set/tickdisplay","vt":"str"},{"t":"eq","v":"openAger/fridge1/set/tickbackup","vt":"str"},{"t":"eq","v":"openAger/fridge1/set/tickscales","vt":"str"},{"t":"eq","v":"openAger/fridge1/set/coolerprotect","vt":"str"},{"t":"eq","v":"openAger/fridge1/set/tempmode","vt":"str"},{"t":"eq","v":"openAger/fridge1/set/ticksmqtt","vt":"str"}],"checkall":"true","repair":false,"outputs":40,"x":410,"y":1140,"wires":[["3b69da02.2a8c56","4218e5f4.24faac","7a44634.a053b9c","c8ea63dc.bc596","7d5d4556.41763c"],["78aa9286.fc652c","9f09a0d0.110b4","7a44634.a053b9c","249a3f19.efaa"],["ed29ff62.3ba3f","f8d90005.32e08","7d5d4556.41763c","dc895bc9.fdbfa8"],["41d2d4c5.91712c","acc94eaa.07e33","11e69b78.e74665"],["50896bc6.b26544"],["fb5d33e9.72d9"],["33e4bb5b.6815f4"],["2f750627.bbee7a"],["9aff2532.c06098","9a56849b.6b7838","7a44634.a053b9c"],["183b8d0d.3a29e3","23ba67be.a5d9d8","27de2d0a.1b0592"],["19a79b09.1588c5"],["91390d9c.8ff5a"],["dc276f69.90845"],["f3c2cb7e.53c6c8"],["affcf431.36e318"],["1db9b832.0002b8"],["38a153f5.7c7f9c"],["4dabe6d1.d31cd8"],["9c478f69.f701b"],["ae7a659.b683398"],["65b69f35.ab8f2"],["c75d1b4f.176008"],["52a4f621.204418"],["7fd02ae3.5d6c04"],["3faa98a3.993de8"],["edf083fc.7d1b8"],["d50e4db3.15ecd"],["607273a8.9c951c"],["53772786.6328a8"],["22972139.d2695e"],["cc1a68a4.59d4b8"],["9de9b0b7.13693"],["4d4fcc0f.c63174"],["ba2b3ad5.603118"],["669dd524.8c12ec"],["f18d605a.86367"],["82f5582c.485868"],["237496a0.f5b9fa"],["c3cb49b0.bb7bf8"],["b26ea238.5357f"]]},{"id":"8ea0f6d1.cd8ce8","type":"comment","z":"efbc7696.354458","name":"Settings","info":"","x":100,"y":940,"wires":[]},{"id":"aa9d6130.48f1e","type":"mqtt in","z":"efbc7696.354458","name":"MQTT fridge1 actuators","topic":"openAger/fridge1/actuators/#","qos":"0","datatype":"auto","broker":"4841307a.c2f52","x":200,"y":240,"wires":[["32f8319.525dbce","8d590abd.42ee38"]]},{"id":"32f8319.525dbce","type":"switch","z":"efbc7696.354458","name":"Topic Switch","property":"topic","propertyType":"msg","rules":[{"t":"eq","v":"openAger/fridge1/actuators/uvc","vt":"str"},{"t":"eq","v":"openAger/fridge1/actuators/light","vt":"str"},{"t":"eq","v":"openAger/fridge1/actuators/booster","vt":"str"},{"t":"eq","v":"openAger/fridge1/actuators/circulation","vt":"str"},{"t":"eq","v":"openAger/fridge1/actuators/cooling","vt":"str"},{"t":"eq","v":"openAger/fridge1/actuators/heating","vt":"str"},{"t":"eq","v":"openAger/fridge1/actuators/moistening","vt":"str"},{"t":"eq","v":"openAger/fridge1/actuators/drying","vt":"str"},{"t":"eq","v":"openAger/fridge1/actuators/lock","vt":"str"}],"checkall":"true","repair":false,"outputs":9,"x":450,"y":240,"wires":[["4c14ee01.fc641"],["44ff4d33.5a1554"],["38bab156.ad305e"],["230fafe8.b6f3a"],["c7f7b411.d8af98"],["25d7eee4.ffda22"],["d6eab50f.39ab68"],["9f8ef02.e1ba51"],["ccca855e.acde78"]]},{"id":"3afe691f.2aaec6","type":"comment","z":"bfb0b9c4.4e1408","name":"Data aggregation","info":"Below example extract max, min and last from the\nsensor log table, and inserts them into an\naggregate table.","x":140,"y":1120,"wires":[]},{"id":"33a427ab.92a7d8","type":"inject","z":"bfb0b9c4.4e1408","name":"","repeat":"","crontab":"00 03 * * *","once":false,"onceDelay":"","topic":"","payload":"","payloadType":"date","x":110,"y":1240,"wires":[["de9afdd1.a2b1","b291f1f6.00087","4a12d552.491ffc","1e38d249.4393fe"]]},{"id":"de9afdd1.a2b1","type":"function","z":"bfb0b9c4.4e1408","name":"Get Max values","func":"var d = new Date();\nvar epoch = d.getTime();\n// Go to previous day\nd.setTime(d.getTime()-(24*60*60*1000));\n// calculate begining of the day\nd.setHours(0);\nd.setMinutes(0);\nd.setSeconds(0);\nd.setMilliseconds(0);\nvar fromdate = d.getTime();\n// calculate end of the day\nd.setHours(23);\nd.setMinutes(59);\nd.setSeconds(59);\nd.setMilliseconds(999);\nvar enddate = d.getTime();\n\n//msg.topic = \"SELECT device,sensor,max(value) AS value FROM sensor_data WHERE epoch >= \" + fromdate + \" AND epoch <= \" + enddate + \" AND (sensor='openAger/fridge1/sensors/temp_int' or sensor='openAger/fridge1/sensors/hum_int' or sensor='openAger/fridge1/sensors/weight1') GROUP BY sensor\";\nmsg.topic = \"SELECT device,sensor,max(value) AS value FROM sensor_data WHERE epoch >= \" + fromdate + \" AND epoch <= \" + enddate + \" GROUP BY sensor\";\nreturn msg;","outputs":1,"noerr":0,"x":340,"y":1240,"wires":[["e44bf53e.a3ac98"]]},{"id":"b291f1f6.00087","type":"function","z":"bfb0b9c4.4e1408","name":"Get Min values","func":"var d = new Date();\nvar epoch = d.getTime();\n// Go to previous day\nd.setTime(d.getTime()-(24*60*60*1000));\n// calculate begining of the day\nd.setHours(0);\nd.setMinutes(0);\nd.setSeconds(0);\nd.setMilliseconds(0);\nvar fromdate = d.getTime();\n// calculate end of the day\nd.setHours(23);\nd.setMinutes(59);\nd.setSeconds(59);\nd.setMilliseconds(999);\nvar enddate = d.getTime();\n\n//msg.topic = \"SELECT device,sensor,MIN(value) as value FROM sensor_data WHERE epoch >= \" + fromdate + \" AND epoch <= \" + enddate + \" AND (sensor='temp' OR sensor='battery') GROUP BY sensor\";\nmsg.topic = \"SELECT device,sensor,MIN(value) as value FROM sensor_data WHERE epoch >= \" + fromdate + \" AND epoch <= \" + enddate + \" GROUP BY sensor\";\nreturn msg;","outputs":1,"noerr":0,"x":340,"y":1300,"wires":[["fa839892.2b0328"]]},{"id":"4a12d552.491ffc","type":"function","z":"bfb0b9c4.4e1408","name":"Get Last values","func":"var output = [];\nvar d = new Date();\nvar epoch = d.getTime();\n// Go to previous day\nd.setTime(d.getTime()-(24*60*60*1000));\n// calculate begining of the day\nd.setHours(0);\nd.setMinutes(0);\nd.setSeconds(0);\nd.setMilliseconds(0);\nvar fromdate = d.getTime();\n// calculate end of the day\nd.setHours(23);\nd.setMinutes(59);\nd.setSeconds(59);\nd.setMilliseconds(999);\nvar enddate = d.getTime();\n\n//output.push({ topic:\"SELECT device,sensor,value FROM sensor_data WHERE epoch >= \" + fromdate + \" AND epoch <= \" + enddate + \" AND device='growatt' AND sensor='today' ORDER BY id DESC LIMIT 1 \" });\n//output.push({ topic:\"SELECT device,sensor,value FROM sensor_data WHERE epoch >= \" + fromdate + \" AND epoch <= \" + enddate + \" AND device='miflora' AND sensor='moisture' ORDER BY id DESC LIMIT 1 \" });\n\nreturn [output];","outputs":1,"noerr":0,"x":340,"y":1360,"wires":[["ee8c3fb.6f8e2c"]]},{"id":"7a3e6d4f.9596d4","type":"function","z":"bfb0b9c4.4e1408","name":"SQL Updates","func":"var output = [];\nvar d = new Date();\nvar epoch = d.getTime();\n// Go to previous day\nd.setTime(d.getTime()-(24*60*60*1000));\n// calculate begining of the day\nd.setHours(0);\nd.setMinutes(0);\nd.setSeconds(0);\nd.setMilliseconds(0);\nvar fromdate = d.getTime();\n if (!msg.payload[i].sensor.includes(\"openAger/fridge1/actuators\")){\n msg.topic = \"REPLACE INTO sensor_aggr (epoch,device,sensor,value) VALUES(\"+fromdate+\",'\"+msg.payload[0].device+\"','\"+msg.payload[0].sensor+\"',\"+msg.payload[0].value+\")\";\n }\nreturn msg;","outputs":1,"noerr":0,"x":700,"y":1360,"wires":[["b19c7a54.3365f8"]]},{"id":"193d16b7.a55009","type":"function","z":"bfb0b9c4.4e1408","name":"SQL Updates","func":"var output = [];\nvar d = new Date();\nvar epoch = d.getTime();\n// Go to previous day\nd.setTime(d.getTime()-(24*60*60*1000));\n// calculate begining of the day\nd.setHours(0);\nd.setMinutes(0);\nd.setSeconds(0);\nd.setMilliseconds(0);\nvar fromdate = d.getTime();\n\nfor (var i=0; i<msg.payload.length; i++) {\n \n if (!msg.payload[i].sensor.includes(\"openAger/fridge1/actuators\")){\n \n output.push({ topic:\"REPLACE INTO sensor_aggr (epoch,device,sensor,value) VALUES (\"+fromdate+\",'\"+msg.payload[i].device+\"','\"+msg.payload[i].sensor+\"_max',\"+msg.payload[i].value+\")\" });\n }\n}\n\nreturn [output];","outputs":1,"noerr":0,"x":700,"y":1240,"wires":[["b19c7a54.3365f8"]]},{"id":"aefc941f.1484b8","type":"function","z":"bfb0b9c4.4e1408","name":"SQL Updates","func":"var output = [];\nvar d = new Date();\nvar epoch = d.getTime();\n// Go to previous day\nd.setTime(d.getTime()-(24*60*60*1000));\n// calculate begining of the day\nd.setHours(0);\nd.setMinutes(0);\nd.setSeconds(0);\nd.setMilliseconds(0);\nvar fromdate = d.getTime();\n\nfor (var i=0; i<msg.payload.length; i++) {\n if (!msg.payload[i].sensor.includes(\"openAger/fridge1/actuators\")){\n output.push({ topic:\"REPLACE INTO sensor_aggr (epoch,device,sensor,value) VALUES(\"+fromdate+\",'\"+msg.payload[i].device+\"','\"+msg.payload[i].sensor+\"_min',\"+msg.payload[i].value+\")\" });\n }\n}\n\nreturn [output];","outputs":1,"noerr":0,"x":700,"y":1300,"wires":[["b19c7a54.3365f8"]]},{"id":"93f4fdd8.68e61","type":"comment","z":"bfb0b9c4.4e1408","name":"Calculate aggregated values (min,max,last)","info":"","x":424.3333282470703,"y":1169.0000476837158,"wires":[]},{"id":"af3044a5.8d2bc8","type":"comment","z":"bfb0b9c4.4e1408","name":"Insert aggregated values to new table","info":"","x":790,"y":1180,"wires":[]},{"id":"b19c7a54.3365f8","type":"mysql","z":"bfb0b9c4.4e1408","mydb":"66bacdef.786e04","name":"","x":920,"y":1420,"wires":[[]]},{"id":"e44bf53e.a3ac98","type":"mysql","z":"bfb0b9c4.4e1408","mydb":"66bacdef.786e04","name":"","x":520,"y":1240,"wires":[["193d16b7.a55009"]]},{"id":"fa839892.2b0328","type":"mysql","z":"bfb0b9c4.4e1408","mydb":"66bacdef.786e04","name":"","x":500,"y":1300,"wires":[["aefc941f.1484b8"]]},{"id":"ee8c3fb.6f8e2c","type":"mysql","z":"bfb0b9c4.4e1408","mydb":"66bacdef.786e04","name":"","x":500,"y":1360,"wires":[["7a3e6d4f.9596d4"]]},{"id":"d37ea009.d0b04","type":"function","z":"bfb0b9c4.4e1408","name":"SQL","func":"// This will handle any device and any attribute as long as it is in the DB\nvar p_30d = 1000*60*60*24*30 ; //30 Days\nvar p_60d = 1000*60*60*24*60 ; //30 Days\nvar p_90d = 1000*60*60*24*90 ; //30 Days\nvar p_7d = 1000*60*60*24*7 ; //7 Days\nvar p_1d = 1000*60*60*24 ; // 1 Day\nvar p_1h = 1000*60*60; // 1 hour\nvar p_6h = 1000*60*60*6; // 6 hour\nvar d = new Date();\nvar current = d.getTime();\nvar today0h = d.setHours(0,0,0,0);\nvar day = d.getDay();\nvar monday0h = today0h - (day + (day === 0 ? -6:1)) * p_1d;\nvar fromdate = 0;\nvar enddate = 0;\nvar sql = [];\nvar sourcelist = [];\nvar aggrlist = [];\nvar title = \"\";\n\n\n// Get the period and the list of data sources \n// also set some default values if one or the other does not exist yet\nsourcelist = context.get(\"sourcelist\");\nif (sourcelist===undefined) { // if running for the first time\n sourcelist = [];\n}\naggrlist = context.get(\"aggrlist\");\nif (aggrlist===undefined) { // if running for the first time\n aggrlist = [];\n}\nfromdate = context.get(\"fromdate\");\nif (fromdate===undefined) {\n // set the period to a default if it is not selected yet\n fromdate = current-p_1d;\n}\nenddate = context.get(\"enddate\");\nif (enddate===undefined) {\n // set the period to a default if it is not selected yet\n enddate = current;\n}\n\nswitch(msg.topic) {\n case \"period\":\n switch(msg.payload) {\n case \"last1h\":\n fromdate = current-p_1h;\n enddate = current;\n break;\n case \"last6h\":\n fromdate = current-p_6h;\n enddate = current;\n break;\n case \"today\":\n fromdate = today0h;\n enddate = today0h+p_1d;\n break;\n case \"yesterday\":\n fromdate = today0h-p_1d;\n enddate = today0h;\n break;\n case \"thisweek\":\n fromdate = monday0h;\n enddate = monday0h+p_7d;\n break;\n case \"lastweek\":\n fromdate = monday0h-p_7d;\n enddate = monday0h;\n break;\n case \"last24h\":\n fromdate = current-p_1d;\n enddate = current;\n break;\n case \"last7d\":\n fromdate = current-p_7d;\n enddate = current;\n break;\n case \"last30d\":\n fromdate = current-p_30d;\n enddate = current;\n break;\n case \"last60d\":\n fromdate = current-p_60d;\n enddate = current;\n break;\n case \"last90d\":\n fromdate = current-p_90d;\n enddate = current;\n break;\n }\n context.set(\"fromdate\",fromdate);\n context.set(\"enddate\",enddate);\n break;\n case \"datasource\":\n if (msg.payload===\"delete\") {\n // remove all previous data sources\n sourcelist = [];\n } else {\n sourcelist = context.get(\"sourcelist\");\n if (sourcelist===undefined) { // if running for the first time\n sourcelist = [];\n }\n sourcelist.push(msg.payload);\n }\n context.set(\"sourcelist\",sourcelist);\n break;\n case \"aggrsource\":\n if (msg.payload===\"delete\") {\n // remove all previous data sources\n aggrlist = [];\n } else {\n aggrlist = context.get(\"aggrlist\");\n if (aggrlist===undefined) { // if running for the first time\n aggrlist = [];\n }\n aggrlist.push(msg.payload);\n }\n context.set(\"aggrlist\",aggrlist);\n break;\n case \"minus1w\":\n fromdate = fromdate-p_7d;\n enddate = enddate-p_7d;\n context.set(\"fromdate\",fromdate);\n context.set(\"enddate\",enddate);\n break;\n case \"plus1w\":\n fromdate = fromdate+p_7d;\n enddate = enddate+p_7d;\n context.set(\"fromdate\",fromdate);\n context.set(\"enddate\",enddate);\n break;\n case \"minus1d\":\n fromdate = fromdate-p_1d;\n enddate = enddate-p_1d;\n context.set(\"fromdate\",fromdate);\n context.set(\"enddate\",enddate);\n break;\n case \"plus1d\":\n fromdate = fromdate+p_1d;\n enddate = enddate+p_1d;\n context.set(\"fromdate\",fromdate);\n context.set(\"enddate\",enddate);\n break;\n case \"minus1h\":\n fromdate = fromdate-p_1h;\n enddate = enddate-p_1h;\n context.set(\"fromdate\",fromdate);\n context.set(\"enddate\",enddate);\n break;\n case \"plus1h\":\n fromdate = fromdate+p_1h;\n enddate = enddate+p_1h;\n context.set(\"fromdate\",fromdate);\n context.set(\"enddate\",enddate);\n break;\n}\n\n\n// Regenerate the SQL statements\n// Run through the data source list an generate the SQL statements\nsql = [];\n//node.warn(sourcelist);\nif (sourcelist.length>0) {\n for (var i = 0; i < sourcelist.length; i++) {\n var parts = sourcelist[i].split(\"|\");\n // sql.push({ topic: \"SELECT * FROM sensor_data WHERE device='fridge1' AND sensor='\"+parts[0]+\"' AND epoch >= \" + fromdate + \" AND epoch <= \" + enddate });\n sql.push({ topic: \"SELECT * FROM sensor_data WHERE device='fridge1' AND sensor='\"+sourcelist[i]+\"' AND epoch >= \" + fromdate + \" AND epoch <= \" + enddate });\n \n \n }\n} \n//node.warn(aggrlist);\nif (aggrlist.length>0) {\n for (var i = 0; i < aggrlist.length; i++) {\n var parts = aggrlist[i].split(\"|\");\n sql.push({ topic: \"SELECT * FROM sensor_aggr WHERE device='fridge1' AND sensor='\"+aggrlist[i]+\"' AND epoch >= \" + fromdate + \" AND epoch <= \" + enddate });\n }\n} \nif (sql.length===0) { \n // Dummy select that returns nothing to clear the chart\n sql.push({ topic: \"SELECT * FROM sensor_data WHERE device='xxxx'\" });\n}\n\n// set the completed flag for the join node later\nsql[sql.length-1].complete=true;\n// pass along the email flag to redirect the flow later\nif (msg.topic===\"email\") {\n sql[sql.length-1].email=true;\n}\n\n// Generate report title\nif (sourcelist.length===0 && aggrlist.length===0) {\n title = \"No data source\";\n} else {\n if (sourcelist.length!==0) {\n //title = title + sourcelist.toString()+ \", \";\n }\n if (aggrlist.length!==0) {\n // title = title + aggrlist.toString()+ \", \";\n }\n title = title.substring(0,title.length-2);\n title = title + \"openAger | \";\n\n var d = new Date();\n d.setTime(fromdate);\n var yyyy = d.getFullYear();\n var mm = d.getMonth() < 9 ? \"0\" + (d.getMonth() + 1) : (d.getMonth() + 1); // getMonth() is zero-based\n var dd = d.getDate() < 10 ? \"0\" + d.getDate() : d.getDate();\n var hh = d.getHours() < 10 ? \"0\" + d.getHours() : d.getHours();\n var mmm = d.getMinutes() < 10 ? \"0\" + d.getMinutes() : d.getMinutes();\n var ss = d.getSeconds() < 10 ? \"0\" + d.getSeconds() : d.getSeconds();\n title = title + dd + \".\" + mm + \".\" + yyyy;\n d.setTime(enddate);\n yyyy = d.getFullYear();\n mm = d.getMonth() < 9 ? \"0\" + (d.getMonth() + 1) : (d.getMonth() + 1); // getMonth() is zero-based\n dd = d.getDate() < 10 ? \"0\" + d.getDate() : d.getDate();\n hh = d.getHours() < 10 ? \"0\" + d.getHours() : d.getHours();\n mmm = d.getMinutes() < 10 ? \"0\" + d.getMinutes() : d.getMinutes();\n ss = d.getSeconds() < 10 ? \"0\" + d.getSeconds() : d.getSeconds();\n title = title + \" - \" + dd + \".\" + mm + \".\" + yyyy;\n}\nsql[sql.length-1].title=title;\n\nreturn [ sql ];\n\n","outputs":1,"noerr":0,"x":870,"y":1760,"wires":[["22af8439.69d7fc"]]},{"id":"3c7ee058.18837","type":"ui_chart","z":"bfb0b9c4.4e1408","name":"Chart","group":"f95bc692.43b5a8","order":2,"width":0,"height":0,"label":"","chartType":"line","legend":"false","xformat":"dd HH:mm","interpolate":"linear","nodata":"","ymin":"","ymax":"","removeOlder":"1","removeOlderPoints":"","removeOlderUnit":"604800","cutout":"","colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"outputs":2,"x":1525.6666946411133,"y":1799.249948501587,"wires":[[],[]]},{"id":"c6674c41.5189c","type":"function","z":"bfb0b9c4.4e1408","name":"Chart Prep","func":"var msg2 = [];\n\nif (msg.payload[0].length>0) {\n // this is the logic when there are multiple data sets are received\n for (var i=0; i<msg.payload.length; i++) {\n var output = [];\n for (var j=0; j<msg.payload[i].length; j++) {\n output.push([msg.payload[i][j].epoch, msg.payload[i][j].value]);\n }\n msg2.push({ key: msg.payload[i][0].device+\"/\"+msg.payload[i][0].sensor, values : output});\n //msg2.push({ key: \"test\", values : output});\n }\n} \n\nmsg.payload=msg2;\n//msg.payload = [ { key: \"Power\", values : output} ];\n//msg.topic = \"Power\";\nreturn msg;","outputs":1,"noerr":0,"x":1352.8334121704102,"y":1799.5833225250244,"wires":[["3c7ee058.18837"]]},{"id":"80f56def.407d2","type":"inject","z":"bfb0b9c4.4e1408","name":"Reset chart","repeat":"","crontab":"","once":false,"topic":"","payload":"","payloadType":"date","x":1050.7499923706055,"y":1857.0000095367432,"wires":[["cf1d0022.1ae71"]]},{"id":"cf1d0022.1ae71","type":"function","z":"bfb0b9c4.4e1408","name":"Empty payload","func":"msg.payload = [];\nreturn msg;","outputs":1,"noerr":0,"x":1298.6666641235352,"y":1856.3333234786987,"wires":[["3c7ee058.18837"]]},{"id":"9f5f8653.72f9e8","type":"join","z":"bfb0b9c4.4e1408","name":"","mode":"custom","build":"array","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","timeout":"","count":"","x":1163,"y":1760,"wires":[["a7306ee9.016df","c6674c41.5189c"]]},{"id":"e5bb9d4e.ecf6","type":"ui_dropdown","z":"bfb0b9c4.4e1408","name":"Data source","label":"","tooltip":"","place":"","group":"3ead58e1.865bd8","order":1,"width":"5","height":"1","passthru":false,"options":[{"label":"[Remove all]","value":"delete","type":"str"},{"label":"Temp Int","value":"temp_int","type":"str"},{"label":"Temp 1","value":"temp_1","type":"str"},{"label":"Temp 2","value":"temp_2","type":"str"},{"label":"Temp Ext","value":"temp_ext","type":"str"},{"label":"Temp CoolingPlate","value":"TempCoolingPlate","type":"str"},{"label":"Set Temp","value":"openAger/fridge1/set/temp","type":"str"},{"label":"Temp_Dev","value":"temp_dev","type":"str"},{"label":"Dewpoint","value":"dewpoint","type":"str"},{"label":"Hum Int","value":"hum_int","type":"str"},{"label":"Average Humidity","value":"average humidity int","type":"str"},{"label":"Hum 1","value":"hum_1","type":"str"},{"label":"Hum 2","value":"hum_2","type":"str"},{"label":"aHum_Int","value":"hum_absolut","type":"str"},{"label":"Hum Ext","value":"hum_ext","type":"str"},{"label":"Hum CoolingPlate","value":"HumCoolingPlate","type":"str"},{"label":"Set Hum","value":"openAger/fridge1/set/hum","type":"str"},{"label":"Set aHum_Int","value":"hum_absolut_set","type":"str"},{"label":"Hum_Dev","value":"hum_dev","type":"str"},{"label":"Hysterese","value":"openAger/fridge1/sensors/hysterese","type":"str"},{"label":"Hum Hysterese","value":"openAger/fridge1/sensors/humhysterese","type":"str"},{"label":"Weight 1","value":"weight_1","type":"str"},{"label":"Weight 2","value":"weight_2","type":"str"},{"label":"Weight 3","value":"weight_3","type":"str"},{"label":"Weight 4","value":"weight_4","type":"str"},{"label":"Cooling","value":"openAger/fridge1/actuators/cooling","type":"str"},{"label":"Heating","value":"openAger/fridge1/actuators/heating","type":"str"},{"label":"Ventilation","value":"openAger/fridge1/actuators/ventilation","type":"str"},{"label":"Circulation","value":"openAger/fridge1/actuators/circulation","type":"str"},{"label":"Moistening","value":"openAger/fridge1/actuators/moistening","type":"str"},{"label":"Drying","value":"openAger/fridge1/actuators/drying","type":"str"},{"label":"UVC","value":"uv","type":"str"},{"label":"Light","value":"openAger/fridge1/actuators/light","type":"str"},{"label":"Power","value":"power","type":"str"},{"label":"CPU","value":"temp_cpu","type":"str"},{"label":"VP_Part","value":"vap_pressure","type":"str"},{"label":"VP_Sat","value":"vap_saturation","type":"str"},{"label":"hist1","value":"hist1","type":"str"},{"label":"hist2","value":"hist2","type":"str"},{"label":"hist3","value":"hist3","type":"str"},{"label":"hist5","value":"hist5","type":"str"},{"label":"hist10","value":"hist10","type":"str"},{"label":"CO2","value":"co2","type":"str"},{"label":"Tvoc","value":"air","type":"str"},{"label":"Cooling_on","value":"Cooling_on","type":"str"},{"label":"Heating_on","value":"Heating_on","type":"str"},{"label":"Booster_on","value":"Booster_on","type":"str"},{"label":"Circulation_on","value":"Circulation_on","type":"str"},{"label":"Moistening_on","value":"Moistening_on","type":"str"},{"label":"Drying_on","value":"Drying_on","type":"str"},{"label":"UVC_on","value":"UVC_on","type":"str"},{"label":"Light_on","value":"Light_on","type":"str"}],"payload":"","topic":"datasource","x":590,"y":1520,"wires":[["d37ea009.d0b04"]]},{"id":"b2184950.281448","type":"ui_dropdown","z":"bfb0b9c4.4e1408","name":"Period","label":"","place":"","group":"3ead58e1.865bd8","order":3,"width":"4","height":"1","passthru":false,"options":[{"label":"last hour","value":"last1h","type":"str"},{"label":"Last 6 hours","value":"last6h","type":"str"},{"label":"Today","value":"today","type":"str"},{"label":"Yesterday","value":"yesterday","type":"str"},{"label":"This week","value":"thisweek","type":"str"},{"label":"Last week","value":"lastweek","type":"str"},{"label":"Last 24 hours","value":"last24h","type":"str"},{"label":"Last 7 days","value":"last7d","type":"str"},{"label":"Last 30 days","value":"last30d","type":"str"},{"label":"Last 60 days","value":"last60d","type":"str"},{"label":"Last 90 days","value":"last90d","type":"str"}],"payload":"","topic":"period","x":570,"y":1640,"wires":[["d37ea009.d0b04"]]},{"id":"48431705.3c7f88","type":"inject","z":"bfb0b9c4.4e1408","name":"","repeat":"","crontab":"","once":true,"topic":"","payload":"","payloadType":"str","x":371.25,"y":1575.75,"wires":[["e5bb9d4e.ecf6","b2184950.281448","2351ab04.de7d84"]]},{"id":"f7632f3c.0b62","type":"ui_button","z":"bfb0b9c4.4e1408","name":"","group":"3ead58e1.865bd8","order":4,"width":"1","height":"1","passthru":false,"label":"W","color":"","bgcolor":"","icon":"chevron_left","payload":"","payloadType":"str","topic":"minus1w","x":150,"y":1720,"wires":[["52fdaac6.7fafd4","d37ea009.d0b04"]]},{"id":"96d2a4cb.315b58","type":"ui_button","z":"bfb0b9c4.4e1408","name":"","group":"3ead58e1.865bd8","order":5,"width":"1","height":"1","passthru":false,"label":"D","color":"","bgcolor":"","icon":"chevron_left","payload":"","payloadType":"str","topic":"minus1d","x":148,"y":1757,"wires":[["52fdaac6.7fafd4","d37ea009.d0b04"]]},{"id":"28e613f.08641ec","type":"ui_button","z":"bfb0b9c4.4e1408","name":"","group":"3ead58e1.865bd8","order":9,"width":"1","height":"1","passthru":false,"label":"W","color":"","bgcolor":"","icon":"chevron_right","payload":"","payloadType":"str","topic":"plus1w","x":151,"y":1795,"wires":[["52fdaac6.7fafd4","d37ea009.d0b04"]]},{"id":"b6d01574.b2ed48","type":"ui_button","z":"bfb0b9c4.4e1408","name":"","group":"3ead58e1.865bd8","order":8,"width":"1","height":"1","passthru":false,"label":"D","color":"","bgcolor":"","icon":"chevron_right","payload":"","payloadType":"str","topic":"plus1d","x":149,"y":1832,"wires":[["52fdaac6.7fafd4","d37ea009.d0b04"]]},{"id":"52fdaac6.7fafd4","type":"change","z":"bfb0b9c4.4e1408","name":"Reset","rules":[{"t":"set","p":"payload","pt":"msg","to":"","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":369.25,"y":1635.75,"wires":[["b2184950.281448"]]},{"id":"2351ab04.de7d84","type":"ui_dropdown","z":"bfb0b9c4.4e1408","name":"Aggregate source","label":"","tooltip":"","place":"","group":"3ead58e1.865bd8","order":2,"width":"5","height":"1","passthru":false,"options":[{"label":"[Remove all]","value":"delete","type":"str"},{"label":"Temp Int max","value":"temp_int_max","type":"str"},{"label":"Temp Int min","value":"temp_int_min","type":"str"},{"label":"Temp 1 max","value":"temp1_max","type":"str"},{"label":"Temp 1 min","value":"temp1_min","type":"str"},{"label":"Temp 2 max","value":"temp2_max","type":"str"},{"label":"Temp 2 min","value":"temp2_min","type":"str"},{"label":"Temp Ext max","value":"temp_ext_max","type":"str"},{"label":"Temp Ext min","value":"temp_ext_min","type":"str"},{"label":"Temp Dev max","value":"temp_dev_max","type":"str"},{"label":"Temp Dev min","value":"temp_dev_min","type":"str"},{"label":"Temp Diff max","value":"temp_diff_max","type":"str"},{"label":"Temp Diff min","value":"temp_diff_min","type":"str"},{"label":"Temp CPU max","value":"temp_cpu_max","type":"str"},{"label":"Dewpoint max","value":"dewpoint_max","type":"str"},{"label":"Dewpoint min","value":"dewpoint_min","type":"str"},{"label":"Temp CPU min","value":"temp_cpu_min","type":"str"},{"label":"Hum Int max","value":"hum_int_max","type":"str"},{"label":"Hum Int min","value":"hum_int_min","type":"str"},{"label":"Hum 1 max","value":"hum1_max","type":"str"},{"label":"Hum 1 min","value":"hum1_min","type":"str"},{"label":"Hum 2 max","value":"hum2_max","type":"str"},{"label":"Hum 2 min","value":"hum2_min","type":"str"},{"label":"Hum Ext max","value":"hum_ext_max","type":"str"},{"label":"Hum Ext min","value":"hum_ext_min","type":"str"},{"label":"Power max","value":"power_max","type":"str"},{"label":"Power min","value":"power_min","type":"str"},{"label":"Air max","value":"air_max","type":"str"},{"label":"Air min","value":"air_min","type":"str"},{"label":"UV max","value":"uv_max","type":"str"},{"label":"UV min","value":"uv_min","type":"str"},{"label":"Weight 1 max","value":"weight1_max","type":"str"},{"label":"Weight 1 min","value":"weight1_max","type":"str"},{"label":"Weight 2 max","value":"weight2_max","type":"str"},{"label":"Weight 2 min","value":"weight2_min","type":"str"},{"label":"Weight 3 max","value":"weight3_max","type":"str"},{"label":"Weight 3 min","value":"weight3_min","type":"str"},{"label":"Weight 4 max","value":"weight4_max","type":"str"},{"label":"Weight 4 min","value":"weight4_min","type":"str"},{"label":"CO2 max","value":"co2_max","type":"str"},{"label":"CO2 min","value":"co2_min","type":"str"}],"payload":"","topic":"aggrsource","x":610,"y":1580,"wires":[["d37ea009.d0b04"]]},{"id":"a7306ee9.016df","type":"change","z":"bfb0b9c4.4e1408","name":"Title","rules":[{"t":"set","p":"payload","pt":"msg","to":"title","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1369.500015258789,"y":1712.0000095367432,"wires":[["af4559bc.ab67a8"]]},{"id":"af4559bc.ab67a8","type":"ui_text","z":"bfb0b9c4.4e1408","group":"f95bc692.43b5a8","order":1,"width":"0","height":"0","name":"Chart title","label":"","format":"{{msg.payload}}","layout":"row-center","x":1521.500015258789,"y":1712.0000095367432,"wires":[]},{"id":"22af8439.69d7fc","type":"mysql","z":"bfb0b9c4.4e1408","mydb":"66bacdef.786e04","name":"","x":1020,"y":1760,"wires":[["9f5f8653.72f9e8"]]},{"id":"1304cf5a.9a3a51","type":"comment","z":"bfb0b9c4.4e1408","name":"Dynamic Chart","info":"","x":140,"y":1480,"wires":[]},{"id":"a2241b77.715058","type":"mqtt in","z":"efbc7696.354458","name":"MQTT Debug","topic":"openAger/fridge1/debug/#","qos":"0","datatype":"auto","broker":"4841307a.c2f52","x":190,"y":1800,"wires":[["6811f7d4.2c07c8"]]},{"id":"d2cd3385.c9383","type":"file","z":"bfb0b9c4.4e1408","name":"Dump_Starterinfo","filename":"/data/starter.dump","appendNewline":true,"createDir":false,"overwriteFile":"true","x":790,"y":520,"wires":[[]]},{"id":"630a14c3.b106dc","type":"file in","z":"bfb0b9c4.4e1408","name":"Read Dump_Starterinfo","filename":"/data/starter.dump","format":"utf8","sendError":true,"x":370,"y":180,"wires":[["ce4a6fed.85931"]]},{"id":"2e185352.6fcfbc","type":"inject","z":"bfb0b9c4.4e1408","name":"Auto Startup","repeat":"","crontab":"","once":true,"onceDelay":"","topic":"","payload":"","payloadType":"date","x":150,"y":180,"wires":[["630a14c3.b106dc"]]},{"id":"ce4a6fed.85931","type":"json","z":"bfb0b9c4.4e1408","name":"","x":630,"y":180,"wires":[["946012c2.726e3","e3f2c1b.865b74"]]},{"id":"54c5a54e.1eacfc","type":"function","z":"533bb4f2.f3493c","name":"Stop Auto if set","func":" /*\nData format:\n\nmsg.startzeit = timestamp\nmsg.mode = mode\nmsg.state = state\nmsg.runtime\nmsg.restzeit\nmsg.phase\n\n*/\n global.set(\"state\",\"off\");\n\tglobal.set(\"startzeit\",0);\n\n\tmsg.state = \"off\";\n\tmsg.restzeit = 0;\n\tmsg.startzeit = 0;\n\tmsg.state = \"off\";\n return msg;\n\n","outputs":1,"noerr":0,"x":240,"y":40,"wires":[[]]},{"id":"64cf8401.bdbabc","type":"moment","z":"bfb0b9c4.4e1408","name":"","topic":"","input":"startzeit","inputType":"msg","inTz":"Europe/Vienna","adjAmount":0,"adjType":"days","adjDir":"add","format":"DD.MM.YYYY HH:mm","locale":"C","output":"startzeit","outputType":"msg","outTz":"Europe/Vienna","x":1520,"y":440,"wires":[["4e579bb3.da0624"]]},{"id":"4e579bb3.da0624","type":"function","z":"bfb0b9c4.4e1408","name":"filter off","func":"if (msg.startzeit == \"01.01.1970 01:00\" || global.get(\"state\") == \"off\" || global.get(\"startzeit\") == '0') {\n msg.payload = \"off\";\n msg.startzeit = \"off\";\n}\nreturn msg;","outputs":1,"noerr":0,"x":1700,"y":440,"wires":[["8cb2d938.624bd8"]]},{"id":"8cb2d938.624bd8","type":"ui_text","z":"bfb0b9c4.4e1408","group":"ca61f135.42042","order":4,"width":0,"height":0,"name":"","label":"Started","format":"{{msg.startzeit}}","layout":"row-spread","x":1900,"y":440,"wires":[]},{"id":"51be4eb1.0f324","type":"function","z":"bfb0b9c4.4e1408","name":"filter off","func":"/*\nData format:\n\nmsg.startzeit = timestamp\nmsg.mode = mode\nmsg.state = state\nmsg.runtime\nmsg.restzeit\nmsg.phase\n\n*/\n\nif (msg.restzeit == \"01.01.1970 01:00\" || global.get(\"state\") == \"off\" || global.get(\"restzeit\") == '0') {\n msg.payload = \"off\";\n msg.restzeit = 0;\n}\nreturn msg;","outputs":1,"noerr":0,"x":1700,"y":500,"wires":[["ab96af90.37534"]]},{"id":"2a3dc08a.52357","type":"mqtt out","z":"bfb0b9c4.4e1408","name":"Fridge1 retain","topic":"","qos":"","retain":"true","broker":"4841307a.c2f52","x":1900,"y":660,"wires":[]},{"id":"4df5369a.1a0c88","type":"function","z":"bfb0b9c4.4e1408","name":"build MQTT","func":"/*\nData format:\n\nmsg.startzeit = timestamp\nmsg.mode = mode\nmsg.state = state\nmsg.runtime\nmsg.restzeit\nmsg.phase\n\n*/\nmsg1 = {}\nmsg2 = {}\nmsg3 = {}\nmsg4 = {}\nmsg5 = {}\n\n// node.warn(msg); \n// node.warn(msg.phase);\n// node.warn(msg.set_circmode); \n \n \n// Finished an automatic program?\nif (msg.finito == \"1\") {\n msg1.topic = 'openAger/fridge1/set/mode';\n msg1.payload = '0';\n return [ msg1 ];\n} else {\n\n // running program and settings to transmit?\n if (msg.state == \"on\" && msg.mode != '99' && msg.set_temp) {\n msg1.topic = 'openAger/fridge1/set/temp';\n msg1.payload = msg.set_temp;\n return [ msg1 ];\n } else {\n msg1 = null;\n }\n \n \n if (msg.state == \"on\" && msg.mode != '99' && msg.set_hum) {\n msg2.topic = 'openAger/fridge1/set/hum';\n msg2.payload = msg.set_hum;\n return [ msg2 ];\n } else {\n msg2 = null;\n }\n \n \n if (msg.state == \"on\" && msg.mode != '99') { \n msg3.topic = 'openAger/fridge1/set/circmode';\n msg3.payload = msg.set_circmode; \n return [ msg3 ];\n } else {\n msg3 = null;\n }\n \n if (msg.state == \"on\" && msg.mode != '99' && msg.set_circtime > 0 && msg.set_circdelay > 0) { \n msg4.topic = 'openAger/fridge1/set/circtime';\n msg4.payload = msg.set_circtime; //msg.set_circtime;\n return [ msg4 ];\n } else {\n ms4 = null;\n }\n \n \n if (msg.state == \"on\" && msg.mode != '99' && msg.set_circtime && msg.set_circdelay ) { \n msg5.topic = 'openAger/fridge1/set/circdelay';\n msg5.payload = \"4444\";\n return [ msg5 ];\n } else {\n msg5 = null;\n }\n\n}\n//return [ msg1, msg2 ];\n\n","outputs":5,"noerr":0,"x":1610,"y":660,"wires":[["2a3dc08a.52357"],["2a3dc08a.52357"],["2a3dc08a.52357","94a0beee.38aa2"],["2a3dc08a.52357","94a0beee.38aa2"],["2a3dc08a.52357"]]},{"id":"c7d0664e.5d9318","type":"ui_text","z":"bfb0b9c4.4e1408","group":"ca61f135.42042","order":5,"width":0,"height":0,"name":"","label":"Phase","format":"{{msg.phase}}","layout":"row-spread","x":1910,"y":380,"wires":[]},{"id":"5df2b7fa.54c378","type":"function","z":"bfb0b9c4.4e1408","name":"filter off","func":"if (global.get(\"state\") == \"off\" || global.get(\"startzeit\") == '0') {\n msg.phase = \"none\";\n}\nreturn msg;","outputs":1,"noerr":0,"x":1700,"y":380,"wires":[["c7d0664e.5d9318"]]},{"id":"94a0beee.38aa2","type":"debug","z":"bfb0b9c4.4e1408","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":1870,"y":720,"wires":[]},{"id":"83d0caf4.339f28","type":"function","z":"2a3766ff.038c4a","name":"Runtime/Restzeit","func":"/*\nData format:\n\nmsg.startzeit = timestamp\nmsg.mode = mode\nmsg.state = state\nmsg.runtime\nmsg.restzeit\nmsg.phase\n\n*/\n\n\nif (msg.state == 'on') {\nmsg.runtime = Date.now() - msg.startzeit;\nmsg.restzeit = 48 - ( msg.runtime /1000/60/60/24);\nmsg.finito = 0;\nreturn msg;\n} \n\n","outputs":1,"noerr":0,"x":290,"y":240,"wires":[["9c2297af.3d2028"]]},{"id":"59e7f43c.26a0dc","type":"function","z":"2a3766ff.038c4a","name":"Phase 1","func":"msg.phase = \"Phase 1\";\nreturn msg;","outputs":1,"noerr":0,"x":840,"y":160,"wires":[["44cde4f9.bd9cfc","800fdb5d.0a1af8"]]},{"id":"84829baa.ad9368","type":"function","z":"2a3766ff.038c4a","name":"Phase 2","func":"msg.phase = \"Phase 2\";\nreturn msg;","outputs":1,"noerr":0,"x":840,"y":200,"wires":[["e6cefa25.cfff58","e55f99e0.2bc5d8"]]},{"id":"47b03e53.7a075","type":"function","z":"2a3766ff.038c4a","name":"Phase 3","func":"msg.phase = \"Phase 3\";\nreturn msg;","outputs":1,"noerr":0,"x":840,"y":240,"wires":[["9f261ee6.5b263","306cd77d.bbba98"]]},{"id":"cb6f0c0f.613ce","type":"function","z":"2a3766ff.038c4a","name":"Phase 4","func":"msg.phase = \"Phase 4\";\nreturn msg;","outputs":1,"noerr":0,"x":840,"y":280,"wires":[["6c532696.285458","44d4c8e1.05fdd8"]]},{"id":"262866c5.e512fa","type":"function","z":"2a3766ff.038c4a","name":"Phase 5","func":"msg.phase = \"Phase 5\";\nreturn msg;","outputs":1,"noerr":0,"x":840,"y":320,"wires":[["7147e8ca.46bc78","e82ecb2d.55bb88"]]},{"id":"44cde4f9.bd9cfc","type":"function","z":"2a3766ff.038c4a","name":"T=4","func":"msg.set_temp = \"4\";\nreturn msg;","outputs":1,"noerr":0,"x":1030,"y":80,"wires":[[]]},{"id":"e6cefa25.cfff58","type":"function","z":"2a3766ff.038c4a","name":"T=5","func":"msg.set_temp = \"5\";\nreturn msg;","outputs":1,"noerr":0,"x":1030,"y":160,"wires":[[]]},{"id":"9f261ee6.5b263","type":"function","z":"2a3766ff.038c4a","name":"T=6","func":"msg.set_temp = \"6\";\nreturn msg;","outputs":1,"noerr":0,"x":1030,"y":240,"wires":[[]]},{"id":"7147e8ca.46bc78","type":"function","z":"2a3766ff.038c4a","name":"T=7","func":"msg.set_temp = \"7\";\nreturn msg;","outputs":1,"noerr":0,"x":1030,"y":400,"wires":[[]]},{"id":"6c532696.285458","type":"function","z":"2a3766ff.038c4a","name":"T=6","func":"msg.set_temp = \"6\";\nreturn msg;","outputs":1,"noerr":0,"x":1030,"y":320,"wires":[[]]},{"id":"800fdb5d.0a1af8","type":"function","z":"2a3766ff.038c4a","name":"H=72","func":"msg.set_hum = \"72\";\nreturn msg;","outputs":1,"noerr":0,"x":1030,"y":40,"wires":[[]]},{"id":"e55f99e0.2bc5d8","type":"function","z":"2a3766ff.038c4a","name":"H=65","func":"msg.set_hum = \"65\";\nreturn msg;","outputs":1,"noerr":0,"x":1030,"y":120,"wires":[[]]},{"id":"306cd77d.bbba98","type":"function","z":"2a3766ff.038c4a","name":"H=55","func":"msg.set_hum = \"55\";\nreturn msg;","outputs":1,"noerr":0,"x":1030,"y":200,"wires":[[]]},{"id":"44d4c8e1.05fdd8","type":"function","z":"2a3766ff.038c4a","name":"H=55","func":"msg.set_hum = \"55\";\nreturn msg;","outputs":1,"noerr":0,"x":1030,"y":280,"wires":[[]]},{"id":"e82ecb2d.55bb88","type":"function","z":"2a3766ff.038c4a","name":"H=40","func":"msg.set_hum = \"40\";\nreturn msg;","outputs":1,"noerr":0,"x":1030,"y":360,"wires":[[]]},{"id":"4419c6e4.ea7378","type":"comment","z":"37fce5bb.18d03a","name":"Aging Programm 6 Wochen","info":"","x":220,"y":160,"wires":[]},{"id":"ecf2c17f.474c5","type":"function","z":"37fce5bb.18d03a","name":"Finished!","func":" /*\nData format:\n\nmsg.startzeit = timestamp\nmsg.mode = mode\nmsg.state = state\nmsg.runtime\nmsg.restzeit\nmsg.phase\n\n*/\n global.set(\"state\",\"off\");\n global.set(\"mode\", 0);\n\tglobal.set(\"startzeit\",0);\n\tmsg.state = \"off\";\n\tmsg.mode = '0';\n\tmsg.finito = '1';\n return msg;\n\n","outputs":1,"noerr":0,"x":1020,"y":520,"wires":[[]]},{"id":"18b1ebc6.2bf6b4","type":"function","z":"37fce5bb.18d03a","name":"Runtime/Restzeit","func":"/*\nData format:\n\nmsg.startzeit = timestamp\nmsg.mode = mode\nmsg.state = state\nmsg.runtime\nmsg.restzeit\nmsg.phase\n\n*/\n\n\nif (msg.state == 'on') {\nmsg.runtime = Date.now() - msg.startzeit;\nmsg.restzeit = 48 - ( msg.runtime /1000/60/60/24);\nmsg.finito = 0;\nreturn msg;\n} \n\n","outputs":1,"noerr":0,"x":330,"y":280,"wires":[["3e570faa.80a3f"]]},{"id":"3e570faa.80a3f","type":"switch","z":"37fce5bb.18d03a","name":"Scheduler","property":"runtime","propertyType":"msg","rules":[{"t":"btwn","v":"0","vt":"jsonata","v2":"1000*10","v2t":"jsonata"},{"t":"btwn","v":"1000*10","vt":"jsonata","v2":"1000*10*2","v2t":"jsonata"},{"t":"btwn","v":"1000*10*2","vt":"jsonata","v2":"1000*10*3","v2t":"jsonata"},{"t":"btwn","v":"1000*10*3","vt":"jsonata","v2":"1000*10*4","v2t":"jsonata"},{"t":"btwn","v":"1000*10*4","vt":"jsonata","v2":"1000*10*5","v2t":"jsonata"},{"t":"gt","v":"1000*10*5","vt":"jsonata"}],"checkall":"true","repair":false,"outputs":6,"x":620,"y":280,"wires":[["70dea311.85962c"],["ffbb889e.db0c98"],["1aefb2f1.64067d"],["42af8f53.88a37"],["cf77d7a9.e01a18"],["ecf2c17f.474c5"]]},{"id":"70dea311.85962c","type":"function","z":"37fce5bb.18d03a","name":"Phase 1","func":"msg.phase = \"Phase 1\";\nreturn msg;","outputs":1,"noerr":0,"x":980,"y":200,"wires":[["81765bad.73f7b8"]]},{"id":"ffbb889e.db0c98","type":"function","z":"37fce5bb.18d03a","name":"Phase 2","func":"msg.phase = \"Phase 2\";\nreturn msg;","outputs":1,"noerr":0,"x":980,"y":240,"wires":[["aa815c3f.d8875","7468fdad.ecbb94"]]},{"id":"1aefb2f1.64067d","type":"function","z":"37fce5bb.18d03a","name":"Phase 3","func":"msg.phase = \"Phase 3\";\nreturn msg;","outputs":1,"noerr":0,"x":980,"y":280,"wires":[["5b5c3114.9cbbb","b5670245.b7064"]]},{"id":"42af8f53.88a37","type":"function","z":"37fce5bb.18d03a","name":"Phase 4","func":"msg.phase = \"Phase 4\";\nreturn msg;","outputs":1,"noerr":0,"x":980,"y":320,"wires":[["61af5b93.e11b34","2d22ebe9.1c64e4"]]},{"id":"cf77d7a9.e01a18","type":"function","z":"37fce5bb.18d03a","name":"Phase 5","func":"msg.phase = \"Phase 5\";\nreturn msg;","outputs":1,"noerr":0,"x":980,"y":360,"wires":[["7941a271.22490c","44463589.dd5e2c"]]},{"id":"e4218595.e63ab8","type":"function","z":"37fce5bb.18d03a","name":"T=4","func":"msg.set_temp = \"4\";\nreturn msg;","outputs":1,"noerr":0,"x":1450,"y":140,"wires":[[]]},{"id":"aa815c3f.d8875","type":"function","z":"37fce5bb.18d03a","name":"T=5","func":"msg.set_temp = \"5\";\nreturn msg;","outputs":1,"noerr":0,"x":1450,"y":220,"wires":[[]]},{"id":"5b5c3114.9cbbb","type":"function","z":"37fce5bb.18d03a","name":"T=6","func":"msg.set_temp = \"6\";\nreturn msg;","outputs":1,"noerr":0,"x":1450,"y":300,"wires":[[]]},{"id":"7941a271.22490c","type":"function","z":"37fce5bb.18d03a","name":"T=7","func":"msg.set_temp = \"7\";\nreturn msg;","outputs":1,"noerr":0,"x":1450,"y":460,"wires":[[]]},{"id":"61af5b93.e11b34","type":"function","z":"37fce5bb.18d03a","name":"T=6","func":"msg.set_temp = \"6\";\nreturn msg;","outputs":1,"noerr":0,"x":1450,"y":380,"wires":[[]]},{"id":"98cff5a3.9b1638","type":"function","z":"37fce5bb.18d03a","name":"H=72","func":"msg.set_hum = \"72\";\nreturn msg;","outputs":1,"noerr":0,"x":1450,"y":100,"wires":[[]]},{"id":"7468fdad.ecbb94","type":"function","z":"37fce5bb.18d03a","name":"H=65","func":"msg.set_hum = \"65\";\nreturn msg;","outputs":1,"noerr":0,"x":1450,"y":180,"wires":[[]]},{"id":"b5670245.b7064","type":"function","z":"37fce5bb.18d03a","name":"H=55","func":"msg.set_hum = \"55\";\nreturn msg;","outputs":1,"noerr":0,"x":1450,"y":260,"wires":[[]]},{"id":"2d22ebe9.1c64e4","type":"function","z":"37fce5bb.18d03a","name":"H=55","func":"msg.set_hum = \"55\";\nreturn msg;","outputs":1,"noerr":0,"x":1450,"y":340,"wires":[[]]},{"id":"44463589.dd5e2c","type":"function","z":"37fce5bb.18d03a","name":"H=40","func":"msg.set_hum = \"40\";\nreturn msg;","outputs":1,"noerr":0,"x":1450,"y":420,"wires":[[]]},{"id":"dd7a5bbd.8f9bf8","type":"subflow:37fce5bb.18d03a","z":"bfb0b9c4.4e1408","x":740,"y":900,"wires":[["f3079c9f.ee374"]]},{"id":"95e4a392.ab692","type":"switch","z":"acee58da.9b1998","name":"Scheduler","property":"runtime","propertyType":"msg","rules":[{"t":"btwn","v":"0","vt":"jsonata","v2":"1000*60*60*24*12","v2t":"jsonata"},{"t":"btwn","v":"1000*60*60*24*12","vt":"jsonata","v2":"1000*60*60*24*21","v2t":"jsonata"},{"t":"btwn","v":"1000*60*60*24*21","vt":"jsonata","v2":"1000*60*60*24*34","v2t":"jsonata"},{"t":"btwn","v":"1000*60*60*24*34","vt":"jsonata","v2":"1000*60*60*24*43","v2t":"jsonata"},{"t":"btwn","v":"1000*60*60*24*43","vt":"jsonata","v2":"1000*60*60*24*56","v2t":"jsonata"},{"t":"btwn","v":"1000*60*60*24*56","vt":"jsonata","v2":"1000*60*60*24*75","v2t":"jsonata"},{"t":"eq","v":"1000*60*60*24*75","vt":"str"}],"checkall":"true","repair":false,"outputs":7,"x":620,"y":140,"wires":[["ef94c2f6.af0e9"],["7e79120e.fbc2fc"],["81e16629.03f858"],["5b17f770.afa448"],["6d1eed66.0f95c4"],["ead52de1.975f4"],["51c2a2b3.38cdbc"]]},{"id":"c7c4b82f.246598","type":"function","z":"acee58da.9b1998","name":"Runtime/Restzeit","func":"/*\nData format:\n\nmsg.startzeit = timestamp\nmsg.mode = mode\nmsg.state = state\nmsg.runtime\nmsg.restzeit\nmsg.phase\n\n*/\n\n\nif (msg.state == 'on') {\nmsg.runtime = Date.now() - msg.startzeit;\nmsg.restzeit = 75 - ( msg.runtime /1000/60/60/24);\nmsg.finito = 0;\nreturn msg;\n} \n\n","outputs":1,"noerr":0,"x":310,"y":140,"wires":[["95e4a392.ab692"]]},{"id":"752bd367.59bf2c","type":"function","z":"acee58da.9b1998","name":"H=80>70","func":"msg.set_hum = \"70\";\nreturn msg;","outputs":1,"noerr":0,"x":1040,"y":40,"wires":[[]]},{"id":"817febc.bfb5e18","type":"function","z":"acee58da.9b1998","name":"T=2","func":"msg.set_temp = \"2\";\nreturn msg;","outputs":1,"noerr":0,"x":1030,"y":80,"wires":[[]]},{"id":"9a11a6af.29eed8","type":"function","z":"acee58da.9b1998","name":"T=5","func":"msg.set_temp = \"5\";\nreturn msg;","outputs":1,"noerr":0,"x":1030,"y":160,"wires":[[]]},{"id":"639f7dec.426074","type":"function","z":"acee58da.9b1998","name":"H=30","func":"msg.set_hum = \"30\";\nreturn msg;","outputs":1,"noerr":0,"x":1030,"y":120,"wires":[[]]},{"id":"f8b84854.7649d8","type":"function","z":"acee58da.9b1998","name":"H=70>60","func":"msg.set_hum = \"60\";\nreturn msg;","outputs":1,"noerr":0,"x":1040,"y":200,"wires":[[]]},{"id":"ec8f26eb.d2cdc8","type":"function","z":"acee58da.9b1998","name":"T=4","func":"msg.set_temp = \"4\";\nreturn msg;","outputs":1,"noerr":0,"x":1030,"y":240,"wires":[[]]},{"id":"e7458a57.feafc8","type":"function","z":"acee58da.9b1998","name":"T=4","func":"msg.set_temp = \"4\";\nreturn msg;","outputs":1,"noerr":0,"x":1030,"y":320,"wires":[[]]},{"id":"623f070f.357158","type":"function","z":"acee58da.9b1998","name":"T=7","func":"msg.set_temp = \"7\";\nreturn msg;","outputs":1,"noerr":0,"x":1030,"y":400,"wires":[[]]},{"id":"eff7a6a6.8cbb28","type":"function","z":"acee58da.9b1998","name":"T=7","func":"msg.set_temp = \"7\";\nreturn msg;","outputs":1,"noerr":0,"x":1030,"y":480,"wires":[[]]},{"id":"c8290c74.3e776","type":"function","z":"acee58da.9b1998","name":"H=60>50","func":"msg.set_hum = \"50\";\nreturn msg;","outputs":1,"noerr":0,"x":1040,"y":280,"wires":[[]]},{"id":"51fd7786.ea91a8","type":"function","z":"acee58da.9b1998","name":"H=45","func":"msg.set_hum = \"45\";\nreturn msg;","outputs":1,"noerr":0,"x":1030,"y":360,"wires":[[]]},{"id":"51c2a2b3.38cdbc","type":"function","z":"acee58da.9b1998","name":"Finished!","func":" /*\nData format:\n\nmsg.startzeit = timestamp\nmsg.mode = mode\nmsg.state = state\nmsg.runtime\nmsg.restzeit\nmsg.phase\n\n*/\n global.set(\"state\",\"off\");\n global.set(\"mode\", 0);\n\tglobal.set(\"startzeit\",0);\n\tmsg.state = \"off\";\n\tmsg.mode = '0';\n\tmsg.finito = '1';\n return msg;\n\n","outputs":1,"noerr":0,"x":820,"y":520,"wires":[[]]},{"id":"685589b6.4e19f8","type":"function","z":"f44824d.57101d8","name":"Runtime/Restzeit","func":"/*\nData format:\n\nmsg.startzeit = timestamp\nmsg.mode = mode\nmsg.state = state\nmsg.runtime\nmsg.restzeit\nmsg.phase\n\n*/\n\n\nif (msg.state == 'on') {\nmsg.runtime = Date.now() - msg.startzeit;\nmsg.restzeit = 56 - ( msg.runtime /1000/60/60/24);\nmsg.finito = 0;\nreturn msg;\n} \n\n","outputs":1,"noerr":0,"x":270,"y":160,"wires":[["ee5703e9.38bf"]]},{"id":"ee5703e9.38bf","type":"switch","z":"f44824d.57101d8","name":"Scheduler","property":"runtime","propertyType":"msg","rules":[{"t":"btwn","v":"0","vt":"jsonata","v2":"1000*60*60*24*56","v2t":"jsonata"},{"t":"gt","v":"1000*60*60*24*56","vt":"jsonata"}],"checkall":"true","repair":false,"outputs":2,"x":600,"y":160,"wires":[["583cba15.96a284"],["d0b0bdae.3dab5"]]},{"id":"583cba15.96a284","type":"function","z":"f44824d.57101d8","name":"Phase 1","func":"msg.phase = \"Phase 1\";\nreturn msg;","outputs":1,"noerr":0,"x":840,"y":80,"wires":[["600b186b.af6308","f2d99b09.d996c8"]]},{"id":"f2d99b09.d996c8","type":"function","z":"f44824d.57101d8","name":"H=75","func":"msg.set_hum = \"75\";\nreturn msg;","outputs":1,"noerr":0,"x":1050,"y":60,"wires":[[]]},{"id":"600b186b.af6308","type":"function","z":"f44824d.57101d8","name":"T=3","func":"msg.set_temp = \"3\";\nreturn msg;","outputs":1,"noerr":0,"x":1050,"y":100,"wires":[[]]},{"id":"d0b0bdae.3dab5","type":"function","z":"f44824d.57101d8","name":"Finished!","func":" /*\nData format:\n\nmsg.startzeit = timestamp\nmsg.mode = mode\nmsg.state = state\nmsg.runtime\nmsg.restzeit\nmsg.phase\n\n*/\n global.set(\"state\",\"off\");\n global.set(\"mode\", 0);\n\tglobal.set(\"startzeit\",0);\n\tmsg.state = \"off\";\n\tmsg.mode = '0';\n\tmsg.finito = '1';\n return msg;\n\n","outputs":1,"noerr":0,"x":840,"y":220,"wires":[[]]},{"id":"31401bfa.904924","type":"subflow:f44824d.57101d8","z":"bfb0b9c4.4e1408","x":760,"y":860,"wires":[["f3079c9f.ee374"]]},{"id":"e385f317.1fcff","type":"function","z":"91eb6541.4fd558","name":"Runtime/Restzeit","func":"/*\nData format:\n\nmsg.startzeit = timestamp\nmsg.mode = mode\nmsg.state = state\nmsg.runtime\nmsg.restzeit\nmsg.phase\n\n*/\n\n\nif (msg.state == 'on') {\nmsg.runtime = Date.now() - msg.startzeit;\nmsg.restzeit = 12 - ( msg.runtime /1000/60/60/24);\nmsg.finito = 0;\nreturn msg;\n} \n\n","outputs":1,"noerr":0,"x":310,"y":220,"wires":[["b7de50de.f0334"]]},{"id":"b7de50de.f0334","type":"switch","z":"91eb6541.4fd558","name":"Scheduler","property":"runtime","propertyType":"msg","rules":[{"t":"btwn","v":"0","vt":"jsonata","v2":"1000*60*60*24*1","v2t":"jsonata"},{"t":"btwn","v":"1000*60*60*24*1","vt":"jsonata","v2":"1000*60*60*24*4","v2t":"jsonata"},{"t":"btwn","v":"1000*60*60*24*4","vt":"jsonata","v2":"1000*60*60*24*6","v2t":"num"},{"t":"btwn","v":"1000*60*60*24*6","vt":"jsonata","v2":"1000*60*60*24*9","v2t":"jsonata"},{"t":"btwn","v":"1000*60*60*24*9","vt":"jsonata","v2":"1000*60*60*24*12","v2t":"jsonata"},{"t":"gt","v":"1000*60*60*24*12","vt":"jsonata"}],"checkall":"true","repair":false,"outputs":6,"x":640,"y":220,"wires":[["dbc5aa15.3cf518"],["47175664.524528"],["d09d57bd.d6de68"],["1a9a6149.df9baf"],["5fef02fa.82e6bc"],["6909a133.33f36"]]},{"id":"dbc5aa15.3cf518","type":"function","z":"91eb6541.4fd558","name":"Day 1","func":"msg.phase = \"Phase 1\";\nreturn msg;","outputs":1,"noerr":0,"x":930,"y":140,"wires":[["296c01be.065d5e","200ab38a.5967ac"]]},{"id":"6909a133.33f36","type":"function","z":"91eb6541.4fd558","name":"Finished!","func":" /*\nData format:\n\nmsg.startzeit = timestamp\nmsg.mode = mode\nmsg.state = state\nmsg.runtime\nmsg.restzeit\nmsg.phase\n\n*/\n global.set(\"state\",\"off\");\n global.set(\"mode\", 0);\n\tglobal.set(\"startzeit\",0);\n\tmsg.state = \"off\";\n\tmsg.mode = '0';\n\tmsg.finito = '1';\n return msg;\n\n","outputs":1,"noerr":0,"x":900,"y":600,"wires":[[]]},{"id":"dfcc42af.88f6e","type":"comment","z":"91eb6541.4fd558","name":"Salami","info":"","x":120,"y":80,"wires":[]},{"id":"377eaa0c.2fa036","type":"subflow:91eb6541.4fd558","z":"bfb0b9c4.4e1408","x":730,"y":780,"wires":[["f3079c9f.ee374"]]},{"id":"296c01be.065d5e","type":"function","z":"91eb6541.4fd558","name":"T=18","func":"msg.set_temp = \"18\";\nreturn msg;","outputs":1,"noerr":0,"x":1190,"y":40,"wires":[[]]},{"id":"47175664.524528","type":"function","z":"91eb6541.4fd558","name":"Day 2-4","func":"msg.phase = \"Phase 2\";\nreturn msg;","outputs":1,"noerr":0,"x":940,"y":180,"wires":[["cc6c20e.f7015e","50abe31.dcee21c"]]},{"id":"d09d57bd.d6de68","type":"function","z":"91eb6541.4fd558","name":"Day 5-6","func":"msg.phase = \"Phase 3\";\nreturn msg;","outputs":1,"noerr":0,"x":940,"y":220,"wires":[["d58a6b46.3973a8","5a155601.4317c8"]]},{"id":"1a9a6149.df9baf","type":"function","z":"91eb6541.4fd558","name":"Day 7-9","func":"msg.phase = \"Phase 4\";\nreturn msg;","outputs":1,"noerr":0,"x":940,"y":260,"wires":[["32bac649.37809a","7c55c812.c8f168"]]},{"id":"5fef02fa.82e6bc","type":"function","z":"91eb6541.4fd558","name":"Day 10-12","func":"msg.phase = \"Phase 5\";\nreturn msg;","outputs":1,"noerr":0,"x":950,"y":300,"wires":[["8c3eeb7c.5ca1b8","87be4386.86e6d"]]},{"id":"200ab38a.5967ac","type":"function","z":"91eb6541.4fd558","name":"H=95","func":"msg.set_hum = \"95\";\nreturn msg;","outputs":1,"noerr":0,"x":1190,"y":80,"wires":[[]]},{"id":"cc6c20e.f7015e","type":"function","z":"91eb6541.4fd558","name":"T=22","func":"msg.set_temp = \"22\";\nreturn msg;","outputs":1,"noerr":0,"x":1190,"y":120,"wires":[[]]},{"id":"50abe31.dcee21c","type":"function","z":"91eb6541.4fd558","name":"H=93","func":"msg.set_hum = \"93\";\nreturn msg;","outputs":1,"noerr":0,"x":1190,"y":160,"wires":[[]]},{"id":"d58a6b46.3973a8","type":"function","z":"91eb6541.4fd558","name":"T=20","func":"msg.set_temp = \"20\";\nreturn msg;","outputs":1,"noerr":0,"x":1190,"y":200,"wires":[[]]},{"id":"5a155601.4317c8","type":"function","z":"91eb6541.4fd558","name":"H=90","func":"msg.set_hum = \"90\";\nreturn msg;","outputs":1,"noerr":0,"x":1190,"y":240,"wires":[[]]},{"id":"32bac649.37809a","type":"function","z":"91eb6541.4fd558","name":"T=18","func":"msg.set_temp = \"18\";\nreturn msg;","outputs":1,"noerr":0,"x":1190,"y":280,"wires":[[]]},{"id":"8c3eeb7c.5ca1b8","type":"function","z":"91eb6541.4fd558","name":"T=18","func":"msg.set_temp = \"18\";\nreturn msg;","outputs":1,"noerr":0,"x":1190,"y":360,"wires":[[]]},{"id":"7c55c812.c8f168","type":"function","z":"91eb6541.4fd558","name":"H=85","func":"msg.set_hum = \"85\";\nreturn msg;","outputs":1,"noerr":0,"x":1190,"y":320,"wires":[[]]},{"id":"87be4386.86e6d","type":"function","z":"91eb6541.4fd558","name":"H=80","func":"msg.set_hum = \"80\";\nreturn msg;","outputs":1,"noerr":0,"x":1190,"y":400,"wires":[[]]},{"id":"7ae7ad93.8776a4","type":"function","z":"37fce5bb.18d03a","name":"T=5","func":"msg.set_temp = \"5\";\nreturn msg;","outputs":1,"noerr":0,"x":230,"y":660,"wires":[[]]},{"id":"351acf13.da526","type":"function","z":"37fce5bb.18d03a","name":"T=6","func":"msg.set_temp = \"6\";\nreturn msg;","outputs":1,"noerr":0,"x":230,"y":700,"wires":[[]]},{"id":"8896f6a5.da1af8","type":"function","z":"37fce5bb.18d03a","name":"T=7","func":"msg.set_temp = \"7\";\nreturn msg;","outputs":1,"noerr":0,"x":230,"y":740,"wires":[[]]},{"id":"13bf4c84.333533","type":"function","z":"37fce5bb.18d03a","name":"H=85","func":"msg.set_hum = \"85\";\nreturn msg;","outputs":1,"noerr":0,"x":390,"y":860,"wires":[[]]},{"id":"5066e77d.95ebf8","type":"function","z":"37fce5bb.18d03a","name":"T=2","func":"msg.set_temp = \"2\";\nreturn msg;","outputs":1,"noerr":0,"x":230,"y":580,"wires":[[]]},{"id":"9c80c2b3.de028","type":"function","z":"37fce5bb.18d03a","name":"H=30","func":"msg.set_hum = \"30\";\nreturn msg;","outputs":1,"noerr":0,"x":390,"y":580,"wires":[[]]},{"id":"ed0eff3c.b5ecc","type":"function","z":"37fce5bb.18d03a","name":"H=72","func":"msg.set_hum = \"72\";\nreturn msg;","outputs":1,"noerr":0,"x":390,"y":780,"wires":[[]]},{"id":"50f82a00.235178","type":"function","z":"37fce5bb.18d03a","name":"H=70","func":"msg.set_hum = \"70\";\nreturn msg;","outputs":1,"noerr":0,"x":390,"y":740,"wires":[[]]},{"id":"51b3bc26.8b0704","type":"function","z":"37fce5bb.18d03a","name":"T=4","func":"msg.set_temp = \"4\";\nreturn msg;","outputs":1,"noerr":0,"x":230,"y":620,"wires":[[]]},{"id":"3a7bb6ca.6fb0ea","type":"function","z":"37fce5bb.18d03a","name":"H=65","func":"msg.set_hum = \"65\";\nreturn msg;","outputs":1,"noerr":0,"x":390,"y":700,"wires":[[]]},{"id":"885dff48.55e3e","type":"function","z":"37fce5bb.18d03a","name":"H=60","func":"msg.set_hum = \"60\";\nreturn msg;","outputs":1,"noerr":0,"x":390,"y":660,"wires":[[]]},{"id":"6cc6ddf0.0e3ef4","type":"function","z":"37fce5bb.18d03a","name":"H=45","func":"msg.set_hum = \"45\";\nreturn msg;","outputs":1,"noerr":0,"x":390,"y":620,"wires":[[]]},{"id":"19465228.975afe","type":"function","z":"37fce5bb.18d03a","name":"T=18","func":"msg.set_temp = \"18\";\nreturn msg;","outputs":1,"noerr":0,"x":230,"y":840,"wires":[[]]},{"id":"578360d3.9549d","type":"function","z":"37fce5bb.18d03a","name":"T=22","func":"msg.set_temp = \"22\";\nreturn msg;","outputs":1,"noerr":0,"x":230,"y":920,"wires":[[]]},{"id":"b0efae67.a887d","type":"function","z":"37fce5bb.18d03a","name":"T=20","func":"msg.set_temp = \"20\";\nreturn msg;","outputs":1,"noerr":0,"x":230,"y":880,"wires":[[]]},{"id":"2250a676.49724a","type":"function","z":"37fce5bb.18d03a","name":"H=90","func":"msg.set_hum = \"90\";\nreturn msg;","outputs":1,"noerr":0,"x":390,"y":900,"wires":[[]]},{"id":"4160e1.73263f2","type":"function","z":"37fce5bb.18d03a","name":"H=93","func":"msg.set_hum = \"93\";\nreturn msg;","outputs":1,"noerr":0,"x":390,"y":940,"wires":[[]]},{"id":"d0a67a20.86e638","type":"function","z":"37fce5bb.18d03a","name":"H=95","func":"msg.set_hum = \"95\";\nreturn msg;","outputs":1,"noerr":0,"x":390,"y":980,"wires":[[]]},{"id":"23b85a29.40eef6","type":"function","z":"37fce5bb.18d03a","name":"H=80","func":"msg.set_hum = \"80\";\nreturn msg;","outputs":1,"noerr":0,"x":390,"y":820,"wires":[[]]},{"id":"d520ea5b.d49528","type":"function","z":"58f7dc96.300d44","name":"Runtime/Restzeit","func":"/*\nData format:\n\nmsg.startzeit = timestamp\nmsg.mode = mode\nmsg.state = state\nmsg.runtime\nmsg.restzeit\nmsg.phase\n\n*/\n\n\nif (msg.state == 'on') {\nmsg.runtime = Date.now() - msg.startzeit;\nmsg.restzeit = 70 - ( msg.runtime /1000/60/60/24);\nmsg.finito = 0;\nreturn msg;\n} \n\n","outputs":1,"noerr":0,"x":290,"y":240,"wires":[["6969077.5cb4df8"]]},{"id":"6969077.5cb4df8","type":"switch","z":"58f7dc96.300d44","name":"Scheduler","property":"runtime","propertyType":"msg","rules":[{"t":"btwn","v":"0","vt":"jsonata","v2":"1000*60*60*24*7*4","v2t":"jsonata"},{"t":"btwn","v":"1000*60*60*24*7*4","vt":"jsonata","v2":"1000*80*60*24*7*4","v2t":"jsonata"},{"t":"btwn","v":"1000*80*60*24*7*4","vt":"jsonata","v2":"1000*60*60*24*10","v2t":"jsonata"},{"t":"gt","v":"1000*60*60*24*10","vt":"jsonata"}],"checkall":"true","repair":false,"outputs":4,"x":620,"y":240,"wires":[["9749813a.0ff15"],["9afb7427.b0ebc8"],["4b6cc7c2.01fbc8"],["91004e06.de7ed"]]},{"id":"9749813a.0ff15","type":"function","z":"58f7dc96.300d44","name":"Pökeln 4 Wochen","func":"msg.phase = \"Pökeln\";\nreturn msg;","outputs":1,"noerr":0,"x":950,"y":160,"wires":[["ad0cba22.186628","41a8dd64.285414"]]},{"id":"91004e06.de7ed","type":"function","z":"58f7dc96.300d44","name":"Finished!","func":" /*\nData format:\n\nmsg.startzeit = timestamp\nmsg.mode = mode\nmsg.state = state\nmsg.runtime\nmsg.restzeit\nmsg.phase\n\n*/\n global.set(\"state\",\"off\");\n global.set(\"mode\", 0);\n\tglobal.set(\"startzeit\",0);\n\tmsg.state = \"off\";\n\tmsg.mode = '0';\n\tmsg.finito = '1';\n return msg;\n\n","outputs":1,"noerr":0,"x":880,"y":620,"wires":[[]]},{"id":"b3157870.b52048","type":"comment","z":"58f7dc96.300d44","name":"Speck","info":"","x":190,"y":120,"wires":[]},{"id":"4b6cc7c2.01fbc8","type":"function","z":"58f7dc96.300d44","name":"Reifen 6 Wochen","func":"msg.phase = \"Reifen\";\nreturn msg;","outputs":1,"noerr":0,"x":950,"y":300,"wires":[["517246ed.ac6eb8","30ce3567.ea8ffa"]]},{"id":"517246ed.ac6eb8","type":"function","z":"58f7dc96.300d44","name":"T=10","func":"msg.set_temp = \"10\";\nreturn msg;","outputs":1,"noerr":0,"x":1170,"y":300,"wires":[[]]},{"id":"41a8dd64.285414","type":"function","z":"58f7dc96.300d44","name":"H=70","func":"msg.set_hum = \"70\";\nreturn msg;","outputs":1,"noerr":0,"x":1170,"y":160,"wires":[[]]},{"id":"ad0cba22.186628","type":"function","z":"58f7dc96.300d44","name":"T=4","func":"msg.set_temp = \"4\";\nreturn msg;","outputs":1,"noerr":0,"x":1170,"y":120,"wires":[[]]},{"id":"30ce3567.ea8ffa","type":"function","z":"58f7dc96.300d44","name":"H=65","func":"msg.set_hum = \"65\";\nreturn msg;","outputs":1,"noerr":0,"x":1170,"y":340,"wires":[[]]},{"id":"976a7062.0ee37","type":"e-mail","z":"58f7dc96.300d44","server":"smtp.gmail.com","port":"465","secure":true,"name":"valki@valki.com","dname":"Memo","x":1190,"y":220,"wires":[]},{"id":"a72749f5.cb6808","type":"function","z":"58f7dc96.300d44","name":"Mailtext","func":"\nmsg.topic = \"Speck Räuchern!\";\nmsg.payload = \"Der Speck war jetzt lange genug in der Sure - bitte räuchern und dann reifen!\";\nreturn msg;","outputs":1,"noerr":0,"x":1040,"y":220,"wires":[["976a7062.0ee37"]]},{"id":"108224ba.76c3db","type":"e-mail","z":"37fce5bb.18d03a","server":"smtp.gmail.com","port":"465","secure":true,"name":"valki@valki.com","dname":"Memo","x":1370,"y":580,"wires":[]},{"id":"5cece71f.5ad7a8","type":"function","z":"37fce5bb.18d03a","name":"Mailtext","func":"\nmsg.topic = \"Speck Räuchern!\";\nmsg.payload = \"Der Speck war jetzt lange genug in der Sure - bitte räuchern und dann reifen!\";\nreturn msg;","outputs":1,"noerr":0,"x":1220,"y":580,"wires":[["108224ba.76c3db"]]},{"id":"9afb7427.b0ebc8","type":"delay","z":"58f7dc96.300d44","name":"","pauseType":"rate","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"day","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":true,"x":870,"y":220,"wires":[["a72749f5.cb6808"]]},{"id":"cc167368.d85eb","type":"comment","z":"bfb0b9c4.4e1408","name":"Status Visualizations","info":"","x":1850,"y":280,"wires":[]},{"id":"6bedfd75.a86964","type":"comment","z":"bfb0b9c4.4e1408","name":"Send MQTT","info":"","x":1870,"y":600,"wires":[]},{"id":"6811f7d4.2c07c8","type":"switch","z":"efbc7696.354458","name":"Topic Switch","property":"topic","propertyType":"msg","rules":[{"t":"eq","v":"openAger/fridge1/debug/log","vt":"str"},{"t":"eq","v":"openAger/fridge1/debug/alert","vt":"str"},{"t":"eq","v":"openAger/fridge1/debug/email","vt":"str"}],"checkall":"true","repair":false,"outputs":3,"x":490,"y":1800,"wires":[["a4e24ab7.e8efa8","2f26c5da.880c2a"],["bd35c15b.85ef3","a4e24ab7.e8efa8","f19d8270.85b3b","2f26c5da.880c2a"],["3b5d44cb.c118bc","2f26c5da.880c2a"]]},{"id":"47e34441.9c3e2c","type":"json","z":"bfb0b9c4.4e1408","name":"","property":"payload","action":"","pretty":false,"x":610,"y":520,"wires":[["d2cd3385.c9383"]]},{"id":"19a79b09.1588c5","type":"ui_dropdown","z":"efbc7696.354458","name":"boostermode","label":"Booster Mode","place":"","group":"b09a98a.6139868","order":6,"width":0,"height":0,"passthru":false,"options":[{"label":"static timings","value":"0","type":"str"},{"label":"override","value":"99","type":"str"}],"payload":"","topic":"openAger/fridge1/set/boostermode","x":810,"y":1100,"wires":[["cc4f87dc.b00118"]]},{"id":"91390d9c.8ff5a","type":"ui_dropdown","z":"efbc7696.354458","name":"circmode","label":"Circulation Mode","place":"","group":"b09a98a.6139868","order":2,"width":0,"height":0,"passthru":false,"options":[{"label":"static timings","value":"0","type":"str"},{"label":"auto","value":"1","type":"str"},{"label":"override","value":"99","type":"str"}],"payload":"","topic":"openAger/fridge1/set/circmode","x":800,"y":1140,"wires":[["cc4f87dc.b00118"]]},{"id":"f3c2cb7e.53c6c8","type":"ui_text_input","z":"efbc7696.354458","name":"boostertime","label":"Booster Time","group":"b09a98a.6139868","order":7,"width":0,"height":0,"passthru":false,"mode":"text","delay":"0","topic":"openAger/fridge1/set/boostertime","x":810,"y":1220,"wires":[["cc4f87dc.b00118"]]},{"id":"affcf431.36e318","type":"ui_text_input","z":"efbc7696.354458","name":"boosterdelay","label":"Booster Delay","group":"b09a98a.6139868","order":8,"width":0,"height":0,"passthru":false,"mode":"text","delay":"0","topic":"openAger/fridge1/set/boosterdelay","x":810,"y":1260,"wires":[["cc4f87dc.b00118"]]},{"id":"1db9b832.0002b8","type":"ui_text_input","z":"efbc7696.354458","name":"circtime","label":"Circulation Time","group":"b09a98a.6139868","order":3,"width":0,"height":0,"passthru":false,"mode":"text","delay":"0","topic":"openAger/fridge1/set/circtime","x":800,"y":1300,"wires":[["cc4f87dc.b00118"]]},{"id":"38a153f5.7c7f9c","type":"ui_text_input","z":"efbc7696.354458","name":"circdelay","label":"Circulation Delay","group":"b09a98a.6139868","order":4,"width":0,"height":0,"passthru":false,"mode":"text","delay":"0","topic":"openAger/fridge1/set/circdelay","x":800,"y":1340,"wires":[["cc4f87dc.b00118"]]},{"id":"4dabe6d1.d31cd8","type":"ui_text_input","z":"efbc7696.354458","name":"uvctime","label":"UVC Time","group":"b09a98a.6139868","order":10,"width":0,"height":0,"passthru":false,"mode":"text","delay":"0","topic":"openAger/fridge1/set/uvctime","x":800,"y":1380,"wires":[["cc4f87dc.b00118"]]},{"id":"9c478f69.f701b","type":"ui_text_input","z":"efbc7696.354458","name":"uvcdelay","label":"UVC Delay","group":"b09a98a.6139868","order":11,"width":0,"height":0,"passthru":false,"mode":"text","delay":"0","topic":"openAger/fridge1/set/uvcdelay","x":800,"y":1420,"wires":[["cc4f87dc.b00118"]]},{"id":"dc276f69.90845","type":"ui_dropdown","z":"efbc7696.354458","name":"uvcmode","label":"UVC Mode","place":"","group":"b09a98a.6139868","order":9,"width":0,"height":0,"passthru":false,"options":[{"label":"static timings","value":"0","type":"str"},{"label":"override","value":"99","type":"str"}],"payload":"","topic":"openAger/fridge1/set/uvcmode","x":800,"y":1180,"wires":[["cc4f87dc.b00118"]]},{"id":"81765bad.73f7b8","type":"function","z":"37fce5bb.18d03a","name":"C=1000/1000","func":"msg.set_circmode = '0';\nmsg.set_circtime = '500';\nmsg.set_circdelay = '500';\nreturn msg;\n","outputs":1,"noerr":0,"x":1180,"y":140,"wires":[["98cff5a3.9b1638","e4218595.e63ab8"]]},{"id":"9104459e.09cb08","type":"function","z":"efbc7696.354458","name":"Sensor Checks","func":"error = {}\n//error = null;\n\n\n//place all rules here\n\n// Offline alert\nif (msg.topic == \"OFFLINE\") {\n error.topic = \"Fridge 1 is offline!\";\n error.payload = \"Please check network connection and power supply!\";\n\n} \n\nif (msg.topic == \"TEMP_ERROR\" && msg.payload > 1 ) {\n error.topic = \"Temperature deviation!\";\n error.payload = \"Please check the fridge - internal temperature is out of its hysterese area!\";\n\n} \n\n// Hum sensor\nif (msg.topic == \"openAger/fridge1/sensors/hum1\" && msg.payload < 1 ) {\n error.topic = \"Sensor Hum1 not plausible!\";\n error.payload = \"Please check wiring and environment! Sensor is out of expexted range!\";\n\n} \n\n\n\nreturn [ msg, error ];","outputs":2,"noerr":0,"x":1160,"y":2040,"wires":[[],["bd35c15b.85ef3"]]},{"id":"bd35c15b.85ef3","type":"delay","z":"efbc7696.354458","name":"","pauseType":"queue","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"5","rateUnits":"minute","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":true,"x":1460,"y":2040,"wires":[["20532b2b.ad0844"]]},{"id":"97934c4d.e9f9","type":"ui_gauge","z":"efbc7696.354458","name":"G_dewpoint","group":"b7af05c9.acc5c8","order":6,"width":0,"height":0,"gtype":"gage","title":"Dewpoint","label":"°C","format":"{{value | number:2}}","min":"-10","max":"30","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":1310,"y":2900,"wires":[]},{"id":"b3cd9e73.0f42e","type":"ui_gauge","z":"efbc7696.354458","name":"G_Temp_ext","group":"b7af05c9.acc5c8","order":4,"width":0,"height":0,"gtype":"gage","title":"Temperature ext.","label":"°C","format":"{{value | number:2}}","min":"-5","max":"35","colors":["#00b500","#e6e600","#ca3838"],"seg1":"4","seg2":"10","x":1310,"y":2420,"wires":[]},{"id":"c49a8a00.b36908","type":"ui_gauge","z":"efbc7696.354458","name":"G_Hum ext","group":"77fea715.4f11c8","order":4,"width":0,"height":0,"gtype":"gage","title":"Humidity ext.","label":"%","format":"{{value | number:2}}","min":0,"max":"100","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":1310,"y":2720,"wires":[]},{"id":"9336f32b.75a08","type":"ui_gauge","z":"efbc7696.354458","name":"G_Temp_int","group":"b7af05c9.acc5c8","order":1,"width":0,"height":0,"gtype":"gage","title":"Temperature int.","label":"°C","format":"{{value | number:2}}","min":"-5","max":"30","colors":["#00b500","#e6e600","#ca3838"],"seg1":"4","seg2":"10","x":1310,"y":2380,"wires":[]},{"id":"b896923c.08b53","type":"ui_gauge","z":"efbc7696.354458","name":"G_Hum_int","group":"77fea715.4f11c8","order":1,"width":0,"height":0,"gtype":"gage","title":"Humidity int.","label":"%","format":"{{value | number:2}}","min":0,"max":"100","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":1310,"y":2680,"wires":[]},{"id":"d4ed8231.e9957","type":"ui_button","z":"bfb0b9c4.4e1408","name":"","group":"3ead58e1.865bd8","order":6,"width":"1","height":"1","passthru":false,"label":"H","color":"","bgcolor":"","icon":"chevron_left","payload":"","payloadType":"str","topic":"minus1h","x":150,"y":1880,"wires":[["52fdaac6.7fafd4","d37ea009.d0b04"]]},{"id":"7f6dbaf.c96b844","type":"ui_button","z":"bfb0b9c4.4e1408","name":"","group":"3ead58e1.865bd8","order":7,"width":"1","height":"1","passthru":false,"label":"H","color":"","bgcolor":"","icon":"chevron_right","payload":"","payloadType":"str","topic":"plus1h","x":150,"y":1920,"wires":[["52fdaac6.7fafd4","d37ea009.d0b04"]]},{"id":"f51d8baf.ece8b8","type":"ui_button","z":"efbc7696.354458","name":"Reboot","group":"ca61f135.42042","order":9,"width":0,"height":0,"passthru":false,"label":"Reboot","tooltip":"","color":"","bgcolor":"","icon":"fa-sync","payload":"1","payloadType":"str","topic":"openAger/fridge1/set/reboot","x":1260,"y":420,"wires":[["9c8d165.2f9aae8"]]},{"id":"9c8d165.2f9aae8","type":"mqtt out","z":"efbc7696.354458","name":"fridge1 no retain","topic":"","qos":"","retain":"false","broker":"4841307a.c2f52","x":1560,"y":1480,"wires":[]},{"id":"a4e24ab7.e8efa8","type":"function","z":"efbc7696.354458","name":"Log Collector","func":"var list = context.get(\"statusList\") || [];\nvar now = new Date();\nvar hours = now.getHours();\nvar minutes = now.getMinutes();\nvar seconds = now.getSeconds();\n\nhours = (\"0\" + hours).slice(-2);\nminutes = (\"0\" + minutes).slice(-2);\nseconds = (\"0\" + seconds).slice(-2);\n\nvar entry = hours + \":\" + minutes + \":\" + seconds + \": \" + msg.payload + \"<br>\";\nlist.push(entry);\nif (list.length > 10) {\n list = list.slice(-10);\n}\ncontext.set(\"statusList\", list);\nmsg.payload = list.join(\"\");\nreturn msg;","outputs":1,"noerr":0,"x":1070,"y":1760,"wires":[["5f1a3c83.0d9654"]]},{"id":"5f1a3c83.0d9654","type":"ui_template","z":"efbc7696.354458","group":"ca61f135.42042","name":"Log","order":10,"width":"6","height":"6","format":"<b>Log:</B><font size=-1><div ng-bind-html=\"msg.payload\"></div></font>","storeOutMessages":true,"fwdInMessages":true,"templateScope":"local","x":1230,"y":1760,"wires":[[]]},{"id":"f19d8270.85b3b","type":"function","z":"efbc7696.354458","name":"add Time","func":"var entry = [];\nvar now = new Date();\nvar month = now.getMonth()+1;\nvar day = now.getDay();\nvar hours = now.getHours();\nvar minutes = now.getMinutes();\nvar seconds = now.getSeconds();\n\nhours = (\"0\" + hours).slice(-2);\nminutes = (\"0\" + minutes).slice(-2);\nseconds = (\"0\" + seconds).slice(-2);\n\nmonth = (\"0\" + month).slice(-2);\nday = (\"0\" + day).slice(-2);\n\nentry = day + \".\" + month + \". \" + hours + \":\" + minutes + \":\" + seconds + \": \" + msg.payload;\nmsg.payload = entry; \nreturn msg;","outputs":1,"noerr":0,"x":1060,"y":1840,"wires":[["d79ce2d8.78362"]]},{"id":"20532b2b.ad0844","type":"function","z":"efbc7696.354458","name":"block empty payloads","func":"if (msg.payload) {\nreturn msg;\n}","outputs":1,"noerr":0,"x":1680,"y":2040,"wires":[["2f26c5da.880c2a"]]},{"id":"b8f08fa0.9aba8","type":"comment","z":"abcf932e.43e39","name":"Scales and Measurements","info":"","x":170,"y":40,"wires":[]},{"id":"c7d27c16.c474a","type":"ui_template","z":"efbc7696.354458","group":"88d811d7.ca6bf","name":"Howto calibrate","order":1,"width":0,"height":0,"format":"<ol>\n <li>remove any weight from scale x</li>\n <li>push \"reset\" on scale page for the corresponding scale x</li>\n <li>put known weight (eg. 995 gram) on scale x</li>\n <li>adjust \"set scale x\" until the weight matches</li>\n </ol>\n Weight = Offsets + acutal Readings.<br>\n Offsets are just to \"remember\" the last weight before a reboot. Just dont touch them.","storeOutMessages":false,"fwdInMessages":false,"templateScope":"local","x":1540,"y":2260,"wires":[[]]},{"id":"2a08e591.51b2ca","type":"ui_button","z":"abcf932e.43e39","name":"","group":"e7c3e799.f86b28","order":1,"width":"3","height":"1","passthru":false,"label":"Start","color":"","bgcolor":"","icon":"fa-play","payload":"","payloadType":"date","topic":"","x":110,"y":420,"wires":[["ce93a998.93c678"]]},{"id":"487ac15e.f18b4","type":"ui_button","z":"abcf932e.43e39","name":"","group":"e7c3e799.f86b28","order":2,"width":"3","height":"1","passthru":false,"label":"Stop","color":"","bgcolor":"darkred","icon":"fa-stop","payload":"STOP","payloadType":"str","topic":"","x":110,"y":460,"wires":[["ce93a998.93c678"]]},{"id":"ce93a998.93c678","type":"function","z":"abcf932e.43e39","name":"Set Global","func":"\n// msg wenn laufend\nmsg1 = {} // wenn stop\nmsg2 = {} // Dumpformat!\n\nif (msg.payload == 'STOP') { \n\tglobal.set(\"scaletime2\",0);\n\n msg = null;\n \n\tmsg1.payload= 0;\n\tmsg1.payload.scaletime2 = 0;\n\n msg2.payload = {\n \"scaletime2\": 0,\n \"weight2\": 0,\n \"startweight2\":0,\n }\n\n\n} else {\n\tglobal.set(\"scaletime2\",msg.payload);\n\tglobal.set(\"startweight2\",global.get(\"weight2\"));\n\t\n\n\tmsg.payload.scaletime2 = global.get(\"scaletime2\");\n msg.payload.weight2 = global.get(\"weight2\");\n msg.payload.startweight2 = global.get(\"startweight2\");\n \n msg1 = null;\n \n msg2.payload = {\n \"scaletime2\": global.get(\"scaletime2\"),\n \"weight2\": global.get(\"weight2\"),\n \"startweight2\":global.get(\"startweight2\"),\n }\n\n}\n\nreturn [ msg, msg1, msg2 ];","outputs":3,"noerr":0,"x":390,"y":440,"wires":[["ee17fe9a.be887"],["c7ef6ac5.518518"],["e6c9ddf.b34db2","b50e484f.67c458"]]},{"id":"ec118324.d2b2f","type":"file","z":"abcf932e.43e39","name":"Dump_Starterinfo","filename":"/data/scale2.dump","appendNewline":false,"createDir":false,"overwriteFile":"true","x":810,"y":480,"wires":[[]]},{"id":"c1b4513c.0e6bc","type":"function","z":"abcf932e.43e39","name":"Set Global","func":"\nglobal.set(\"scaletime2\",msg.payload.scaletime2);\nglobal.set(\"weight2\",msg.payload.weight2);\nglobal.set(\"startweight2\",msg.payload.startweight2);\n\nreturn msg;","outputs":1,"noerr":0,"x":730,"y":540,"wires":[["ee17fe9a.be887","b50e484f.67c458"]]},{"id":"49c1290c.c42a98","type":"file in","z":"abcf932e.43e39","name":"Read Dump_Starterinfo","filename":"/data/scale2.dump","format":"utf8","sendError":false,"x":390,"y":540,"wires":[["5bd0657.14f8b9c"]]},{"id":"aa665635.9ef368","type":"inject","z":"abcf932e.43e39","name":"Auto Startup","repeat":"","crontab":"","once":true,"onceDelay":"","topic":"","payload":"","payloadType":"date","x":150,"y":540,"wires":[["49c1290c.c42a98"]]},{"id":"c7ef6ac5.518518","type":"ui_text","z":"abcf932e.43e39","group":"e7c3e799.f86b28","order":3,"width":0,"height":0,"name":"started","label":"Started","format":"{{msg.payload}}","layout":"row-spread","x":1250,"y":420,"wires":[]},{"id":"ee17fe9a.be887","type":"moment","z":"abcf932e.43e39","name":"","topic":"","input":"payload.scaletime2","inputType":"msg","inTz":"Europe/Vienna","adjAmount":0,"adjType":"days","adjDir":"add","format":"DD.MM.YYYY HH:mm","locale":"C","output":"payload","outputType":"msg","outTz":"Europe/Vienna","x":880,"y":380,"wires":[["879bb741.cd14d8"]]},{"id":"879bb741.cd14d8","type":"function","z":"abcf932e.43e39","name":"Empty payload","func":"if (msg.payload == \"01.01.1970 01:00\") {\n msg.payload = \"aus\";\n }\nreturn msg; ","outputs":1,"noerr":0,"x":1100,"y":380,"wires":[["c7ef6ac5.518518"]]},{"id":"e6c9ddf.b34db2","type":"json","z":"abcf932e.43e39","name":"","property":"payload","action":"","pretty":false,"x":570,"y":480,"wires":[["ec118324.d2b2f"]]},{"id":"5bd0657.14f8b9c","type":"json","z":"abcf932e.43e39","name":"","x":570,"y":540,"wires":[["c1b4513c.0e6bc"]]},{"id":"4f631416.33b09c","type":"ui_button","z":"abcf932e.43e39","name":"","group":"39b2ec86.601ea4","order":1,"width":"3","height":"1","passthru":false,"label":"Start","color":"","bgcolor":"","icon":"fa-play","payload":"","payloadType":"date","topic":"","x":90,"y":680,"wires":[["76a0f60e.e2abf8"]]},{"id":"bc5e5428.e0dd18","type":"ui_button","z":"abcf932e.43e39","name":"","group":"39b2ec86.601ea4","order":2,"width":"3","height":"1","passthru":false,"label":"Stop","color":"","bgcolor":"darkred","icon":"fa-stop","payload":"STOP","payloadType":"str","topic":"","x":90,"y":720,"wires":[["76a0f60e.e2abf8"]]},{"id":"76a0f60e.e2abf8","type":"function","z":"abcf932e.43e39","name":"Set Global","func":"\n// msg wenn laufend\nmsg1 = {} // wenn stop\nmsg2 = {} // Dumpformat!\n\nif (msg.payload == 'STOP') { \n\tglobal.set(\"scaletime3\",0);\n\n msg = null;\n \n\tmsg1.payload= 0;\n\tmsg1.payload.scaletime3 = 0;\n\n msg2.payload = {\n \"scaletime3\": 0,\n \"weight3\": 0,\n \"startweight3\":0,\n }\n\n\n} else {\n\tglobal.set(\"scaletime3\",msg.payload);\n\tglobal.set(\"startweight3\",global.get(\"weight3\"));\n\t\n\n\tmsg.payload.scaletime3 = global.get(\"scaletime3\");\n msg.payload.weight3 = global.get(\"weight3\");\n msg.payload.startweight3 = global.get(\"startweight3\");\n \n msg1 = null;\n \n msg2.payload = {\n \"scaletime3\": global.get(\"scaletime3\"),\n \"weight3\": global.get(\"weight3\"),\n \"startweight3\":global.get(\"startweight3\"),\n }\n\n}\n\nreturn [ msg, msg1, msg2 ];","outputs":3,"noerr":0,"x":370,"y":700,"wires":[["e85a57bf.f2a528"],["da6644dc.7cbd18"],["252659dd.f5b656","e75aa57.0cb3358"]]},{"id":"7a966c7d.7fe914","type":"file","z":"abcf932e.43e39","name":"Dump_Starterinfo","filename":"/data/scale3.dump","appendNewline":false,"createDir":false,"overwriteFile":"true","x":810,"y":740,"wires":[[]]},{"id":"49872f68.2aa15","type":"function","z":"abcf932e.43e39","name":"Set Global","func":"\nglobal.set(\"scaletime3\",msg.payload.scaletime3);\nglobal.set(\"weight3\",msg.payload.weight3);\nglobal.set(\"startweight3\",msg.payload.startweight3);\n\nreturn msg;","outputs":1,"noerr":0,"x":710,"y":800,"wires":[["e85a57bf.f2a528","252659dd.f5b656"]]},{"id":"66b28f92.6c5c7","type":"file in","z":"abcf932e.43e39","name":"Read Dump_Starterinfo","filename":"/data/scale3.dump","format":"utf8","sendError":false,"x":370,"y":800,"wires":[["4dfe87ae.9c5b18"]]},{"id":"d2289a6f.e09608","type":"inject","z":"abcf932e.43e39","name":"Auto Startup","repeat":"","crontab":"","once":true,"onceDelay":"","topic":"","payload":"","payloadType":"date","x":130,"y":800,"wires":[["66b28f92.6c5c7"]]},{"id":"da6644dc.7cbd18","type":"ui_text","z":"abcf932e.43e39","group":"39b2ec86.601ea4","order":3,"width":0,"height":0,"name":"started","label":"Started","format":"{{msg.payload}}","layout":"row-spread","x":1230,"y":700,"wires":[]},{"id":"e85a57bf.f2a528","type":"moment","z":"abcf932e.43e39","name":"","topic":"","input":"payload.scaletime3","inputType":"msg","inTz":"Europe/Vienna","adjAmount":0,"adjType":"days","adjDir":"add","format":"DD.MM.YYYY HH:mm","locale":"C","output":"payload","outputType":"msg","outTz":"Europe/Vienna","x":860,"y":640,"wires":[["30ef5e7.387c5a2"]]},{"id":"30ef5e7.387c5a2","type":"function","z":"abcf932e.43e39","name":"Empty payload","func":"if (msg.payload == \"01.01.1970 01:00\") {\n msg.payload = \"aus\";\n }\nreturn msg; ","outputs":1,"noerr":0,"x":1060,"y":640,"wires":[["da6644dc.7cbd18"]]},{"id":"e75aa57.0cb3358","type":"json","z":"abcf932e.43e39","name":"","property":"payload","action":"","pretty":false,"x":550,"y":740,"wires":[["7a966c7d.7fe914"]]},{"id":"4dfe87ae.9c5b18","type":"json","z":"abcf932e.43e39","name":"","x":550,"y":800,"wires":[["49872f68.2aa15"]]},{"id":"9f4dbe3e.089a1","type":"ui_button","z":"abcf932e.43e39","name":"","group":"fbe9ae29.de1a7","order":1,"width":"3","height":"1","passthru":false,"label":"Start","color":"","bgcolor":"","icon":"fa-play","payload":"","payloadType":"date","topic":"","x":90,"y":980,"wires":[["6a6fc64e.a726a8"]]},{"id":"af3576c3.5e6668","type":"ui_button","z":"abcf932e.43e39","name":"","group":"fbe9ae29.de1a7","order":2,"width":"3","height":"1","passthru":false,"label":"Stop","color":"","bgcolor":"darkred","icon":"fa-stop","payload":"STOP","payloadType":"str","topic":"","x":90,"y":1020,"wires":[["6a6fc64e.a726a8"]]},{"id":"6a6fc64e.a726a8","type":"function","z":"abcf932e.43e39","name":"Set Global","func":"\n// msg wenn laufend\nmsg1 = {} // wenn stop\nmsg2 = {} // Dumpformat!\n\nif (msg.payload == 'STOP') { \n\tglobal.set(\"scaletime4\",0);\n\n msg = null;\n \n\tmsg1.payload= 0;\n\tmsg1.payload.scaletime4 = 0;\n\n msg2.payload = {\n \"scaletime4\": 0,\n \"weight4\": 0,\n \"startweight4\":0,\n }\n\n\n} else {\n\tglobal.set(\"scaletime4\",msg.payload);\n\tglobal.set(\"startweight4\",global.get(\"weight4\"));\n\t\n\n\tmsg.payload.scaletime4 = global.get(\"scaletime4\");\n msg.payload.weight4 = global.get(\"weight4\");\n msg.payload.startweight4 = global.get(\"startweight4\");\n \n msg1 = null;\n \n msg2.payload = {\n \"scaletime4\": global.get(\"scaletime4\"),\n \"weight4\": global.get(\"weight4\"),\n \"startweight4\":global.get(\"startweight4\"),\n }\n\n}\n\nreturn [ msg, msg1, msg2 ];","outputs":3,"noerr":0,"x":370,"y":1000,"wires":[["665263ee.90359c"],["988bcd60.4014d"],["920c7433.927ed8","57b2d0ff.a71d1"]]},{"id":"979fb78.7ff7348","type":"file","z":"abcf932e.43e39","name":"Dump_Starterinfo","filename":"/data/scale4.dump","appendNewline":false,"createDir":false,"overwriteFile":"true","x":790,"y":1040,"wires":[[]]},{"id":"b725c1b1.7584","type":"function","z":"abcf932e.43e39","name":"Set Global","func":"\nglobal.set(\"scaletime4\",msg.payload.scaletime4);\nglobal.set(\"weight4\",msg.payload.weight4);\nglobal.set(\"startweight4\",msg.payload.startweight4);\n\nreturn msg;","outputs":1,"noerr":0,"x":710,"y":1100,"wires":[["665263ee.90359c","57b2d0ff.a71d1"]]},{"id":"6404034d.c27ddc","type":"file in","z":"abcf932e.43e39","name":"Read Dump_Starterinfo","filename":"/data/scale4.dump","format":"utf8","sendError":false,"x":370,"y":1100,"wires":[["d2fd4017.f243e"]]},{"id":"26a49888.4e1168","type":"inject","z":"abcf932e.43e39","name":"Auto Startup","repeat":"","crontab":"","once":true,"onceDelay":"","topic":"","payload":"","payloadType":"date","x":130,"y":1100,"wires":[["6404034d.c27ddc"]]},{"id":"988bcd60.4014d","type":"ui_text","z":"abcf932e.43e39","group":"fbe9ae29.de1a7","order":3,"width":0,"height":0,"name":"started","label":"Started","format":"{{msg.payload}}","layout":"row-spread","x":1230,"y":1000,"wires":[]},{"id":"665263ee.90359c","type":"moment","z":"abcf932e.43e39","name":"","topic":"","input":"payload.scaletime4","inputType":"msg","inTz":"Europe/Vienna","adjAmount":0,"adjType":"days","adjDir":"add","format":"DD.MM.YYYY HH:mm","locale":"C","output":"payload","outputType":"msg","outTz":"Europe/Vienna","x":840,"y":940,"wires":[["caf435fd.3f6828"]]},{"id":"caf435fd.3f6828","type":"function","z":"abcf932e.43e39","name":"Empty payload","func":"if (msg.payload == \"01.01.1970 01:00\") {\n msg.payload = \"aus\";\n }\nreturn msg; ","outputs":1,"noerr":0,"x":1040,"y":940,"wires":[["988bcd60.4014d"]]},{"id":"920c7433.927ed8","type":"json","z":"abcf932e.43e39","name":"","property":"payload","action":"","pretty":false,"x":570,"y":1040,"wires":[["979fb78.7ff7348"]]},{"id":"d2fd4017.f243e","type":"json","z":"abcf932e.43e39","name":"","x":550,"y":1100,"wires":[["b725c1b1.7584"]]},{"id":"54204f15.6c9be","type":"subflow:abcf932e.43e39","z":"efbc7696.354458","x":410,"y":60,"wires":[]},{"id":"2e60902a.35753","type":"ui_gauge","z":"efbc7696.354458","name":"H_Temp_Dev","group":"63a78f03.20929","order":3,"width":0,"height":0,"gtype":"gage","title":"Temperature Deviation","label":"°C off hysterese","format":"{{value | number:2}}","min":"-0.5","max":"0.5","colors":["#ca3737","#00b500","#ca3838"],"seg1":"-0.1","seg2":"0.1","x":1080,"y":2460,"wires":[]},{"id":"da22106b.2c0ab","type":"function","z":"efbc7696.354458","name":"Calculation","func":"\n\ntemp_int = parseFloat(msg.payload);\nset_hyst = parseFloat(global.get(\"set_hyst\"));\nset_temp = parseFloat(global.get(\"set_temp\"));\n\n\nif (temp_int > set_temp + ( set_hyst / 2 )) {\n msg.payload = temp_int - (set_temp +( set_hyst / 2 ));\n} else if (temp_int < set_temp - ( set_hyst / 2 )) {\n msg.payload = temp_int - (set_temp - ( set_hyst / 2 ));\n\n} else {\n // within hysterese!\n msg.payload = 0;\n}\n\nmsg.topic = \"TEMP_ERROR\";\nreturn msg;","outputs":1,"noerr":0,"x":970,"y":2140,"wires":[["9104459e.09cb08","979f0038.fb835","2e60902a.35753"]]},{"id":"7d5d4556.41763c","type":"function","z":"efbc7696.354458","name":"settings to context","func":"\nif (msg.topic == 'openAger/fridge1/set/temp') {\n global.set(\"set_temp\",msg.payload);\n} else if (msg.topic == 'openAger/fridge1/set/hyst') {\n global.set(\"set_hyst\",msg.payload);\n}\n\nreturn msg;","outputs":1,"noerr":0,"x":1710,"y":820,"wires":[[]]},{"id":"a7a94add.073638","type":"function","z":"efbc7696.354458","name":"Emailtext","func":"msg.topic = \"ALERT: Fridge offline!\";\nmsg.payload = \"Please check power, internet connection etc!\";\nreturn msg;\n","outputs":1,"noerr":0,"x":1220,"y":2180,"wires":[["bd35c15b.85ef3"]]},{"id":"730b4382.d8291c","type":"subflow:53ff1e9.5b961e","z":"bfb0b9c4.4e1408","x":960,"y":900,"wires":[]},{"id":"3763150b.da0e4a","type":"ui_gauge","z":"efbc7696.354458","name":"G_CPU Temp","group":"43f2495e.96eb28","order":5,"width":0,"height":0,"gtype":"gage","title":"CPU Temp","label":"°C","format":"{{value | number:2}}","min":0,"max":"100","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":1320,"y":2540,"wires":[]},{"id":"979f0038.fb835","type":"function","z":"efbc7696.354458","name":"Emailtext","func":"\nif (msg.payload > 0.5) {\n\ntopic = \"ALERT: Temperature deviation!\";\nmsg.payload = \"Please check your fridge - we are more than 1 degree off the hysterese!!\";\nreturn msg;\n\n}","outputs":1,"noerr":0,"x":1220,"y":2140,"wires":[["bd35c15b.85ef3"]]},{"id":"b50e484f.67c458","type":"ui_text","z":"abcf932e.43e39","group":"e7c3e799.f86b28","order":3,"width":0,"height":0,"name":"startweight2","label":"Startweight","format":"{{msg.payload.startweight2}} kg","layout":"row-spread","x":1270,"y":480,"wires":[]},{"id":"252659dd.f5b656","type":"ui_text","z":"abcf932e.43e39","group":"39b2ec86.601ea4","order":3,"width":0,"height":0,"name":"startweight3","label":"Startweight","format":"{{msg.payload.startweight3}} kg","layout":"row-spread","x":1250,"y":740,"wires":[]},{"id":"57b2d0ff.a71d1","type":"ui_text","z":"abcf932e.43e39","group":"fbe9ae29.de1a7","order":3,"width":0,"height":0,"name":"startweight4","label":"Startweight","format":"{{msg.payload.startweight4}} kg","layout":"row-spread","x":1250,"y":1040,"wires":[]},{"id":"24485e55.e20652","type":"ui_button","z":"abcf932e.43e39","name":"","group":"91134a7a.5c7bb8","order":1,"width":"3","height":"1","passthru":false,"label":"Start","color":"","bgcolor":"","icon":"fa-play","payload":"","payloadType":"date","topic":"","x":110,"y":140,"wires":[["363ad065.776a6"]]},{"id":"71493e23.f0db5","type":"ui_button","z":"abcf932e.43e39","name":"","group":"91134a7a.5c7bb8","order":2,"width":"3","height":"1","passthru":false,"label":"Stop","color":"","bgcolor":"darkred","icon":"fa-stop","payload":"STOP","payloadType":"str","topic":"","x":110,"y":180,"wires":[["363ad065.776a6"]]},{"id":"363ad065.776a6","type":"function","z":"abcf932e.43e39","name":"Set Global","func":"\n// msg wenn laufend\nmsg1 = {} // wenn stop\nmsg2 = {} // Dumpformat!\n\nif (msg.payload == 'STOP') { \n\tglobal.set(\"scaletime1\",0);\n\n msg = null;\n \n\tmsg1.payload= 0;\n\tmsg1.payload.scaletime1 = 0;\n\n msg2.payload = {\n \"scaletime1\": 0,\n \"weight1\": 0,\n \"startweight1\":0,\n }\n\n\n} else {\n\tglobal.set(\"scaletime1\",msg.payload);\n\tglobal.set(\"startweight1\",global.get(\"weight1\"));\n\t\n\n\tmsg.payload.scaletime1 = global.get(\"scaletime1\");\n msg.payload.weight1 = global.get(\"weight1\");\n msg.payload.startweight1 = global.get(\"startweight1\");\n\n msg1 = null;\n \n msg2.payload = {\n \"scaletime1\": global.get(\"scaletime1\"),\n \"weight1\": global.get(\"weight1\"),\n \"startweight1\":global.get(\"startweight1\"),\n }\n\n}\n\nreturn [ msg, msg1, msg2 ];","outputs":3,"noerr":0,"x":390,"y":160,"wires":[["745742e3.af7c3c"],["84e77426.140138"],["663e622c.2a70ac","35b8586f.b04208"]]},{"id":"46f2b501.5db80c","type":"file","z":"abcf932e.43e39","name":"Dump_Starterinfo","filename":"/data/scale1.dump","appendNewline":false,"createDir":false,"overwriteFile":"true","x":730,"y":200,"wires":[[]]},{"id":"a347b7bd.3ea888","type":"function","z":"abcf932e.43e39","name":"Set Global","func":"\nglobal.set(\"scaletime1\",msg.payload.scaletime1);\nglobal.set(\"weight1\",msg.payload.weight1);\nglobal.set(\"startweight1\",msg.payload.startweight1);\n\nreturn msg;","outputs":1,"noerr":0,"x":730,"y":260,"wires":[["745742e3.af7c3c","35b8586f.b04208"]]},{"id":"5c2d75e.a9e948c","type":"file in","z":"abcf932e.43e39","name":"Read Dump_Starterinfo","filename":"/data/scale1.dump","format":"utf8","sendError":false,"x":390,"y":260,"wires":[["49b47391.6ad4cc"]]},{"id":"a93a3e3c.db3d","type":"inject","z":"abcf932e.43e39","name":"Auto Startup","repeat":"","crontab":"","once":true,"onceDelay":"","topic":"","payload":"","payloadType":"date","x":150,"y":260,"wires":[["5c2d75e.a9e948c"]]},{"id":"84e77426.140138","type":"ui_text","z":"abcf932e.43e39","group":"91134a7a.5c7bb8","order":3,"width":0,"height":0,"name":"started","label":"Started","format":"{{msg.payload}}","layout":"row-spread","x":1350,"y":160,"wires":[]},{"id":"745742e3.af7c3c","type":"moment","z":"abcf932e.43e39","name":"","topic":"","input":"payload.scaletime1","inputType":"msg","inTz":"Europe/Vienna","adjAmount":0,"adjType":"days","adjDir":"add","format":"DD.MM.YYYY HH:mm","locale":"C","output":"payload","outputType":"msg","outTz":"Europe/Vienna","x":980,"y":120,"wires":[["e4c09c6a.b4091"]]},{"id":"e4c09c6a.b4091","type":"function","z":"abcf932e.43e39","name":"Empty payload","func":"if (msg.payload == \"01.01.1970 01:00\") {\n msg.payload = \"aus\";\n }\nreturn msg; ","outputs":1,"noerr":0,"x":1200,"y":120,"wires":[["84e77426.140138"]]},{"id":"663e622c.2a70ac","type":"json","z":"abcf932e.43e39","name":"","property":"payload","action":"","pretty":false,"x":570,"y":200,"wires":[["46f2b501.5db80c"]]},{"id":"49b47391.6ad4cc","type":"json","z":"abcf932e.43e39","name":"","x":570,"y":260,"wires":[["a347b7bd.3ea888"]]},{"id":"35b8586f.b04208","type":"ui_text","z":"abcf932e.43e39","group":"91134a7a.5c7bb8","order":3,"width":0,"height":0,"name":"startweight1","label":"Startweight","format":"{{msg.payload.startweight1}} kg","layout":"row-spread","x":1370,"y":200,"wires":[]},{"id":"3a6261c6.832a5e","type":"function","z":"bfb0b9c4.4e1408","name":"Runtime/Restzeit","func":"/*\nData format:\n\nmsg.startzeit = timestamp\nmsg.mode = mode\nmsg.state = state\nmsg.runtime\nmsg.restzeit\nmsg.phase\n\n*/\n\n\nif (msg.state == 'on') {\nmsg.runtime = Date.now() - msg.startzeit;\nmsg.restzeit = 2 - ( msg.runtime /1000/60/60/24);\nmsg.finito = 0;\nreturn msg;\n} \n\n","outputs":1,"noerr":0,"x":990,"y":1000,"wires":[["a3df2952.445f48"]]},{"id":"a3df2952.445f48","type":"switch","z":"bfb0b9c4.4e1408","name":"Scheduler","property":"runtime","propertyType":"msg","rules":[{"t":"btwn","v":"0","vt":"jsonata","v2":"1000*5","v2t":"jsonata"},{"t":"gt","v":"1000*5","vt":"jsonata"}],"checkall":"true","repair":false,"outputs":2,"x":1320,"y":1000,"wires":[["c1fd3aef.d28f98"],["1850642d.99dbec"]]},{"id":"c1fd3aef.d28f98","type":"function","z":"bfb0b9c4.4e1408","name":"Phase 1","func":" msg.topic = 'openAger/fridge1/actuators/uvc';\n msg.payload = '1';","outputs":1,"noerr":0,"x":1580,"y":920,"wires":[["ff93315b.adc91","e27901fa.2fb23"]]},{"id":"1850642d.99dbec","type":"function","z":"bfb0b9c4.4e1408","name":"Finished!","func":"\nmsg2 = {}\n \n\nglobal.set(\"state\",\"off\");\nglobal.set(\"mode\", 0);\nglobal.set(\"startzeit\",0);\nmsg.state = \"off\";\nmsg.mode = '0';\nmsg.finito = '1';\n\nmsg2.topic = 'openAger/fridge1/actuators/uvc';\nmsg2.payload = '0';\n\nreturn [msg, msg2];\n\n","outputs":2,"noerr":0,"x":1580,"y":1060,"wires":[["e27901fa.2fb23","4df5369a.1a0c88"],["ff93315b.adc91"]]},{"id":"ff93315b.adc91","type":"mqtt out","z":"bfb0b9c4.4e1408","name":"Fridge1 retain","topic":"","qos":"","retain":"true","broker":"4841307a.c2f52","x":1980,"y":920,"wires":[]},{"id":"e27901fa.2fb23","type":"debug","z":"bfb0b9c4.4e1408","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":1900,"y":1100,"wires":[]},{"id":"d79ce2d8.78362","type":"ui_template","z":"efbc7696.354458","group":"bffb08b3.1b1fa8","name":"Alert","order":11,"width":"6","height":"3","format":"<b>Last Alert:</B><font size=-1><div ng-bind-html=\"msg.payload\"></div></font>","storeOutMessages":true,"fwdInMessages":true,"templateScope":"local","x":1230,"y":1840,"wires":[[]]},{"id":"ae7a659.b683398","type":"ui_text_input","z":"efbc7696.354458","name":"Offset Scale1","label":"Offset Scale1","group":"88d811d7.ca6bf","order":6,"width":0,"height":0,"passthru":false,"mode":"text","delay":"0","topic":"openAger/fridge1/set/offsetscale1","x":820,"y":640,"wires":[["cc4f87dc.b00118"]]},{"id":"65b69f35.ab8f2","type":"ui_text_input","z":"efbc7696.354458","name":"Offset Scale2","label":"Offset Scale2","group":"88d811d7.ca6bf","order":7,"width":0,"height":0,"passthru":false,"mode":"text","delay":"0","topic":"openAger/fridge1/set/offsetscale2","x":820,"y":680,"wires":[["cc4f87dc.b00118"]]},{"id":"c75d1b4f.176008","type":"ui_text_input","z":"efbc7696.354458","name":"Offset Scale3","label":"Offset Scale3","group":"88d811d7.ca6bf","order":8,"width":0,"height":0,"passthru":false,"mode":"text","delay":"0","topic":"openAger/fridge1/set/offsetscale3","x":820,"y":720,"wires":[["cc4f87dc.b00118"]]},{"id":"52a4f621.204418","type":"ui_text_input","z":"efbc7696.354458","name":"Offset Scale4","label":"Offset Scale4","group":"88d811d7.ca6bf","order":9,"width":0,"height":0,"passthru":false,"mode":"text","delay":"0","topic":"openAger/fridge1/set/offsetscale4","x":820,"y":760,"wires":[["cc4f87dc.b00118"]]},{"id":"d30b6bfc.cd9818","type":"e-mail","z":"efbc7696.354458","server":"smto.gmail.com","port":"465","secure":true,"name":"valki@valki.com","dname":"","x":1300,"y":1900,"wires":[]},{"id":"3b5d44cb.c118bc","type":"function","z":"efbc7696.354458","name":"Emailtext","func":"msg.topic = \"Email from fridge\";\n//msg.payload = \"Timestamp: \" + Date().toString() + \"\\n\" + msg.payload;\nreturn msg;\n","outputs":1,"noerr":0,"x":1080,"y":1900,"wires":[["d30b6bfc.cd9818"]]},{"id":"bda6e240.18bb6","type":"ui_text","z":"efbc7696.354458","group":"ca61f135.42042","order":7,"width":0,"height":0,"name":"H_Power","label":"Power","format":"{{msg.payload}}","layout":"row-spread","x":1060,"y":2940,"wires":[]},{"id":"7fd02ae3.5d6c04","type":"ui_dropdown","z":"efbc7696.354458","name":"hummode","label":"HumidityMode","tooltip":"","place":"","group":"b09a98a.6139868","order":1,"width":0,"height":0,"passthru":false,"options":[{"label":"auto","value":"0","type":"str"},{"label":"vents only","value":"1","type":"str"},{"label":"powermode","value":"2","type":"str"},{"label":"override","value":"99","type":"str"}],"payload":"","topic":"openAger/fridge1/set/hummode","x":800,"y":1460,"wires":[["cc4f87dc.b00118"]]},{"id":"f9411955.abe878","type":"ui_gauge","z":"efbc7696.354458","name":"G_aHum","group":"cc0499bb.626ad8","order":2,"width":0,"height":0,"gtype":"gage","title":"Absolute Humidity Int.","label":"g/m³","format":"{{value | number:2}}","min":0,"max":"15","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":1300,"y":2760,"wires":[]},{"id":"4d164004.215b3","type":"ui_gauge","z":"efbc7696.354458","name":"G_set aHum","group":"cc0499bb.626ad8","order":1,"width":0,"height":0,"gtype":"gage","title":"Set Absolute Humidity Int.","label":"g/m³","format":"{{value | number:2}}","min":0,"max":"10","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":1310,"y":2800,"wires":[]},{"id":"4c8dc328.6e926c","type":"ui_gauge","z":"efbc7696.354458","name":"G_vpsat","group":"cc0499bb.626ad8","order":3,"width":0,"height":0,"gtype":"gage","title":"Saturation Vapor Pressure","label":"Pa","format":"{{value | number:0}}","min":0,"max":"3000","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":1300,"y":3020,"wires":[]},{"id":"a8122dc9.d93c3","type":"ui_gauge","z":"efbc7696.354458","name":"G_vp part","group":"cc0499bb.626ad8","order":4,"width":0,"height":0,"gtype":"gage","title":"Partial Pressure of Vapor ","label":"Pa","format":"{{value | number:0}}","min":0,"max":"3000","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":1300,"y":2980,"wires":[]},{"id":"47940216.202a9c","type":"inject","z":"abcf932e.43e39","name":"","repeat":"10","crontab":"","once":true,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":130,"y":1260,"wires":[["3ef4b4a8.7eb76c"]]},{"id":"d2ade354.bf3d4","type":"ui_text","z":"abcf932e.43e39","group":"91134a7a.5c7bb8","order":3,"width":0,"height":0,"name":"daycount 1","label":"running","format":"{{msg.payload | number:1}} days","layout":"row-spread","x":930,"y":1200,"wires":[]},{"id":"3ef4b4a8.7eb76c","type":"function","z":"abcf932e.43e39","name":"daycounter","func":"msg1 = {} \nmsg2 = {} \nmsg3 = {} \nmsg4 = {} \n\nif (global.get(\"scaletime1\") > 0) {\nmsg1.payload = ( Date.now() - global.get(\"scaletime1\")) / 24 / 60 / 60 / 1000;\n} else {\n msg1.payload = 0;\n}\nif (global.get(\"scaletime2\") > 0) {\nmsg2.payload = ( Date.now() - global.get(\"scaletime2\")) / 24 / 60 / 60 / 1000;\n} else {\n msg2.payload = 0;\n}\nif (global.get(\"scaletime3\") > 0) {\nmsg3.payload = ( Date.now() - global.get(\"scaletime3\")) / 24 / 60 / 60 / 1000;\n} else {\n msg3.payload = 0;\n}\nif (global.get(\"scaletime4\") > 0) {\nmsg4.payload = ( Date.now() - global.get(\"scaletime4\")) / 24 / 60 / 60 / 1000;\n} else {\n msg4.payload = 0;\n}\nreturn [ msg1, msg2, msg3, msg4 ];","outputs":4,"noerr":0,"x":370,"y":1260,"wires":[["15d0bfc6.050ce"],["3d0e353b.9f971a"],["a7a72049.53d9c"],["18196d06.4850a3"]]},{"id":"c711091f.79f058","type":"ui_text","z":"abcf932e.43e39","group":"e7c3e799.f86b28","order":3,"width":0,"height":0,"name":"daycount 2","label":"running","format":"{{msg.payload | number:1}} days","layout":"row-spread","x":930,"y":1240,"wires":[]},{"id":"10eee08c.325e2f","type":"ui_text","z":"abcf932e.43e39","group":"39b2ec86.601ea4","order":3,"width":0,"height":0,"name":"daycount 3","label":"running","format":"{{msg.payload | number:1}} days","layout":"row-spread","x":930,"y":1280,"wires":[]},{"id":"aefa116f.0ec9","type":"ui_text","z":"abcf932e.43e39","group":"fbe9ae29.de1a7","order":3,"width":0,"height":0,"name":"daycount 4","label":"running","format":"{{msg.payload | number:1}} days","layout":"row-spread","x":930,"y":1320,"wires":[]},{"id":"3faa98a3.993de8","type":"ui_dropdown","z":"efbc7696.354458","name":"nosyschecks","label":"Systemchecks","tooltip":"","place":"","group":"d02bb676.9c8768","order":5,"width":0,"height":0,"passthru":false,"options":[{"label":"none","value":"0","type":"str"},{"label":"just check","value":"1","type":"str"},{"label":"check and react","value":"2","type":"str"}],"payload":"","topic":"openAger/fridge1/set/nosyscheck","x":810,"y":1500,"wires":[["cc4f87dc.b00118"]]},{"id":"bc0d7a4f.dd8f48","type":"mqtt in","z":"efbc7696.354458","name":"MQTT temperatures","topic":"openAger/fridge1/sensors/temperature","qos":"0","datatype":"auto","broker":"4841307a.c2f52","x":130,"y":2300,"wires":[["26ab9f2c.aed4e"]]},{"id":"26ab9f2c.aed4e","type":"json","z":"efbc7696.354458","name":"Json","property":"payload","action":"","pretty":false,"x":330,"y":2300,"wires":[["acb639e0.add3a8","880e7990.d0e528","f1cf4e6.192bbb","7a281eae.add12","fb5deae3.bb5e08","d7f41aad.2b68a8","a88ddd08.9fe86","96f59d1b.efbdd"]]},{"id":"acb639e0.add3a8","type":"change","z":"efbc7696.354458","name":"t1","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.t1","tot":"msg"},{"t":"set","p":"topic","pt":"msg","to":"temp_1","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":590,"y":2300,"wires":[["49b35de3.332724","2ad62b2f.bc7a94","f0f5a811.7fdfe8"]]},{"id":"880e7990.d0e528","type":"change","z":"efbc7696.354458","name":"t2","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.t2","tot":"msg"},{"t":"set","p":"topic","pt":"msg","to":"temp_2","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":590,"y":2340,"wires":[["a4157f54.9d5e5","2ad62b2f.bc7a94","f0f5a811.7fdfe8"]]},{"id":"f1cf4e6.192bbb","type":"change","z":"efbc7696.354458","name":"ti","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.ti","tot":"msg"},{"t":"set","p":"topic","pt":"msg","to":"temp_int","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":590,"y":2380,"wires":[["45ac43ce.9c400c","2ad62b2f.bc7a94","da22106b.2c0ab","f0f5a811.7fdfe8","604787a9.79f768"]]},{"id":"7a281eae.add12","type":"change","z":"efbc7696.354458","name":"te","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.te","tot":"msg"},{"t":"set","p":"topic","pt":"msg","to":"temp_ext","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":590,"y":2420,"wires":[["b3cd9e73.0f42e","131a219.892ccde","373a1b57.b38ea4","f0f5a811.7fdfe8"]]},{"id":"fb5deae3.bb5e08","type":"change","z":"efbc7696.354458","name":"tde","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.tde","tot":"msg"},{"t":"set","p":"topic","pt":"msg","to":"temp_dev","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":590,"y":2460,"wires":[["f0f5a811.7fdfe8"]]},{"id":"d7f41aad.2b68a8","type":"change","z":"efbc7696.354458","name":"tdi","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.tdi","tot":"msg"},{"t":"set","p":"topic","pt":"msg","to":"temp_diff","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":590,"y":2500,"wires":[[]]},{"id":"a88ddd08.9fe86","type":"change","z":"efbc7696.354458","name":"tc","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.tc","tot":"msg"},{"t":"set","p":"topic","pt":"msg","to":"temp_cpu","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":590,"y":2540,"wires":[["3763150b.da0e4a","f0f5a811.7fdfe8"]]},{"id":"4491ef8c.5b4a1","type":"mqtt in","z":"efbc7696.354458","name":"MQTT Humidity","topic":"openAger/fridge1/sensors/humidity","qos":"0","datatype":"auto","broker":"4841307a.c2f52","x":120,"y":2600,"wires":[["40e79151.e27d4"]]},{"id":"40e79151.e27d4","type":"json","z":"efbc7696.354458","name":"Json","property":"payload","action":"","pretty":false,"x":330,"y":2600,"wires":[["6a842ede.7a202","436be6d2.cd2cf8","446c45c.4dea9bc","349bcae8.38fc26","a633cb2e.378818","9d118a1f.d673c8","74721689.345088","48279d70.8018d4"]]},{"id":"6a842ede.7a202","type":"change","z":"efbc7696.354458","name":"h1","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.h1","tot":"msg"},{"t":"set","p":"topic","pt":"msg","to":"hum_1","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":590,"y":2600,"wires":[["cd8f46cc.d124e8","b18c1df6.cdfb8","56bdfc52.2ad184"]]},{"id":"436be6d2.cd2cf8","type":"change","z":"efbc7696.354458","name":"h2","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.h2","tot":"msg"},{"t":"set","p":"topic","pt":"msg","to":"hum_2","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":590,"y":2640,"wires":[["c3c278b3.2f25d8","b18c1df6.cdfb8","56bdfc52.2ad184"]]},{"id":"446c45c.4dea9bc","type":"change","z":"efbc7696.354458","name":"hi","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.hi","tot":"msg"},{"t":"set","p":"topic","pt":"msg","to":"hum_int","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":590,"y":2680,"wires":[["b896923c.08b53","b18c1df6.cdfb8","56bdfc52.2ad184","aa9258ff.d2a7c8"]]},{"id":"349bcae8.38fc26","type":"change","z":"efbc7696.354458","name":"ha","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.ha","tot":"msg"},{"t":"set","p":"topic","pt":"msg","to":"hum_absolut","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":590,"y":2760,"wires":[["f9411955.abe878","56bdfc52.2ad184"]]},{"id":"a633cb2e.378818","type":"change","z":"efbc7696.354458","name":"he","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.he","tot":"msg"},{"t":"set","p":"topic","pt":"msg","to":"hum_ext","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":590,"y":2720,"wires":[["c0a8ffef.f2a05","c49a8a00.b36908","2a4ea03d.abf04","56bdfc52.2ad184"]]},{"id":"9d118a1f.d673c8","type":"change","z":"efbc7696.354458","name":"hde","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.hde","tot":"msg"},{"t":"set","p":"topic","pt":"msg","to":"hum_dev","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":590,"y":2840,"wires":[[]]},{"id":"ed26d3ac.1bf78","type":"change","z":"efbc7696.354458","name":"hdi","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.hdi","tot":"msg"},{"t":"set","p":"topic","pt":"msg","to":"hum_diff","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":590,"y":3140,"wires":[[]]},{"id":"74721689.345088","type":"change","z":"efbc7696.354458","name":"has","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.has","tot":"msg"},{"t":"set","p":"topic","pt":"msg","to":"hum_absolut_set","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":590,"y":2800,"wires":[["4d164004.215b3"]]},{"id":"31a19251.90d9be","type":"mqtt in","z":"efbc7696.354458","name":"MQTT Special","topic":"openAger/fridge1/sensors/special","qos":"0","datatype":"auto","broker":"4841307a.c2f52","x":110,"y":2900,"wires":[["869ea1af.87042"]]},{"id":"869ea1af.87042","type":"json","z":"efbc7696.354458","name":"Json","property":"payload","action":"","pretty":false,"x":330,"y":2900,"wires":[["d191c0cd.8bbf5","f5dfbf45.ac0b6","c2a1a3ce.1cfb1","cf20a535.d62a18","5387a018.95b93","ed26d3ac.1bf78","bce52153.5caa1"]]},{"id":"d191c0cd.8bbf5","type":"change","z":"efbc7696.354458","name":"dp","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.dp","tot":"msg"},{"t":"set","p":"topic","pt":"msg","to":"dewpoint","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":590,"y":2900,"wires":[["97934c4d.e9f9","c2b38d59.42874"]]},{"id":"f5dfbf45.ac0b6","type":"change","z":"efbc7696.354458","name":"pw","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.pw","tot":"msg"},{"t":"set","p":"topic","pt":"msg","to":"power","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":590,"y":2940,"wires":[["bda6e240.18bb6","17cd9975.d9d427","c2b38d59.42874","c46444ef.243438"]]},{"id":"c2a1a3ce.1cfb1","type":"change","z":"efbc7696.354458","name":"vp","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.vp","tot":"msg"},{"t":"set","p":"topic","pt":"msg","to":"vap_pressure","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":590,"y":2980,"wires":[["a8122dc9.d93c3","c2b38d59.42874"]]},{"id":"97538940.c3c8f8","type":"change","z":"efbc7696.354458","name":"air","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.air","tot":"msg"},{"t":"set","p":"topic","pt":"msg","to":"air","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":570,"y":3820,"wires":[["be87177a.c89728","2d296cb8.5e0894","507b217c.d7281"]]},{"id":"cf20a535.d62a18","type":"change","z":"efbc7696.354458","name":"vs","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.vs","tot":"msg"},{"t":"set","p":"topic","pt":"msg","to":"vap_saturation","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":590,"y":3020,"wires":[["4c8dc328.6e926c","c2b38d59.42874"]]},{"id":"5387a018.95b93","type":"change","z":"efbc7696.354458","name":"uv","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.uv","tot":"msg"},{"t":"set","p":"topic","pt":"msg","to":"uv","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":590,"y":3100,"wires":[["8a1f239.4522be","c00a6bf5.83a728","c2b38d59.42874"]]},{"id":"b8b0d3d8.26a02","type":"mqtt in","z":"efbc7696.354458","name":"MQTT Scales","topic":"openAger/fridge1/sensors/scales","qos":"0","datatype":"auto","broker":"4841307a.c2f52","x":110,"y":3220,"wires":[["98e0b1ce.5d892"]]},{"id":"98e0b1ce.5d892","type":"json","z":"efbc7696.354458","name":"Json","property":"payload","action":"","pretty":false,"x":330,"y":3220,"wires":[["f9007db2.a71ec","696c2411.b0451c","68b861f2.40289","ee31a5df.dd8fe8","92895b56.58b6e8"]]},{"id":"f9007db2.a71ec","type":"change","z":"efbc7696.354458","name":"s1","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.s1","tot":"msg"},{"t":"set","p":"topic","pt":"msg","to":"weight_1","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":590,"y":3220,"wires":[["2b02c3d5.4949ac","401fff32.e9605","f880d8c6.b00918"]]},{"id":"696c2411.b0451c","type":"change","z":"efbc7696.354458","name":"s2","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.s2","tot":"msg"},{"t":"set","p":"topic","pt":"msg","to":"weight_2","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":590,"y":3260,"wires":[["8f4cb609.d1e538","401fff32.e9605","53acbe41.5cfca"]]},{"id":"68b861f2.40289","type":"change","z":"efbc7696.354458","name":"s3","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.s3","tot":"msg"},{"t":"set","p":"topic","pt":"msg","to":"weight_3","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":590,"y":3300,"wires":[["a9f3c698.e073b8","401fff32.e9605","444b60cc.fd821"]]},{"id":"ee31a5df.dd8fe8","type":"change","z":"efbc7696.354458","name":"s4","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.s4","tot":"msg"},{"t":"set","p":"topic","pt":"msg","to":"weight_4","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":590,"y":3340,"wires":[["2b75b5a3.77d1fa","401fff32.e9605","6b24d0fa.1ae65"]]},{"id":"f0f5a811.7fdfe8","type":"subflow:4d0dc15f.1a937","z":"efbc7696.354458","x":910,"y":2260,"wires":[]},{"id":"1740803.7d3458","type":"function","z":"4d0dc15f.1a937","name":"Save to DB","func":"var sql = \"\";\nvar d = new Date();\nvar epoch = d.getTime();\nvar outputs = [];\n//node.error(epoch);\nsql = \"INSERT INTO sensor_data (device,sensor,value,epoch) \" +\n \"VALUES ('fridge1','\"+msg.topic+\"','\"+msg.payload+\"',\"+epoch+\")\";\noutputs.push({topic:sql}); \n/*\nsql = \"INSERT INTO sensor_data(device,sensor,value,epoch) \" +\n \"VALUES ('miflora','sunlight',\"+msg.payload.sunlight+\",\"+epoch+\")\";\noutputs.push({topic:sql}); \nsql = \"INSERT INTO sensor_data(device,sensor,value,epoch) \" +\n \"VALUES ('miflora','moisture',\"+msg.payload.moisture+\",\"+epoch+\")\";\noutputs.push({topic:sql}); \nsql = \"INSERT INTO sensor_data(device,sensor,value,epoch) \" +\n \"VALUES ('miflora','fertility',\"+msg.payload.fertility+\",\"+epoch+\")\"; \noutputs.push({topic:sql}); \nsql = \"INSERT INTO sensor_data(device,sensor,value,epoch) \" +\n \"VALUES ('miflora','battery',\"+msg.payload.battery+\",\"+epoch+\")\"; \noutputs.push({topic:sql}); */ \n \n// Update the status with current timestamp\nvar now = new Date();\nvar yyyy = now.getFullYear();\nvar mm = now.getMonth() < 9 ? \"0\" + (now.getMonth() + 1) : (now.getMonth() + 1); // getMonth() is zero-based\nvar dd = now.getDate() < 10 ? \"0\" + now.getDate() : now.getDate();\nvar hh = now.getHours() < 10 ? \"0\" + now.getHours() : now.getHours();\nvar mmm = now.getMinutes() < 10 ? \"0\" + now.getMinutes() : now.getMinutes();\nvar ss = now.getSeconds() < 10 ? \"0\" + now.getSeconds() : now.getSeconds();\nnode.status({fill:\"blue\",shape:\"ring\",text:\"Last update: \"+dd + \".\" + mm + \".\" + yyyy + \" \" + hh + \":\" + mmm + \":\" + ss}); \n \nreturn [ outputs ];","outputs":1,"noerr":0,"x":410,"y":140,"wires":[["7d26f072.0171b"]]},{"id":"44ed96fe.5856d8","type":"comment","z":"4d0dc15f.1a937","name":"Save all sensor/set/actuator data in DB","info":"This function node creates multiple INSERT INTO\ncommands for data points that are stored in \nattributes of the payload.","x":290,"y":80,"wires":[]},{"id":"7d26f072.0171b","type":"mysql","z":"4d0dc15f.1a937","mydb":"66bacdef.786e04","name":"","x":580,"y":140,"wires":[[]]},{"id":"5184119d.393e","type":"delay","z":"4d0dc15f.1a937","name":"","pauseType":"timed","timeout":"30","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"minute","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":true,"x":210,"y":140,"wires":[["1740803.7d3458"]]},{"id":"56bdfc52.2ad184","type":"subflow:4d0dc15f.1a937","z":"efbc7696.354458","x":1070,"y":2580,"wires":[]},{"id":"c2b38d59.42874","type":"subflow:4d0dc15f.1a937","z":"efbc7696.354458","x":1070,"y":2880,"wires":[]},{"id":"401fff32.e9605","type":"subflow:4d0dc15f.1a937","z":"efbc7696.354458","name":"","env":[],"x":870,"y":3180,"wires":[]},{"id":"8d590abd.42ee38","type":"subflow:4d0dc15f.1a937","z":"efbc7696.354458","x":810,"y":60,"wires":[]},{"id":"7a44634.a053b9c","type":"subflow:4d0dc15f.1a937","z":"efbc7696.354458","x":810,"y":440,"wires":[]},{"id":"285222c0.4e4e3e","type":"ui_gauge","z":"efbc7696.354458","name":"lost scale 1","group":"91134a7a.5c7bb8","order":7,"width":0,"height":0,"gtype":"wave","title":"water loss","label":"%","format":"{{value}}","min":0,"max":"50","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":1290,"y":3220,"wires":[]},{"id":"f880d8c6.b00918","type":"function","z":"efbc7696.354458","name":"calc percentage","func":"global.set(\"weight1\",msg.payload);\n\nif \t(global.get(\"scaletime1\") > 0) {\n msg.payload = 100- (100 / global.get(\"startweight1\") * msg.payload ); \n} else {\n msg.payload = 0;\n}\n\nglobal.set(\"water1\",msg.payload);\nreturn msg;","outputs":1,"noerr":0,"x":1060,"y":3220,"wires":[["285222c0.4e4e3e"]]},{"id":"f9275653.f26198","type":"ui_gauge","z":"efbc7696.354458","name":"lost scale 2","group":"e7c3e799.f86b28","order":7,"width":0,"height":0,"gtype":"wave","title":"water loss","label":"%","format":"{{value}}","min":0,"max":"50","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":1290,"y":3260,"wires":[]},{"id":"233fa08.26b4f6","type":"ui_gauge","z":"efbc7696.354458","name":"lost scale 3","group":"39b2ec86.601ea4","order":7,"width":0,"height":0,"gtype":"wave","title":"water loss","label":"%","format":"{{value}}","min":0,"max":"50","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":1290,"y":3300,"wires":[]},{"id":"71c72916.362a68","type":"ui_gauge","z":"efbc7696.354458","name":"lost scale 4","group":"fbe9ae29.de1a7","order":7,"width":0,"height":0,"gtype":"wave","title":"water loss","label":"%","format":"{{value}}","min":0,"max":"50","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":1290,"y":3340,"wires":[]},{"id":"53acbe41.5cfca","type":"function","z":"efbc7696.354458","name":"calc percentage","func":"global.set(\"weight2\",msg.payload);\n\nif \t(global.get(\"scaletime2\") > 0) {\n msg.payload = 100- (100 / global.get(\"startweight2\") * msg.payload ); \n} else {\n msg.payload = 0;\n}\n\nglobal.set(\"water2\",msg.payload);\nreturn msg;","outputs":1,"noerr":0,"x":1060,"y":3260,"wires":[["f9275653.f26198"]]},{"id":"444b60cc.fd821","type":"function","z":"efbc7696.354458","name":"calc percentage","func":"global.set(\"weight3\",msg.payload);\n\nif \t(global.get(\"scaletime3\") > 0) {\n msg.payload = 100- (100 / global.get(\"startweight3\") * msg.payload ); \n} else {\n msg.payload = 0;\n}\n\nglobal.set(\"water3\",msg.payload);\nreturn msg;","outputs":1,"noerr":0,"x":1060,"y":3300,"wires":[["233fa08.26b4f6"]]},{"id":"6b24d0fa.1ae65","type":"function","z":"efbc7696.354458","name":"calc percentage","func":"global.set(\"weight4\",msg.payload);\n\nif \t(global.get(\"scaletime4\") > 0) {\n msg.payload = 100- (100 / global.get(\"startweight4\") * msg.payload ); \n} else {\n msg.payload = 0;\n}\n\nglobal.set(\"water4\",msg.payload);\nreturn msg;","outputs":1,"noerr":0,"x":1060,"y":3340,"wires":[["71c72916.362a68"]]},{"id":"1e38d249.4393fe","type":"function","z":"bfb0b9c4.4e1408","name":"Trim old data > 120 days","func":"var output = [];\nvar d = new Date();\nvar epoch = d.getTime();\n// 120 Tage\nd.setTime(d.getTime()-(120*24*60*60*1000));\n// calculate begining of the day\nd.setHours(0);\nd.setMinutes(0);\nd.setSeconds(0);\nd.setMilliseconds(0);\nvar fromdate = d.getTime();\n\noutput.push({ topic:\"delete FROM sensor_data WHERE epoch < \" + fromdate });\n\nreturn [output];","outputs":1,"noerr":0,"x":370,"y":1420,"wires":[["b19c7a54.3365f8"]]},{"id":"6f1e86d4.10d908","type":"file","z":"efbc7696.354458","name":"node-red.log","filename":"/data/node-red.log","appendNewline":true,"createDir":true,"overwriteFile":"false","x":2030,"y":1800,"wires":[[]]},{"id":"c43a9881.e07368","type":"moment","z":"efbc7696.354458","name":"","topic":"","input":"","inputType":"msg","inTz":"","adjAmount":0,"adjType":"days","adjDir":"add","format":"","locale":"","output":"","outputType":"msg","outTz":"","x":1360,"y":1600,"wires":[[]]},{"id":"2f26c5da.880c2a","type":"function","z":"efbc7696.354458","name":"add Time","func":"var entry = [];\nvar now = new Date();\nvar month = now.getMonth()+1;\nvar day = now.getDate();\nvar year = now.getFullYear();\nvar hour = now.getHours();\nvar min = now.getMinutes();\nvar sek = now.getSeconds();\nvar mil = now.getMilliseconds();\n\nmonth = (\"0\" + month).slice(-2);\nday = (\"0\" + day).slice(-2);\n\nhour = (\"0\" + hour).slice(-2);\nmin = (\"0\" + min).slice(-2);\nsek = (\"0\" + sek).slice(-2);\n//mil = (\"000\" + sek).slice(-3);\n\n\nentry = day + \".\" + month + \".\" + year + \" \" + hour + \":\" + min + \":\" + sek + \":\" + mil + \" \" + msg.payload;\nmsg.payload = entry; \nreturn msg;","outputs":1,"noerr":0,"x":1840,"y":1800,"wires":[["6f1e86d4.10d908"]]},{"id":"edf083fc.7d1b8","type":"ui_dropdown","z":"efbc7696.354458","name":"Type Sensor 1","label":"Type Sensor 1","tooltip":"","place":"","group":"d02bb676.9c8768","order":1,"width":0,"height":0,"passthru":false,"options":[{"label":"none","value":"0","type":"str"},{"label":"Bus 1: BME280","value":"10","type":"str"},{"label":"Bus 1: BME280 #2","value":"11","type":"str"},{"label":"Bus 1: SHT31","value":"12","type":"str"},{"label":"Bus 1: SHT31 #2","value":"13","type":"str"},{"label":"Bus 2: BME280","value":"20","type":"str"},{"label":"Bus 2: BME280 #2","value":"21","type":"str"},{"label":"Bus 2: SHT31","value":"22","type":"str"},{"label":"Bus 2: SHT31 #2","value":"23","type":"str"},{"label":"Bus 3: BME280","value":"30","type":"str"},{"label":"Bus 3: BME280 #2","value":"31","type":"str"},{"label":"Bus 3: SHT31","value":"32","type":"str"},{"label":"Bus 3: SHT31 #2","value":"33","type":"str"}],"payload":"","topic":"openAger/fridge1/set/sensor1","x":820,"y":1540,"wires":[["cc4f87dc.b00118"]]},{"id":"cc1a68a4.59d4b8","type":"ui_dropdown","z":"efbc7696.354458","name":"dualsensor","label":"Dual Sensor mode","place":"","group":"d02bb676.9c8768","order":4,"width":0,"height":0,"passthru":false,"options":[{"label":"no","value":"0","type":"str"},{"label":"yes","value":"1","type":"str"}],"payload":"","topic":"openAger/fridge1/set/dual","x":810,"y":1740,"wires":[["cc4f87dc.b00118"]]},{"id":"d50e4db3.15ecd","type":"ui_dropdown","z":"efbc7696.354458","name":"Type Sensor 2","label":"Type Sensor 2","tooltip":"","place":"","group":"d02bb676.9c8768","order":2,"width":0,"height":0,"passthru":false,"options":[{"label":"none","value":"0","type":"str"},{"label":"Bus 1: BME280","value":"10","type":"str"},{"label":"Bus 1: BME280 #2","value":"11","type":"str"},{"label":"Bus 1: SHT31","value":"12","type":"str"},{"label":"Bus 1: SHT31 #2","value":"13","type":"str"},{"label":"Bus 2: BME280","value":"20","type":"str"},{"label":"Bus 2: BME280 #2","value":"21","type":"str"},{"label":"Bus 2: SHT31","value":"22","type":"str"},{"label":"Bus 2: SHT31 #2","value":"23","type":"str"},{"label":"Bus 3: BME280","value":"30","type":"str"},{"label":"Bus 3: BME280 #2","value":"31","type":"str"},{"label":"Bus 3: SHT31","value":"32","type":"str"},{"label":"Bus 3: SHT31 #2","value":"33","type":"str"}],"payload":"","topic":"openAger/fridge1/set/sensor2","x":820,"y":1580,"wires":[["cc4f87dc.b00118"]]},{"id":"607273a8.9c951c","type":"ui_dropdown","z":"efbc7696.354458","name":"Type Sensor E","label":"Type Sensor Ext","tooltip":"","place":"","group":"d02bb676.9c8768","order":3,"width":0,"height":0,"passthru":false,"options":[{"label":"none","value":"0","type":"str"},{"label":"Bus 1: BME280","value":"10","type":"str"},{"label":"Bus 1: BME280 #2","value":"11","type":"str"},{"label":"Bus 1: SHT31","value":"12","type":"str"},{"label":"Bus 1: SHT31 #2","value":"13","type":"str"},{"label":"Bus 2: BME280","value":"20","type":"str"},{"label":"Bus 2: BME280 #2","value":"21","type":"str"},{"label":"Bus 2: SHT31","value":"22","type":"str"},{"label":"Bus 2: SHT31 #2","value":"23","type":"str"},{"label":"Bus 3: BME280","value":"30","type":"str"},{"label":"Bus 3: BME280 #2","value":"31","type":"str"},{"label":"Bus 3: SHT31","value":"32","type":"str"},{"label":"Bus 3: SHT31 #2","value":"33","type":"str"}],"payload":"","topic":"openAger/fridge1/set/sensore","x":820,"y":1620,"wires":[["cc4f87dc.b00118"]]},{"id":"22972139.d2695e","type":"ui_text_input","z":"efbc7696.354458","name":"Coolerpower","label":"Coolerpower","group":"4b96690f.894e08","order":5,"width":0,"height":0,"passthru":false,"mode":"text","delay":"0","topic":"openAger/fridge1/set/coolerpower","x":810,"y":1700,"wires":[["cc4f87dc.b00118"]]},{"id":"9de9b0b7.13693","type":"ui_text_input","z":"efbc7696.354458","name":"CheckTempDiff","label":"CheckTempDiff","group":"d02bb676.9c8768","order":6,"width":0,"height":0,"passthru":false,"mode":"text","delay":"0","topic":"openAger/fridge1/set/checktempdiff","x":1100,"y":1380,"wires":[["cc4f87dc.b00118"]]},{"id":"4d4fcc0f.c63174","type":"ui_text_input","z":"efbc7696.354458","name":"CheckHumDiff","label":"CheckHumDiff","group":"d02bb676.9c8768","order":7,"width":0,"height":0,"passthru":false,"mode":"text","delay":"0","topic":"openAger/fridge1/set/checkhumdiff","x":1100,"y":1420,"wires":[["cc4f87dc.b00118"]]},{"id":"ba2b3ad5.603118","type":"ui_text_input","z":"efbc7696.354458","name":"TickSensors","label":"TickSensors","group":"4b96690f.894e08","order":1,"width":0,"height":0,"passthru":false,"mode":"text","delay":"0","topic":"openAger/fridge1/set/ticksensors","x":1090,"y":1460,"wires":[["cc4f87dc.b00118"]]},{"id":"669dd524.8c12ec","type":"ui_text_input","z":"efbc7696.354458","name":"TickDisplay","label":"TickDisplay","group":"4b96690f.894e08","order":2,"width":0,"height":0,"passthru":false,"mode":"text","delay":"0","topic":"openAger/fridge1/set/tickdisplay","x":1090,"y":1500,"wires":[["cc4f87dc.b00118"]]},{"id":"f18d605a.86367","type":"ui_text_input","z":"efbc7696.354458","name":"TickBackup","label":"TickBackup","group":"4b96690f.894e08","order":3,"width":0,"height":0,"passthru":false,"mode":"text","delay":"0","topic":"openAger/fridge1/set/tickbackup","x":1090,"y":1540,"wires":[["cc4f87dc.b00118"]]},{"id":"82f5582c.485868","type":"ui_text_input","z":"efbc7696.354458","name":"TickScales","label":"TickScales","group":"4b96690f.894e08","order":4,"width":0,"height":0,"passthru":false,"mode":"text","delay":"0","topic":"openAger/fridge1/set/tickscales","x":1090,"y":1580,"wires":[["cc4f87dc.b00118"]]},{"id":"237496a0.f5b9fa","type":"ui_text_input","z":"efbc7696.354458","name":"CoolerProtect","label":"CoolerProtect","group":"4b96690f.894e08","order":6,"width":0,"height":0,"passthru":false,"mode":"text","delay":"0","topic":"openAger/fridge1/set/coolerprotect","x":1100,"y":1620,"wires":[["cc4f87dc.b00118"]]},{"id":"281def3b.457c8","type":"mqtt in","z":"efbc7696.354458","name":"MQTT Historic","topic":"openAger/fridge1/sensors/hist","qos":"0","datatype":"auto","broker":"4841307a.c2f52","x":110,"y":3420,"wires":[["49e34cbc.6b7654"]]},{"id":"49e34cbc.6b7654","type":"json","z":"efbc7696.354458","name":"Json","property":"payload","action":"","pretty":false,"x":330,"y":3420,"wires":[["ca802702.7fafc8","dcb37f2a.e9f88","86049c52.70bcf","d338eb13.4b1138","fcd7bf53.daedb","93272af7.19db38","ae1a4f61.c8ff"]]},{"id":"b4c60510.82e9d8","type":"subflow:4d0dc15f.1a937","z":"efbc7696.354458","x":930,"y":3400,"wires":[]},{"id":"d07aaecc.9a2dd","type":"ui_chart","z":"efbc7696.354458","name":"C_Hist","group":"c1fcc324.6a01","order":3,"width":0,"height":0,"label":"Historic changes","chartType":"line","legend":"false","xformat":"HH:mm:ss","interpolate":"bezier","nodata":"","dot":false,"ymin":"0","ymax":"5","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":false,"outputs":2,"x":1510,"y":3420,"wires":[[],[]]},{"id":"ca802702.7fafc8","type":"function","z":"efbc7696.354458","name":"hist1","func":"\nmsg.topic = \"hist1\";\nmsg.payload = Number((msg.payload.hs1 - msg.payload.hs0).toFixed(4)); \nreturn msg;\n\n","outputs":1,"noerr":0,"x":530,"y":3420,"wires":[["b4c60510.82e9d8","d07aaecc.9a2dd","3967db8f.3d22c4"]]},{"id":"dcb37f2a.e9f88","type":"function","z":"efbc7696.354458","name":"hist2","func":"\nmsg.topic = \"hist2\";\nmsg.payload = Number((msg.payload.hs2 - msg.payload.hs0).toFixed(4)); \nreturn msg;","outputs":1,"noerr":0,"x":530,"y":3460,"wires":[["b4c60510.82e9d8","d07aaecc.9a2dd"]]},{"id":"86049c52.70bcf","type":"function","z":"efbc7696.354458","name":"hist3","func":"\nmsg.topic = \"hist3\";\nmsg.payload = Number((msg.payload.hs3 - msg.payload.hs0).toFixed(4)); \nreturn msg;","outputs":1,"noerr":0,"x":530,"y":3500,"wires":[["b4c60510.82e9d8","d07aaecc.9a2dd"]]},{"id":"d338eb13.4b1138","type":"function","z":"efbc7696.354458","name":"hist5","func":"\nmsg.topic = \"hist5\";\nmsg.payload = Number((msg.payload.hs5 - msg.payload.hs0).toFixed(4)); \nreturn msg;","outputs":1,"noerr":0,"x":530,"y":3540,"wires":[["b4c60510.82e9d8","d07aaecc.9a2dd"]]},{"id":"fcd7bf53.daedb","type":"function","z":"efbc7696.354458","name":"hist10","func":"\nmsg.topic = \"hist10\";\nmsg.payload = Number((msg.payload.hs10 - msg.payload.hs0).toFixed(4)); \nreturn msg;","outputs":1,"noerr":0,"x":530,"y":3580,"wires":[["b4c60510.82e9d8","d07aaecc.9a2dd","ec9fdd31.9e2be"]]},{"id":"3967db8f.3d22c4","type":"ui_gauge","z":"efbc7696.354458","name":"H_Hist1","group":"bffb08b3.1b1fa8","order":12,"width":"3","height":"3","gtype":"gage","title":"Hist 1","label":"°C","format":"{{value | number:2}}","min":"-1","max":"1","colors":["#00b500","#e6e600","#ca3838"],"seg1":"20","seg2":"25","x":860,"y":3540,"wires":[]},{"id":"ec9fdd31.9e2be","type":"ui_gauge","z":"efbc7696.354458","name":"H_Hist10","group":"bffb08b3.1b1fa8","order":13,"width":"3","height":"3","gtype":"gage","title":"Hist 10","label":"°C","format":"{{value | number:2}}","min":"-1","max":"1","colors":["#00b500","#e6e600","#ca3838"],"seg1":"20","seg2":"25","x":860,"y":3580,"wires":[]},{"id":"cbe3b4d.2b2e148","type":"ui_colour_picker","z":"efbc7696.354458","name":"","label":"LED Farbe","group":"a7c01b2c.6f7df8","format":"rgb","outformat":"string","showSwatch":true,"showPicker":false,"showValue":true,"showHue":true,"showAlpha":false,"showLightness":true,"dynOutput":"false","order":2,"width":0,"height":0,"passthru":false,"topic":"openAger/fridge1/set/ledrgb","x":1270,"y":300,"wires":[["cc4f87dc.b00118"]]},{"id":"b7c317a8.9fd4f8","type":"ui_dropdown","z":"efbc7696.354458","name":"LedPattern","label":"Led Patterm","tooltip":"","place":"","group":"a7c01b2c.6f7df8","order":1,"width":0,"height":0,"passthru":false,"options":[{"label":"off","value":"0","type":"str"},{"label":"White","value":"7","type":"str"},{"label":"static red","value":"1","type":"str"},{"label":"static blue","value":"2","type":"str"},{"label":"static green","value":"3","type":"str"},{"label":"static RGB","value":"4","type":"str"},{"label":"RGB Breathing","value":"5","type":"str"},{"label":"Meat Spotlight","value":"6","type":"str"}],"payload":"","topic":"openAger/fridge1/set/ledpattern","x":1270,"y":260,"wires":[["cc4f87dc.b00118"]]},{"id":"d704ea72.4cc0d8","type":"mqtt in","z":"efbc7696.354458","name":"MQTT Pressure","topic":"openAger/fridge1/sensors/pressure","qos":"0","datatype":"auto","broker":"4841307a.c2f52","x":100,"y":3740,"wires":[["b2cba5c4.d93148"]]},{"id":"b2cba5c4.d93148","type":"json","z":"efbc7696.354458","name":"Json","property":"payload","action":"","pretty":false,"x":330,"y":3740,"wires":[["7d6c8a31.ca8204","bbc0e244.a373f","97538940.c3c8f8","96a6e171.ad53b","282517b0.8b78c8","6dff3d28.cb95c4","e4cee3ef.333a6","41757724.dd4ba8"]]},{"id":"7d6c8a31.ca8204","type":"change","z":"efbc7696.354458","name":"pressure1","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.p1","tot":"msg"},{"t":"set","p":"topic","pt":"msg","to":"pressure1","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":580,"y":3740,"wires":[["e5aec797.954648","507b217c.d7281"]]},{"id":"bbc0e244.a373f","type":"change","z":"efbc7696.354458","name":"pressure2","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.p2","tot":"msg"},{"t":"set","p":"topic","pt":"msg","to":"pressure2","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":580,"y":3780,"wires":[["507b217c.d7281"]]},{"id":"e5aec797.954648","type":"ui_chart","z":"efbc7696.354458","name":"C_Pressure","group":"2d255ce.e9e82a4","order":2,"width":0,"height":0,"label":"Pressure","chartType":"line","legend":"false","xformat":"HH:mm:ss","interpolate":"bezier","nodata":"","dot":false,"ymin":"930","ymax":"950","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":false,"outputs":2,"x":790,"y":3740,"wires":[[],[]]},{"id":"96a6e171.ad53b","type":"change","z":"efbc7696.354458","name":"co2","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.co2","tot":"msg"},{"t":"set","p":"topic","pt":"msg","to":"co2","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":570,"y":3860,"wires":[["4e78f751.a94f28","77d0586a.5d5fe8","507b217c.d7281"]]},{"id":"4e78f751.a94f28","type":"ui_gauge","z":"efbc7696.354458","name":"G_co2","group":"43f2495e.96eb28","order":3,"width":0,"height":0,"gtype":"gage","title":"CO2","label":"ppm","format":"{{value | number:0}}","min":"400","max":"8192","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":1050,"y":3860,"wires":[]},{"id":"77d0586a.5d5fe8","type":"ui_chart","z":"efbc7696.354458","name":"C_CO2","group":"37137413.a3425c","order":3,"width":0,"height":0,"label":"CO2","chartType":"line","legend":"false","xformat":"HH:mm:ss","interpolate":"bezier","nodata":"","dot":false,"ymin":"","ymax":"","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":false,"outputs":2,"x":1500,"y":3860,"wires":[[],[]]},{"id":"ccca855e.acde78","type":"ui_switch","z":"efbc7696.354458","name":"Lock","label":"Lock GUI","tooltip":"","group":"bffb08b3.1b1fa8","order":10,"width":0,"height":0,"passthru":false,"decouple":"true","topic":"openAger/fridge1/actuators/lock","style":"","onvalue":"1","onvalueType":"str","onicon":"fa-lock","oncolor":"red","offvalue":"0","offvalueType":"str","officon":"fa-unlock","offcolor":"green","x":290,"y":400,"wires":[["cc4f87dc.b00118","fe648e07.fa6ee"]]},{"id":"fe648e07.fa6ee","type":"function","z":"efbc7696.354458","name":"disable/enable","func":"//context.global.mode = msg.payload;\nglobal.set(\"lock\",msg.payload);\nif (msg.payload == \"0\") {\n msg.enabled = true;\n} else {\n msg.enabled = false;\n}\ndelete msg.payload;\nreturn msg;","outputs":1,"noerr":0,"x":560,"y":400,"wires":[["4c14ee01.fc641","44ff4d33.5a1554","38bab156.ad305e","230fafe8.b6f3a","c7f7b411.d8af98","25d7eee4.ffda22","d6eab50f.39ab68","9f8ef02.e1ba51","3b69da02.2a8c56","9f09a0d0.110b4","ed29ff62.3ba3f","41d2d4c5.91712c","9a56849b.6b7838","c3cb49b0.bb7bf8","183b8d0d.3a29e3","f51d8baf.ece8b8"]]},{"id":"c8ea63dc.bc596","type":"ui_text_input","z":"efbc7696.354458","name":"S_Set Temp","label":"Set Temp","tooltip":"","group":"418bab59.fac9d4","order":0,"width":0,"height":0,"passthru":false,"mode":"text","delay":300,"topic":"openAger/fridge1/set/temp","x":1050,"y":480,"wires":[["cc4f87dc.b00118"]]},{"id":"249a3f19.efaa","type":"ui_text_input","z":"efbc7696.354458","name":"S_Set Hum","label":"Set Hum","tooltip":"","group":"418bab59.fac9d4","order":0,"width":0,"height":0,"passthru":false,"mode":"text","delay":300,"topic":"openAger/fridge1/set/hum","x":1050,"y":520,"wires":[["cc4f87dc.b00118"]]},{"id":"dc895bc9.fdbfa8","type":"ui_text_input","z":"efbc7696.354458","name":"S_Set Hysterese","label":"Set Hysterese","tooltip":"","group":"418bab59.fac9d4","order":0,"width":0,"height":0,"passthru":false,"mode":"text","delay":300,"topic":"openAger/fridge1/set/hyst","x":1070,"y":560,"wires":[["cc4f87dc.b00118"]]},{"id":"acc94eaa.07e33","type":"ui_text_input","z":"efbc7696.354458","name":"S_Set Hum Hysterese","label":"Set Hum Hysterese","tooltip":"","group":"418bab59.fac9d4","order":0,"width":0,"height":0,"passthru":false,"mode":"text","delay":300,"topic":"openAger/fridge1/set/humhyst","x":1080,"y":600,"wires":[["cc4f87dc.b00118"]]},{"id":"832a213e.13ba2","type":"ui_slider","z":"efbc7696.354458","name":"Brightness","label":"Brightness","tooltip":"","group":"a7c01b2c.6f7df8","order":3,"width":0,"height":0,"passthru":false,"outs":"all","topic":"openAger/fridge1/set/ledbrightness","min":0,"max":"255","step":1,"x":1270,"y":340,"wires":[["cc4f87dc.b00118"]]},{"id":"e8076511.50c1d8","type":"ui_button","z":"efbc7696.354458","name":"Logreset","group":"ca61f135.42042","order":10,"width":0,"height":0,"passthru":false,"label":"reset log","tooltip":"empty log","color":"","bgcolor":"","icon":"fa-trash","payload":"cleared","payloadType":"str","topic":"","x":1060,"y":1720,"wires":[["5f1a3c83.0d9654"]]},{"id":"93272af7.19db38","type":"change","z":"efbc7696.354458","name":"avg hum int","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.avi","tot":"msg"},{"t":"set","p":"topic","pt":"msg","to":"average humidity int","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":550,"y":3620,"wires":[["a6478797.b15828","b18c1df6.cdfb8","b4c60510.82e9d8"]]},{"id":"a6478797.b15828","type":"ui_gauge","z":"efbc7696.354458","name":"G_avg_Hum_int","group":"77fea715.4f11c8","order":6,"width":0,"height":0,"gtype":"gage","title":"Avg. Humidity int.","label":"%","format":"{{value | number:2}}","min":0,"max":"100","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":1080,"y":3620,"wires":[]},{"id":"f6b224e.6dfd5d8","type":"ui_switch","z":"efbc7696.354458","name":"","label":"Status LED","tooltip":"","group":"a7c01b2c.6f7df8","order":4,"width":0,"height":0,"passthru":false,"decouple":"false","topic":"openAger/fridge1/set/statusled","style":"","onvalue":"1","onvalueType":"str","onicon":"","oncolor":"","offvalue":"0","offvalueType":"str","officon":"","offcolor":"","x":1270,"y":380,"wires":[["cc4f87dc.b00118"]]},{"id":"282517b0.8b78c8","type":"change","z":"efbc7696.354458","name":"avg_coolingtime","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.act","tot":"msg"},{"t":"set","p":"topic","pt":"msg","to":"avg_coolingtime","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":600,"y":3900,"wires":[["d6bcf02d.8d9fe","507b217c.d7281"]]},{"id":"6dff3d28.cb95c4","type":"change","z":"efbc7696.354458","name":"avg_hysttime","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.aht","tot":"msg"},{"t":"set","p":"topic","pt":"msg","to":"avg_hysttime","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":590,"y":3940,"wires":[["547c061c.a83af8","507b217c.d7281"]]},{"id":"d6bcf02d.8d9fe","type":"ui_gauge","z":"efbc7696.354458","name":"G_coolingtime","group":"d54ee9a0.347778","order":1,"width":0,"height":0,"gtype":"gage","title":"Avg. Cooling Time","label":"min","format":"{{value | number:0}}","min":"0","max":"60","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":1080,"y":3900,"wires":[]},{"id":"547c061c.a83af8","type":"ui_gauge","z":"efbc7696.354458","name":"G_avg_hysttime","group":"d54ee9a0.347778","order":2,"width":0,"height":0,"gtype":"gage","title":"Avg. Hysttime","label":"min","format":"{{value | number:0}}","min":"0","max":"60","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":1080,"y":3940,"wires":[]},{"id":"23f48f74.d70a5","type":"ui_gauge","z":"efbc7696.354458","name":"G_Rythmtime","group":"d54ee9a0.347778","order":3,"width":0,"height":0,"gtype":"gage","title":"Rythmtime","label":"min","format":"{{value | number:0}}","min":"0","max":"60","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":1080,"y":3980,"wires":[]},{"id":"e4cee3ef.333a6","type":"function","z":"efbc7696.354458","name":"calc rythm","func":"\nmsg.topic = \"avg_rythmtime\";\nmsg.payload = Number((msg.payload.act + msg.payload.aht).toFixed(4)); \nreturn msg;\n\n","outputs":1,"noerr":0,"x":590,"y":3980,"wires":[["23f48f74.d70a5"]]},{"id":"507b217c.d7281","type":"subflow:4d0dc15f.1a937","z":"efbc7696.354458","x":910,"y":3700,"wires":[]},{"id":"53772786.6328a8","type":"ui_dropdown","z":"efbc7696.354458","name":"Type Sensor S","label":"Type Sensor Special","tooltip":"","place":"","group":"d02bb676.9c8768","order":3,"width":0,"height":0,"passthru":false,"options":[{"label":"none","value":"0","type":"str"},{"label":"Bus 1: BME280","value":"10","type":"str"},{"label":"Bus 1: BME280 #2","value":"11","type":"str"},{"label":"Bus 1: SHT31","value":"12","type":"str"},{"label":"Bus 1: SHT31 #2","value":"13","type":"str"},{"label":"Bus 2: BME280","value":"20","type":"str"},{"label":"Bus 2: BME280 #2","value":"21","type":"str"},{"label":"Bus 2: SHT31","value":"22","type":"str"},{"label":"Bus 2: SHT31 #2","value":"23","type":"str"},{"label":"Bus 3: BME280","value":"30","type":"str"},{"label":"Bus 3: BME280 #2","value":"31","type":"str"},{"label":"Bus 3: SHT31","value":"32","type":"str"},{"label":"Bus 3: SHT31 #2","value":"33","type":"str"}],"payload":"","topic":"openAger/fridge1/set/sensors","x":820,"y":1660,"wires":[["cc4f87dc.b00118"]]},{"id":"7a7d4275.ee64bc","type":"mqtt in","z":"efbc7696.354458","name":"MQTT Additional","topic":"openAger/fridge1/sensors/additional","qos":"0","datatype":"auto","broker":"4841307a.c2f52","x":100,"y":4100,"wires":[["5ecc3b57.879294"]]},{"id":"5ecc3b57.879294","type":"json","z":"efbc7696.354458","name":"Json","property":"payload","action":"","pretty":false,"x":330,"y":4100,"wires":[["82f6e94d.0c0d58","d2545a3.32cdba8","82ef01c7.24802"]]},{"id":"82f6e94d.0c0d58","type":"change","z":"efbc7696.354458","name":"TempSpecial","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.ts","tot":"msg"},{"t":"set","p":"topic","pt":"msg","to":"TempCoolingPlate","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":590,"y":4100,"wires":[["3939f862.34c628","bc7f0da0.3d71c"]]},{"id":"d2545a3.32cdba8","type":"change","z":"efbc7696.354458","name":"HumSpecial","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.hs","tot":"msg"},{"t":"set","p":"topic","pt":"msg","to":"HumCoolingPlate","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":590,"y":4140,"wires":[["3939f862.34c628","b5ad99f9.d72ad8"]]},{"id":"3939f862.34c628","type":"subflow:4d0dc15f.1a937","z":"efbc7696.354458","x":910,"y":4060,"wires":[]},{"id":"b5ad99f9.d72ad8","type":"ui_gauge","z":"efbc7696.354458","name":"G_HumSpecial","group":"77fea715.4f11c8","order":5,"width":0,"height":0,"gtype":"gage","title":"Cooling Plate","label":"%","format":"{{value | number:2}}","min":0,"max":"100","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":920,"y":4140,"wires":[]},{"id":"bc7f0da0.3d71c","type":"ui_gauge","z":"efbc7696.354458","name":"G_TempSpecial","group":"b7af05c9.acc5c8","order":5,"width":0,"height":0,"gtype":"gage","title":"Cooling Plate","label":"°C","format":"{{value | number:2}}","min":"-5","max":"30","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":920,"y":4100,"wires":[],"inputLabels":["msg.t1"]},{"id":"1e7aecef.a74093","type":"mqtt in","z":"efbc7696.354458","name":"MQTT States","topic":"openAger/fridge1/sensors/state","qos":"0","datatype":"auto","broker":"4841307a.c2f52","x":90,"y":4480,"wires":[["582f7fb5.04a88"]]},{"id":"582f7fb5.04a88","type":"json","z":"efbc7696.354458","name":"Json","property":"payload","action":"","pretty":false,"x":330,"y":4480,"wires":[["a50ff7c7.0f7f48","4e305166.d31f","82dcd899.800198","f65ad2e4.1a22e","ea4d4294.a788b","f7fa8f7b.fcb43","aff6320a.0a51","2f89c43a.6e3b3c","c1a13cb0.b0a21"]]},{"id":"a50ff7c7.0f7f48","type":"change","z":"efbc7696.354458","name":"Cooling_on","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.r1","tot":"msg"},{"t":"set","p":"topic","pt":"msg","to":"Cooling_on","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":590,"y":4480,"wires":[["eda72976.1bbe88"]]},{"id":"4e305166.d31f","type":"change","z":"efbc7696.354458","name":"Heating_on","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.r2","tot":"msg"},{"t":"set","p":"topic","pt":"msg","to":"Heating_on","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":590,"y":4520,"wires":[["f3aa7231.3797c"]]},{"id":"f3aa7231.3797c","type":"subflow:4d0dc15f.1a937","z":"efbc7696.354458","x":1070,"y":4580,"wires":[]},{"id":"d508aa70.6653b8","type":"mqtt in","z":"efbc7696.354458","name":"MQTT Set","topic":"openAger/fridge1/sensors/set","qos":"0","datatype":"auto","broker":"4841307a.c2f52","x":80,"y":4260,"wires":[["72fc8333.31ba2c"]]},{"id":"72fc8333.31ba2c","type":"json","z":"efbc7696.354458","name":"Json","property":"payload","action":"","pretty":false,"x":330,"y":4260,"wires":[["f37bb6a9.2c1c58","69c6cdd1.19aa94","f4eb4fda.59f17","ce096e14.16cef","fae4c0d0.009b7","ce844940.602108"]]},{"id":"f37bb6a9.2c1c58","type":"change","z":"efbc7696.354458","name":"SetTemp","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.st","tot":"msg"},{"t":"set","p":"topic","pt":"msg","to":"openAger/fridge1/set/temp","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":580,"y":4260,"wires":[["ab699463.fddb18"]]},{"id":"69c6cdd1.19aa94","type":"change","z":"efbc7696.354458","name":"SetHum","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.sh","tot":"msg"},{"t":"set","p":"topic","pt":"msg","to":"openAger/fridge1/set/hum","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":580,"y":4300,"wires":[["ab699463.fddb18"]]},{"id":"ab699463.fddb18","type":"subflow:4d0dc15f.1a937","z":"efbc7696.354458","x":910,"y":4220,"wires":[]},{"id":"f4eb4fda.59f17","type":"change","z":"efbc7696.354458","name":"SetHysterese","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.sth","tot":"msg"},{"t":"set","p":"topic","pt":"msg","to":"openAger/fridge1/sensors/hysterese","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":600,"y":4340,"wires":[["ab699463.fddb18"]]},{"id":"ce096e14.16cef","type":"change","z":"efbc7696.354458","name":"SetHumHysterese","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.shh","tot":"msg"},{"t":"set","p":"topic","pt":"msg","to":"openAger/fridge1/sensors/humhysterese","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":610,"y":4380,"wires":[["ab699463.fddb18"]]},{"id":"82dcd899.800198","type":"change","z":"efbc7696.354458","name":"Booster_on","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.r3","tot":"msg"},{"t":"set","p":"topic","pt":"msg","to":"Booster_on","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":590,"y":4560,"wires":[["f3aa7231.3797c"]]},{"id":"f65ad2e4.1a22e","type":"change","z":"efbc7696.354458","name":"Circulation_on","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.r4","tot":"msg"},{"t":"set","p":"topic","pt":"msg","to":"Circulation_on","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":600,"y":4600,"wires":[["f3aa7231.3797c"]]},{"id":"ea4d4294.a788b","type":"change","z":"efbc7696.354458","name":"Moistening_on","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.r5","tot":"msg"},{"t":"set","p":"topic","pt":"msg","to":"Moistening_on","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":600,"y":4640,"wires":[["f3aa7231.3797c"]]},{"id":"f7fa8f7b.fcb43","type":"change","z":"efbc7696.354458","name":"Drying_on","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.r6","tot":"msg"},{"t":"set","p":"topic","pt":"msg","to":"Drying_on","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":590,"y":4680,"wires":[["f3aa7231.3797c"]]},{"id":"aff6320a.0a51","type":"change","z":"efbc7696.354458","name":"UVC_on","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.r7","tot":"msg"},{"t":"set","p":"topic","pt":"msg","to":"UVC_on","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":580,"y":4720,"wires":[["f3aa7231.3797c"]]},{"id":"2f89c43a.6e3b3c","type":"change","z":"efbc7696.354458","name":"Light_on","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.r8","tot":"msg"},{"t":"set","p":"topic","pt":"msg","to":"Light_on","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":580,"y":4760,"wires":[["f3aa7231.3797c"]]},{"id":"4d3a77c3.8834f8","type":"ui_button","z":"efbc7696.354458","name":"configpush","group":"4b96690f.894e08","order":7,"width":0,"height":0,"passthru":false,"label":"Read Config from chip","tooltip":"","color":"","bgcolor":"red","icon":"sync","payload":"1","payloadType":"str","topic":"openAger/fridge1/set/configpush","x":1090,"y":1120,"wires":[["9c8d165.2f9aae8"]]},{"id":"fae4c0d0.009b7","type":"change","z":"efbc7696.354458","name":"avg_heatingtime","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.aht","tot":"msg"},{"t":"set","p":"topic","pt":"msg","to":"avg_heatingtime","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":600,"y":4420,"wires":[["d0a845c6.a7fe08"]]},{"id":"d0a845c6.a7fe08","type":"ui_gauge","z":"efbc7696.354458","name":"G_heatingtime","group":"d54ee9a0.347778","order":1,"width":0,"height":0,"gtype":"gage","title":"Avg. Heating Time","label":"min","format":"{{value | number:0}}","min":"0","max":"60","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":920,"y":4420,"wires":[]},{"id":"c3cb49b0.bb7bf8","type":"ui_dropdown","z":"efbc7696.354458","name":"tempmode","label":"TempMode","tooltip":"","place":"","group":"ca61f135.42042","order":2,"width":0,"height":0,"passthru":false,"options":[{"label":"Heating","value":"0","type":"str"},{"label":"Cooling","value":"1","type":"str"},{"label":"Auto","value":"99","type":"str"}],"payload":"","topic":"openAger/fridge1/set/tempmode","x":810,"y":1000,"wires":[["cc4f87dc.b00118"]]},{"id":"183b8d0d.3a29e3","type":"ui_slider","z":"efbc7696.354458","name":"Fan Speed","label":"Fan Speed","tooltip":"","group":"801bafd8.09a2","order":10,"width":0,"height":0,"passthru":false,"outs":"all","topic":"openAger/fridge1/set/pwm","min":0,"max":"100","step":1,"x":1050,"y":800,"wires":[["cc4f87dc.b00118"]]},{"id":"23ba67be.a5d9d8","type":"ui_gauge","z":"efbc7696.354458","name":"PWM duty %","group":"801bafd8.09a2","order":9,"width":"3","height":"3","gtype":"gage","title":"PWM duty %","label":"%","format":"{{value}}","min":0,"max":"100","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":1450,"y":1060,"wires":[]},{"id":"a8986b64.00cb38","type":"ui_gauge","z":"efbc7696.354458","name":"","group":"801bafd8.09a2","order":9,"width":"3","height":"3","gtype":"gage","title":"Fan RPM","label":"%","format":"{{value}}","min":"1500","max":"3500","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":1440,"y":1100,"wires":[]},{"id":"27de2d0a.1b0592","type":"range","z":"efbc7696.354458","minin":"0","maxin":"100","minout":"1500","maxout":"3500","action":"scale","round":false,"property":"payload","name":"Fan duty -> rpm","x":1260,"y":1080,"wires":[["a8986b64.00cb38"]]},{"id":"828e3bd3.a6a5a8","type":"function","z":"bfb0b9c4.4e1408","name":"Check lock state","func":"msg.payload = global.get(\"lock\");\nif (msg.payload == \"0\") {\n msg.enabled = true;\n} else {\n msg.enabled = false;\n}\ndelete msg.payload;\nreturn msg;","outputs":1,"noerr":0,"x":380,"y":640,"wires":[["7e43bddd.269404","52fea353.d681dc"]]},{"id":"b876a377.73a2a","type":"function","z":"efbc7696.354458","name":"get global lock status","func":"msg.payload = global.get(\"lock\");\nreturn msg;","outputs":1,"noerr":0,"x":320,"y":500,"wires":[["fe648e07.fa6ee"]]},{"id":"c19ead31.0a7da","type":"inject","z":"efbc7696.354458","name":"10 sek","repeat":"10","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":120,"y":500,"wires":[["b876a377.73a2a"]]},{"id":"635e9835.fd2ab8","type":"mqtt out","z":"efbc7696.354458","name":"fridge1 no retain","topic":"","qos":"","retain":"false","broker":"4841307a.c2f52","x":1280,"y":160,"wires":[]},{"id":"660a147a.e25c9c","type":"comment","z":"bfb0b9c4.4e1408","name":"Serverside Checks - Telegram instead Emails","info":"","x":230,"y":2020,"wires":[]},{"id":"604787a9.79f768","type":"function","z":"efbc7696.354458","name":"set global ","func":"//context.global.mode = msg.payload;\nglobal.set(\"ti\",msg.payload);\nreturn msg;","outputs":1,"noerr":0,"x":840,"y":2380,"wires":[["9336f32b.75a08"]]},{"id":"aa9258ff.d2a7c8","type":"function","z":"efbc7696.354458","name":"set global ","func":"//context.global.mode = msg.payload;\nglobal.set(\"hi\",msg.payload);\nreturn msg;","outputs":1,"noerr":0,"x":860,"y":2680,"wires":[["511b0d14.dfe9f4"]]},{"id":"c46444ef.243438","type":"function","z":"efbc7696.354458","name":"set global ","func":"var zeitpunkt = [];\nvar now = new Date();\nvar month = now.getMonth()+1;\nvar day = now.getDate();\nvar year = now.getFullYear();\nvar hour = now.getHours();\nvar min = now.getMinutes();\nvar sek = now.getSeconds();\nvar mil = now.getMilliseconds();\n\nmonth = (\"0\" + month).slice(-2);\nday = (\"0\" + day).slice(-2);\n\nhour = (\"0\" + hour).slice(-2);\nmin = (\"0\" + min).slice(-2);\nsek = (\"0\" + sek).slice(-2);\n//mil = (\"000\" + sek).slice(-3);\n\n\nzeitpunkt = day + \".\" + month + \".\" + year + \" \" + hour + \":\" + min + \":\" + sek;\n\nglobal.set(\"pw\",msg.payload);\nglobal.set(\"up\",zeitpunkt);\nreturn msg;","outputs":1,"noerr":0,"x":900,"y":2940,"wires":[["a15a8a1f.5ab588"]]},{"id":"eda72976.1bbe88","type":"function","z":"efbc7696.354458","name":"set global ","func":"//context.global.mode = msg.payload;\nglobal.set(\"co\",msg.payload);\nreturn msg;","outputs":1,"noerr":0,"x":760,"y":4480,"wires":[["f3aa7231.3797c"]]},{"id":"e3f2c1b.865b74","type":"function","z":"bfb0b9c4.4e1408","name":"Configpush","func":"msg.topic = \"openAger/fridge1/set/configpush\";\nmsg.payload = 1;\nreturn msg;","outputs":1,"noerr":0,"x":870,"y":240,"wires":[["2a3dc08a.52357"]]},{"id":"15d0bfc6.050ce","type":"function","z":"abcf932e.43e39","name":"Set Global","func":"\nglobal.set(\"daycount1\",msg.payload);\nreturn msg;","outputs":1,"noerr":0,"x":750,"y":1200,"wires":[["d2ade354.bf3d4"]]},{"id":"3d0e353b.9f971a","type":"function","z":"abcf932e.43e39","name":"Set Global","func":"\nglobal.set(\"daycount2\",msg.payload);\nreturn msg;","outputs":1,"noerr":0,"x":750,"y":1240,"wires":[["c711091f.79f058"]]},{"id":"a7a72049.53d9c","type":"function","z":"abcf932e.43e39","name":"Set Global","func":"\nglobal.set(\"daycount3\",msg.payload);\nreturn msg;","outputs":1,"noerr":0,"x":750,"y":1280,"wires":[["10eee08c.325e2f"]]},{"id":"18196d06.4850a3","type":"function","z":"abcf932e.43e39","name":"Set Global","func":"\nglobal.set(\"daycount4\",msg.payload);\nreturn msg;","outputs":1,"noerr":0,"x":750,"y":1320,"wires":[["aefa116f.0ec9"]]},{"id":"721bb493.fa3d4c","type":"mqtt in","z":"bfb0b9c4.4e1408","name":"MQTT temperatures","topic":"openAger/fridge1/sensors/temperature","qos":"0","broker":"4841307a.c2f52","x":170,"y":2180,"wires":[["d36c9cd7.5ddc7","4e455108.8a6d3"]]},{"id":"d36c9cd7.5ddc7","type":"json","z":"bfb0b9c4.4e1408","name":"Json","property":"payload","action":"","pretty":false,"x":350,"y":2180,"wires":[["6852d192.e2ffe"]]},{"id":"6852d192.e2ffe","type":"function","z":"bfb0b9c4.4e1408","name":"Abweichung prüfen","func":"temp_int = parseFloat(msg.payload.ti);\nset_hyst = parseFloat(global.get(\"set_hyst\"));\nset_temp = parseFloat(global.get(\"set_temp\"));\ndev = 0;\nmsg.topic = \"Message von OpenAger\";\nvar zeitpunkt = [];\nvar now = new Date();\nvar month = now.getMonth()+1;\nvar day = now.getDate();\nvar year = now.getFullYear();\nvar hour = now.getHours();\nvar min = now.getMinutes();\nvar sek = now.getSeconds();\nvar mil = now.getMilliseconds();\n\nmonth = (\"0\" + month).slice(-2);\nday = (\"0\" + day).slice(-2);\nhour = (\"0\" + hour).slice(-2);\nmin = (\"0\" + min).slice(-2);\nsek = (\"0\" + sek).slice(-2);\n//mil = (\"000\" + sek).slice(-3);\n\nzeitpunkt = \" (\" + day + \".\" + month + \".\" + year + \" \" + hour + \":\" + min + \":\" + sek + \") \";\nif (temp_int > ( set_temp + ( set_hyst / 2 ) + 0.5)) {\n//if (temp_int > (set_temp + ( set_hyst / 2 ))) { \n dev = temp_int - set_temp - ( set_hyst / 2 );\n msg.payload = \"Achtung - Temperatur ist \" + dev.toFixed(2) + \" Grad über der Hysteresezone!\" + zeitpunkt;\n return msg;\n//} else if (temp_int < (set_temp - ( set_hyst / 2 ))) {\n} else if (temp_int < ( set_temp - ( set_hyst / 2 ) - 0.5)) {\n dev = set_temp - temp_int - ( set_hyst / 2 );\n msg.payload = \"Achtung - Temperatur ist \" + dev.toFixed(2) + \" Grad unter der Hysteresezone!\" + zeitpunkt;\n return msg;\n} else {\n // within hysterese!\n // msg.payload = \"Alles ok\"+zeitpunkt;\n msg.payload = \"alles ok\";\n\n}\n","outputs":1,"noerr":0,"x":530,"y":2180,"wires":[["27a1373a.16aeb8"]]},{"id":"27a1373a.16aeb8","type":"throttle","z":"bfb0b9c4.4e1408","name":"Nachrichten limitieren / 15min","throttleType":"time","timeLimit":"15","timeLimitType":"minutes","countLimit":0,"blockSize":0,"locked":false,"x":830,"y":2180,"wires":[["a671297c.8393e8"]]},{"id":"ae75bfc3.5e877","type":"telegrambot-command","z":"bfb0b9c4.4e1408","name":"status bitte","bot":"ec3e3b54.4a8598","command":"status bitte","commandType":"str","commandCase":false,"x":160,"y":2360,"wires":[["a1ac2c51.5014a"]]},{"id":"a1ac2c51.5014a","type":"function","z":"bfb0b9c4.4e1408","name":"Payload schreiben","func":"\n\n// neue msg objekte basteln, telegram zweige aufbauen für die chat id!\nmsg2 = {};\nmsg2.telegram = {};\nmsg2.telegram.chat = {};\n\nmsg3 = {};\nmsg3.telegram = {};\nmsg3.telegram.chat = {};\n\nti = parseFloat(global.get(\"ti\"));\nhi = parseFloat(global.get(\"hi\"));\npw = parseFloat(global.get(\"pw\"));\nco = parseFloat(global.get(\"co\"));\nup = global.get(\"up\");\nweight1 = parseFloat(global.get(\"weight1\"));\nweight2 = parseFloat(global.get(\"weight2\"));\nweight3 = parseFloat(global.get(\"weight3\"));\nweight4 = parseFloat(global.get(\"weight4\"));\nwater1 = parseFloat(global.get(\"water1\")).toFixed(1);\nwater2 = parseFloat(global.get(\"water2\")).toFixed(1);\nwater3 = parseFloat(global.get(\"water3\")).toFixed(1);\nwater4 = parseFloat(global.get(\"water4\")).toFixed(1);\n\ndaycount1 = parseFloat(global.get(\"daycount1\")).toFixed(1);\ndaycount2 = parseFloat(global.get(\"daycount2\")).toFixed(1);\ndaycount3 = parseFloat(global.get(\"daycount3\")).toFixed(1);\ndaycount4 = parseFloat(global.get(\"daycount4\")).toFixed(1);\n\ncntscale = 0;\nkuehlung = \"unbekannt\";\ngewichtstring = \"\"\n\nif (co == 1) {\n kuehlung = \"an\";\n}\n\nif (co === 0) {\n kuehlung = \"aus\";\n}\n\nif (water1 > 0) {\n gewichtstring = gewichtstring+ \"Waage 1 läuft seit \" + daycount1 + \" Tagen und hat ein Gewicht von \" + weight1 + \"kg bei einem Wasserverlust von \" + water1 + \" %. \";\n cntscale++;\n}\nif (water2 > 0) {\n gewichtstring = gewichtstring + \"Waage 2 läuft seit \" + daycount2 + \" Tagen und hat ein Gewicht von \" + weight2 + \"kg bei einem Wasserverlust von \" + water2 + \" %. \";\n cntscale++;\n}\nif (water3 > 0) {\n gewichtstring = gewichtstring + \"Waage 3 läuft seit \" + daycount3 + \" Tagen und hat ein Gewicht von \" + weight3 + \"kg bei einem Wasserverlust von \" + water3 + \" %. \";\n cntscale++;\n}\nif (water4 > 0) {\n gewichtstring = gewichtstring + \"Waage 4 läuft seit \" + daycount4 + \" Tagen und hat ein Gewicht von \" + weight4 + \"kg bei einem Wasserverlust von \" + water4 + \" %. \";\n cntscale++;\n}\n\n//node.warn(msg.telegram.chat.id);\nmsg.payload = \"Die Innen - Temperatur beträgt \"+ ti + \"°C bei einer Luftfeuchte von \";\nmsg.payload = msg.payload + hi + \"%. Der Stromverbrauch liegt bei \" + pw ;\nmsg.payload = msg.payload + \" Watt und die Kühlung ist gerade \" + kuehlung + \".\";\n\nmsg3.payload = \" Das letzte Lebenszeichen war um \" + up + \"...\";\nmsg3.telegram.chat.id = msg.telegram.chat.id;\nmsg2.payload = \"Es sind gerade \" + cntscale + \" Waagen aktiv. \" + gewichtstring;\nmsg2.telegram.chat.id = msg.telegram.chat.id;\n\nreturn [ msg, msg2, msg3 ];\n\n\n\n","outputs":3,"noerr":0,"x":370,"y":2360,"wires":[["610e7168.9a4ee"],["610e7168.9a4ee"],["610e7168.9a4ee"]]},{"id":"735f9af9.98bdb4","type":"telegrambot-command","z":"bfb0b9c4.4e1408","name":"status","bot":"ec3e3b54.4a8598","command":"status","commandType":"str","commandCase":false,"x":150,"y":2300,"wires":[["990aa717.1d80c8"]]},{"id":"610e7168.9a4ee","type":"telegrambot-notify","z":"bfb0b9c4.4e1408","name":"Sende Botantwort","bot":"ec3e3b54.4a8598","chatId":"","message":"","parseMode":"","x":1130,"y":2360,"wires":[]},{"id":"990aa717.1d80c8","type":"function","z":"bfb0b9c4.4e1408","name":"Payload schreiben","func":"\n\nmsg.payload = \"Ohne 'bitte' gibts nix...\";\nreturn msg;\n\n\n\n","outputs":1,"noerr":0,"x":370,"y":2300,"wires":[["610e7168.9a4ee"]]},{"id":"816e80f3.52e6c","type":"function","z":"bfb0b9c4.4e1408","name":"Payload schreiben","func":"\n\nmsg.payload = \"Witzig ha?\";\nreturn msg;\n\n\n\n","outputs":1,"noerr":0,"x":370,"y":2260,"wires":[["610e7168.9a4ee"]]},{"id":"a671297c.8393e8","type":"telegrambot-notify","z":"bfb0b9c4.4e1408","name":"Sende Abweichung Hysterese","bot":"ec3e3b54.4a8598","chatId":"542125703","message":"","parseMode":"","x":1170,"y":2180,"wires":[]},{"id":"a5a73d05.cb671","type":"msg-speed","z":"bfb0b9c4.4e1408","name":"Actuator Speed/min","frequency":"min","estimation":false,"ignore":true,"x":470,"y":2460,"wires":[["bafa5972.9d9f38","2d34a7e5.30db38"],[]]},{"id":"bafa5972.9d9f38","type":"ui_chart","z":"bfb0b9c4.4e1408","name":"C_Actuator_Speed","group":"c1fcc324.6a01","order":1,"width":0,"height":0,"label":"Actuator Speed","chartType":"line","legend":"false","xformat":"HH:mm:ss","interpolate":"bezier","nodata":"loading","dot":false,"ymin":"","ymax":"30","removeOlder":"10","removeOlderPoints":"","removeOlderUnit":"60","cutout":0,"useOneColor":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":true,"outputs":2,"x":730,"y":2420,"wires":[[],[]]},{"id":"65e196f6.141868","type":"mqtt in","z":"bfb0b9c4.4e1408","name":"MQTT fridge1 actuators","topic":"openAger/fridge1/actuators/#","qos":"0","datatype":"auto","broker":"4841307a.c2f52","x":180,"y":2460,"wires":[["a5a73d05.cb671"]]},{"id":"2d34a7e5.30db38","type":"switch","z":"bfb0b9c4.4e1408","name":"> 50","property":"payload","propertyType":"msg","rules":[{"t":"gt","v":"50","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":670,"y":2500,"wires":[["45775f01.8e82c"]]},{"id":"e82a6742.16b9f8","type":"telegrambot-notify","z":"bfb0b9c4.4e1408","name":"Sende Warnung \"Flattern\"","bot":"ec3e3b54.4a8598","chatId":"542125703","message":"Mehr als 50 Acutator Messages pro Minute!","parseMode":"","x":1170,"y":2500,"wires":[]},{"id":"45775f01.8e82c","type":"throttle","z":"bfb0b9c4.4e1408","name":"Nachrichten limitieren / 15min","throttleType":"time","timeLimit":"15","timeLimitType":"minutes","countLimit":0,"blockSize":0,"locked":false,"x":890,"y":2500,"wires":[["e82a6742.16b9f8"]]},{"id":"6a5e758e.9bd86c","type":"inject","z":"bfb0b9c4.4e1408","name":"","repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":160,"y":2240,"wires":[["816e80f3.52e6c"]]},{"id":"4e455108.8a6d3","type":"msg-speed","z":"bfb0b9c4.4e1408","name":"SensorMessungen","frequency":"min","estimation":false,"ignore":false,"x":410,"y":2100,"wires":[["236f705d.bb68f"],[]]},{"id":"236f705d.bb68f","type":"switch","z":"bfb0b9c4.4e1408","name":"=0","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"0","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":610,"y":2080,"wires":[["464d30df.f142b"]]},{"id":"ab993a0.a16c9c8","type":"telegrambot-notify","z":"bfb0b9c4.4e1408","name":"Sende: Offline?","bot":"ec3e3b54.4a8598","chatId":"542125703","message":"Keine Sensormessung seit 1min! Node Neustart oder Offline?","parseMode":"","x":1120,"y":2100,"wires":[]},{"id":"464d30df.f142b","type":"throttle","z":"bfb0b9c4.4e1408","name":"Nachrichten limitieren / 15min","throttleType":"time","timeLimit":"15","timeLimitType":"minutes","countLimit":0,"blockSize":0,"locked":false,"x":870,"y":2100,"wires":[["ab993a0.a16c9c8"]]},{"id":"c338dee5.1db07","type":"e-mail","z":"bfb0b9c4.4e1408","server":"smtp.gmail.com","port":"465","secure":true,"name":"valki@valki.com","dname":"","x":1120,"y":2040,"wires":[]},{"id":"673224c0.08ebec","type":"debug","z":"bfb0b9c4.4e1408","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":840,"y":2020,"wires":[]},{"id":"b26ea238.5357f","type":"ui_text_input","z":"efbc7696.354458","name":"TicksMqtt","label":"TicksMqtt","tooltip":"","group":"4b96690f.894e08","order":1,"width":0,"height":0,"passthru":false,"mode":"text","delay":"0","topic":"openAger/fridge1/set/ticksmqtt","x":1080,"y":1660,"wires":[["cc4f87dc.b00118"]]},{"id":"9641241a.69bed8","type":"influxdb in","z":0,"influxdb":"eba91e98.1456e","name":"time query","query":"select * from test;","x":610,"y":280,"wires":[[]]},{"id":"96f59d1b.efbdd","type":"influxdb out","z":"efbc7696.354458","influxdb":"7ec0c1dc.cf4b3","name":"temperatures","measurement":"temperatures","precision":"","retentionPolicy":"","x":470,"y":2240,"wires":[]},{"id":"48279d70.8018d4","type":"influxdb out","z":"efbc7696.354458","influxdb":"7ec0c1dc.cf4b3","name":"humidity","measurement":"humidity","precision":"","retentionPolicy":"","x":420,"y":2540,"wires":[]},{"id":"bce52153.5caa1","type":"influxdb out","z":"efbc7696.354458","influxdb":"7ec0c1dc.cf4b3","name":"special","measurement":"special","precision":"","retentionPolicy":"","x":400,"y":2840,"wires":[]},{"id":"92895b56.58b6e8","type":"influxdb out","z":"efbc7696.354458","influxdb":"7ec0c1dc.cf4b3","name":"scales","measurement":"scales","precision":"","retentionPolicy":"","x":350,"y":3160,"wires":[]},{"id":"ae1a4f61.c8ff","type":"influxdb out","z":"efbc7696.354458","influxdb":"7ec0c1dc.cf4b3","name":"historic","measurement":"historic","precision":"","retentionPolicy":"","x":380,"y":3360,"wires":[]},{"id":"41757724.dd4ba8","type":"influxdb out","z":"efbc7696.354458","influxdb":"7ec0c1dc.cf4b3","name":"pressure","measurement":"pressure","precision":"","retentionPolicy":"","x":380,"y":3680,"wires":[]},{"id":"82ef01c7.24802","type":"influxdb out","z":"efbc7696.354458","influxdb":"7ec0c1dc.cf4b3","name":"additional","measurement":"additional","precision":"","retentionPolicy":"","x":380,"y":4040,"wires":[]},{"id":"ce844940.602108","type":"influxdb out","z":"efbc7696.354458","influxdb":"7ec0c1dc.cf4b3","name":"set","measurement":"set","precision":"","retentionPolicy":"","x":370,"y":4200,"wires":[]},{"id":"c1a13cb0.b0a21","type":"influxdb out","z":"efbc7696.354458","influxdb":"7ec0c1dc.cf4b3","name":"states","measurement":"states","precision":"","retentionPolicy":"","x":350,"y":4420,"wires":[]}]