I want to change this flow and it is currently running on db1.8. but I want to use it with db2.0. The queries have changed.
Can someone help me to create the right query?
[
{
"id": "7e76473157e64de4",
"type": "influxdb in",
"z": "22bb2ce990740b9b",
"influxdb": "d49556922db36022",
"name": "Abfrage",
"query": "select * from \"KSEM\".\"KSEM2\" order by time desc Limit 1",
"rawOutput": false,
"precision": "s",
"retentionPolicy": "",
"org": "smarthome",
"x": 320,
"y": 1080,
"wires": [
[
"5df5518c97863b87"
]
]
},
{
"id": "ae39b4755d370594",
"type": "inject",
"z": "22bb2ce990740b9b",
"name": "jede Minute",
"props": [
{
"p": "payload"
}
],
"repeat": "60",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "true",
"payloadType": "bool",
"x": 110,
"y": 1080,
"wires": [
[
"7e76473157e64de4"
]
]
},
{
"id": "5df5518c97863b87",
"type": "function",
"z": "22bb2ce990740b9b",
"name": "Influx",
"func": "let Bez_M = msg.payload[0].Bezug;\nlet Ein_M = msg.payload[0].Einsp;\nlet Bez_T = msg.payload[1].Bezug;\nlet Ein_T = msg.payload[1].Einsp;\nmsg.payload = {Bez_M,Ein_M,Bez_T,Ein_T};\nmsg.topic = \"täglich & monatlich\";\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 470,
"y": 1080,
"wires": [
[
"6eed8a16b4174014"
]
]
},
{
"id": "96f3e127a909ad43",
"type": "join",
"z": "22bb2ce990740b9b",
"name": "",
"mode": "custom",
"build": "object",
"property": "payload",
"propertyType": "msg",
"key": "topic",
"joiner": "\\n",
"joinerType": "str",
"accumulate": false,
"timeout": "",
"count": "2",
"reduceRight": false,
"reduceExp": "",
"reduceInit": "",
"reduceInitType": "",
"reduceFixup": "",
"x": 470,
"y": 1120,
"wires": [
[
"6eed8a16b4174014"
]
]
},
{
"id": "6eed8a16b4174014",
"type": "join",
"z": "22bb2ce990740b9b",
"name": "",
"mode": "custom",
"build": "merged",
"property": "payload",
"propertyType": "msg",
"key": "topic",
"joiner": "\\n",
"joinerType": "str",
"accumulate": false,
"timeout": "",
"count": "6",
"reduceRight": false,
"reduceExp": "",
"reduceInit": "",
"reduceInitType": "",
"reduceFixup": "",
"x": 690,
"y": 1080,
"wires": [
[
"096d0b59bafc40bb"
]
]
},
{
"id": "a2805ed26f8df196",
"type": "cronplus",
"z": "22bb2ce990740b9b",
"name": "jede Minute",
"outputField": "payload",
"timeZone": "",
"persistDynamic": false,
"commandResponseMsgOutput": "output1",
"outputs": 1,
"options": [
{
"name": "Bezug Zähler",
"topic": "Bez",
"payloadType": "flow",
"payload": "Bezug",
"expressionType": "cron",
"expression": "0 * * * * * *",
"location": "",
"offset": "0",
"solarType": "all",
"solarEvents": "sunrise,sunset"
},
{
"name": "Einspeisung Zähler",
"topic": "Ein",
"payloadType": "flow",
"payload": "Einsp",
"expressionType": "cron",
"expression": "0 * * * * * *",
"location": "",
"offset": "0",
"solarType": "all",
"solarEvents": "sunrise,sunset"
}
],
"x": 110,
"y": 1120,
"wires": [
[
"96f3e127a909ad43"
]
]
},
{
"id": "096d0b59bafc40bb",
"type": "function",
"z": "22bb2ce990740b9b",
"name": "Werte",
"func": "let Bez_T = msg.payload.Bez - msg.payload.Bez_T;\nlet Bez_M = msg.payload.Bez - msg.payload.Bez_M;\nlet Ein_T = msg.payload.Ein - msg.payload.Ein_T;\nlet Ein_M = msg.payload.Ein - msg.payload.Ein_M;\nmsg.payload = {Bez_M,Bez_T,Ein_M,Ein_T};\nObject.entries(msg.payload).forEach((v) =>{\n msg.payload[v[0]] = Math.round(v[1]*100)/100;\n})\nmsg.topic = \"Auswertung\";\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 810,
"y": 1080,
"wires": [
[
"58554023b0d4e2fb",
"f08d22bd27e93e41",
"1f5be3028323fe0b",
"01e3cee029bfe671"
]
]
},
{
"id": "58554023b0d4e2fb",
"type": "ui_text",
"z": "22bb2ce990740b9b",
"group": "cab6742689765c7e",
"order": 2,
"width": 0,
"height": 0,
"name": "Einspeisung heute",
"label": "<b><font color=orange> Einspeisung",
"format": "{{msg.payload.Ein_T}} kWh",
"layout": "row-spread",
"className": "",
"x": 1010,
"y": 1060,
"wires": []
},
{
"id": "1f5be3028323fe0b",
"type": "ui_text",
"z": "22bb2ce990740b9b",
"group": "e95a7cdc52bfdb3e",
"order": 2,
"width": 0,
"height": 0,
"name": "Einspeisung Monat",
"label": "<b><font color=orange> Einspeisung",
"format": "{{msg.payload.Ein_M}} kWh",
"layout": "row-spread",
"className": "",
"x": 1010,
"y": 1100,
"wires": []
},
{
"id": "f08d22bd27e93e41",
"type": "ui_text",
"z": "22bb2ce990740b9b",
"group": "cab6742689765c7e",
"order": 1,
"width": 0,
"height": 0,
"name": "Bezug heute",
"label": "<b><font color=red> Bezug",
"format": "{{msg.payload.Bez_T}} kWh",
"layout": "row-spread",
"className": "",
"x": 990,
"y": 1140,
"wires": []
},
{
"id": "01e3cee029bfe671",
"type": "ui_text",
"z": "22bb2ce990740b9b",
"group": "e95a7cdc52bfdb3e",
"order": 1,
"width": 0,
"height": 0,
"name": "Bezug Monat",
"label": "<b><font color=red> Bezug",
"format": "{{msg.payload.Bez_M}} kWh",
"layout": "row-spread",
"className": "",
"x": 990,
"y": 1180,
"wires": []
},
{
"id": "d49556922db36022",
"type": "influxdb",
"hostname": "127.0.0.1",
"port": "8086",
"protocol": "http",
"database": "db",
"name": "InfluxDB",
"usetls": false,
"tls": "",
"influxdbVersion": "2.0",
"url": "http://192.168.178.16:8086",
"rejectUnauthorized": false
},
{
"id": "cab6742689765c7e",
"type": "ui_group",
"name": "Heute",
"tab": "64033f10e63bd8ab",
"order": 3,
"disp": true,
"width": "5",
"collapse": false,
"className": ""
},
{
"id": "e95a7cdc52bfdb3e",
"type": "ui_group",
"name": "Monat",
"tab": "64033f10e63bd8ab",
"order": 4,
"disp": true,
"width": "5",
"collapse": false,
"className": ""
},
{
"id": "64033f10e63bd8ab",
"type": "ui_tab",
"name": "Tageswerte",
"icon": "trending_up",
"order": 5,
"disabled": false,
"hidden": false
}
]