[{"id":"2709204f.b61f8","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"deaf74a4.e5a378","type":"mqtt out","z":"2709204f.b61f8","name":"e_consumption","topic":"domoticz/in","qos":"0","retain":"true","broker":"c2ee527.c62d7b","x":1020,"y":220,"wires":[],"inputLabels":["Test"]},{"id":"57e86193.a35c7","type":"mysql","z":"2709204f.b61f8","mydb":"2a831904.05f906","name":"logdata","x":635,"y":320,"wires":[["307aa134.c6608e","c698aada.736658"]],"l":false},{"id":"7c66ddff.9b2cc4","type":"inject","z":"2709204f.b61f8","name":"Periodic timestamp","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"*/5 0 * * *","once":false,"onceDelay":0.1,"x":140,"y":100,"wires":[["1ef734b.1737dcb"]]},{"id":"c698aada.736658","type":"debug","z":"2709204f.b61f8","name":"a1","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload[0].count_e","targetType":"jsonata","x":750,"y":380,"wires":[]},{"id":"7a599381.d51a3c","type":"function","z":"2709204f.b61f8","name":"SQL_Query","func":"msg = {};\npayload = {};\nmsg.payload=payload;\n//msg.topic = \"SELECT SUM(1000*kWh_periode) AS count_e FROM data_e WHERE Datum = {msg.payload}\";\nmsg.topic = \"SELECT SUM(1000*kWh_periode) AS count_e FROM data_e WHERE Datum = '01-08-2019'\";\nreturn msg;","outputs":1,"noerr":0,"x":530,"y":260,"wires":[["57e86193.a35c7","8c73b53a.a66198"]]},{"id":"307aa134.c6608e","type":"function","z":"2709204f.b61f8","name":"SQL_Value_2_Domoticz","func":"msg = {};\npayload = {};\nmsg.payload=payload;\nmsg.payload.idx=41;\nmsg.payload.nvalue=0;\n//msg.payload.svalue=payload;\nmsg.payload.svalue='4500';\nmsg.topic=\"\";\nreturn msg;","outputs":1,"noerr":0,"x":790,"y":280,"wires":[["deaf74a4.e5a378","e9f2b45a.966ef8"]]},{"id":"e9f2b45a.966ef8","type":"debug","z":"2709204f.b61f8","name":"a2","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","x":990,"y":340,"wires":[]},{"id":"1ef734b.1737dcb","type":"moment","z":"2709204f.b61f8","name":"","topic":"","input":"","inputType":"msg","inTz":"Europe/Amsterdam","adjAmount":0,"adjType":"days","adjDir":"add","format":"'DD-MM-YYYY'","locale":"nl_NL","output":"","outputType":"msg","outTz":"Europe/Amsterdam","x":340,"y":200,"wires":[["d1106606.0d3128","7a599381.d51a3c"]]},{"id":"d1106606.0d3128","type":"debug","z":"2709204f.b61f8","name":"converted","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","x":520,"y":140,"wires":[]},{"id":"8c73b53a.a66198","type":"debug","z":"2709204f.b61f8","name":"SQL Query","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"jsonata","x":690,"y":200,"wires":[]},{"id":"c2ee527.c62d7b","type":"mqtt-broker","z":"","name":"","broker":"192.168.178.28","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"domoticz/in","birthQos":"0","birthRetain":"false","birthPayload":"I'm there","closeTopic":"domoticz/in","closeQos":"0","closeRetain":"false","closePayload":"I will go","willTopic":"domoticz/in","willQos":"0","willRetain":"false","willPayload":"I'm lost"},{"id":"2a831904.05f906","type":"MySQLdatabase","z":"","host":"192.168.178.27","port":"8457","db":"logdata","tz":""}]