try to fix chart

This commit is contained in:
JcDenis 2024-05-20 09:55:50 +02:00
parent 6a852d3605
commit 1f75b5da29
2 changed files with 230 additions and 340 deletions

File diff suppressed because one or more lines are too long

View file

@ -209,7 +209,7 @@
], ],
"x": 68, "x": 68,
"y": 953, "y": 953,
"w": 2784, "w": 2484,
"h": 914 "h": 914
}, },
{ {
@ -288,7 +288,6 @@
"2b909499790cab01", "2b909499790cab01",
"73cb2cee63b22726", "73cb2cee63b22726",
"eeab0942d3417e79", "eeab0942d3417e79",
"012dbd0798e129d0",
"23dabc507247dfc0", "23dabc507247dfc0",
"992ae204a4e2dac4", "992ae204a4e2dac4",
"32acac8443b52345", "32acac8443b52345",
@ -300,26 +299,22 @@
"ce300a4fa3da028b", "ce300a4fa3da028b",
"5c3172390ae5eefb", "5c3172390ae5eefb",
"898d54359ae10f09", "898d54359ae10f09",
"3506806a53b51ad4",
"4ca2710a68ee8cf7", "4ca2710a68ee8cf7",
"61b1903f970a1cda",
"ea377511bda2edc5", "ea377511bda2edc5",
"237768ea35c715cc",
"bdd8dd4ea1399d2c",
"1d632162649dc370",
"2ef1e88672d3c10e",
"431dc692e49f3a64",
"8bb2921d3035f78f", "8bb2921d3035f78f",
"f2de1a8431dc2fae", "d28afb23b014c0d3",
"1842463241e5e29b", "2b7c57be9b721cd6",
"f7fbe14747523905", "8baf81aaecbe3ab0",
"c625a5bfe4c3e6f2", "f64316cbc425c3fb",
"a1e430f33bf65354", "27ccfea85f2033da",
"50bd0c9ee50f09a0" "529b8f85ea492b9a",
"154312b0a80ad157",
"8bc96e353c45fe20",
"a8c19f86a71e21fe"
], ],
"x": 94, "x": 94,
"y": 1459, "y": 1459,
"w": 2732, "w": 2432,
"h": 382 "h": 382
}, },
{ {
@ -4419,7 +4414,7 @@
"group": "c19749d8e5cc1e1f", "group": "c19749d8e5cc1e1f",
"name": "chart power", "name": "chart power",
"label": "", "label": "",
"order": 5, "order": 4,
"chartType": "line", "chartType": "line",
"category": "_field", "category": "_field",
"categoryType": "property", "categoryType": "property",
@ -4450,7 +4445,7 @@
"width": 6, "width": 6,
"height": "6", "height": "6",
"className": "", "className": "",
"x": 2590, "x": 2290,
"y": 1800, "y": 1800,
"wires": [ "wires": [
[] []
@ -4468,7 +4463,7 @@
"precision": "", "precision": "",
"retentionPolicy": "", "retentionPolicy": "",
"org": "iotredloop", "org": "iotredloop",
"x": 2220, "x": 1920,
"y": 1800, "y": 1800,
"wires": [ "wires": [
[ [
@ -4503,7 +4498,7 @@
"from": "", "from": "",
"to": "", "to": "",
"reg": false, "reg": false,
"x": 2030, "x": 1730,
"y": 1800, "y": 1800,
"wires": [ "wires": [
[ [
@ -4528,35 +4523,6 @@
] ]
] ]
}, },
{
"id": "012dbd0798e129d0",
"type": "switch",
"z": "aab0c030de7df5cc",
"g": "0db8801c7e0e4401",
"name": "check if field exists",
"property": "field",
"propertyType": "msg",
"rules": [
{
"t": "regex",
"v": "(electric meter|solar panels)",
"vt": "str",
"case": false
}
],
"checkall": "false",
"repair": false,
"outputs": 1,
"x": 1570,
"y": 1680,
"wires": [
[
"1842463241e5e29b",
"c625a5bfe4c3e6f2",
"a1e430f33bf65354"
]
]
},
{ {
"id": "23dabc507247dfc0", "id": "23dabc507247dfc0",
"type": "link in", "type": "link in",
@ -4571,8 +4537,7 @@
"wires": [ "wires": [
[ [
"ecd8bf936f027cdc", "ecd8bf936f027cdc",
"ea377511bda2edc5", "ea377511bda2edc5"
"f7fbe14747523905"
] ]
] ]
}, },
@ -4603,12 +4568,14 @@
"from": "", "from": "",
"to": "", "to": "",
"reg": false, "reg": false,
"x": 2410, "x": 1190,
"y": 1560, "y": 1560,
"wires": [ "wires": [
[ [
"c60c3603ff04bca1", "c60c3603ff04bca1",
"b9f8b477c288e0f0" "b9f8b477c288e0f0",
"4ca2710a68ee8cf7",
"a8c19f86a71e21fe"
] ]
] ]
}, },
@ -4630,7 +4597,7 @@
"fontSize": 16, "fontSize": 16,
"color": "#717171", "color": "#717171",
"className": "", "className": "",
"x": 2750, "x": 2450,
"y": 1500, "y": 1500,
"wires": [] "wires": []
}, },
@ -4654,7 +4621,7 @@
"from": "", "from": "",
"to": "", "to": "",
"reg": false, "reg": false,
"x": 2580, "x": 2280,
"y": 1500, "y": 1500,
"wires": [ "wires": [
[ [
@ -4689,7 +4656,7 @@
"from": "", "from": "",
"to": "", "to": "",
"reg": false, "reg": false,
"x": 2410, "x": 1190,
"y": 1500, "y": 1500,
"wires": [ "wires": [
[ [
@ -4706,7 +4673,7 @@
"name": "", "name": "",
"ui": "2d75e4809d2a6fbf", "ui": "2d75e4809d2a6fbf",
"events": "all", "events": "all",
"x": 2580, "x": 2280,
"y": 1560, "y": 1560,
"wires": [ "wires": [
[] []
@ -4732,7 +4699,7 @@
"from": "", "from": "",
"to": "", "to": "",
"reg": false, "reg": false,
"x": 2410, "x": 2110,
"y": 1800, "y": 1800,
"wires": [ "wires": [
[ [
@ -4763,7 +4730,7 @@
"y": 1560, "y": 1560,
"wires": [ "wires": [
[ [
"3506806a53b51ad4" "2b7c57be9b721cd6"
] ]
] ]
}, },
@ -4778,7 +4745,7 @@
], ],
"linkType": "static", "linkType": "static",
"timeout": "30", "timeout": "30",
"x": 2220, "x": 1920,
"y": 1680, "y": 1680,
"wires": [ "wires": [
[ [
@ -4813,7 +4780,7 @@
"from": "", "from": "",
"to": "", "to": "",
"reg": false, "reg": false,
"x": 2410, "x": 2110,
"y": 1680, "y": 1680,
"wires": [ "wires": [
[ [
@ -4827,7 +4794,7 @@
"z": "aab0c030de7df5cc", "z": "aab0c030de7df5cc",
"g": "0db8801c7e0e4401", "g": "0db8801c7e0e4401",
"group": "c19749d8e5cc1e1f", "group": "c19749d8e5cc1e1f",
"order": 3, "order": 2,
"width": "6", "width": "6",
"height": "1", "height": "1",
"name": "power", "name": "power",
@ -4839,102 +4806,32 @@
"fontSize": 16, "fontSize": 16,
"color": "#717171", "color": "#717171",
"className": "", "className": "",
"x": 2570, "x": 2270,
"y": 1680, "y": 1680,
"wires": [] "wires": []
}, },
{
"id": "3506806a53b51ad4",
"type": "delay",
"z": "aab0c030de7df5cc",
"g": "0db8801c7e0e4401",
"name": "90 ms",
"pauseType": "delay",
"timeout": "90",
"timeoutUnits": "milliseconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": false,
"allowrate": false,
"outputs": 1,
"x": 570,
"y": 1680,
"wires": [
[
"237768ea35c715cc"
]
]
},
{ {
"id": "4ca2710a68ee8cf7", "id": "4ca2710a68ee8cf7",
"type": "change", "type": "change",
"z": "aab0c030de7df5cc", "z": "aab0c030de7df5cc",
"g": "0db8801c7e0e4401", "g": "0db8801c7e0e4401",
"name": "reset", "name": "reset",
"rules": [ "rules": [],
{
"t": "set",
"p": "topic",
"pt": "msg",
"to": "",
"tot": "str"
},
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "",
"tot": "str"
},
{
"t": "set",
"p": "class",
"pt": "msg",
"to": "remove",
"tot": "str"
}
],
"action": "", "action": "",
"property": "", "property": "",
"from": "", "from": "",
"to": "", "to": "",
"reg": false, "reg": false,
"x": 2410, "x": 2110,
"y": 1620, "y": 1620,
"wires": [ "wires": [
[ [
"44795f19725dfb16", "44795f19725dfb16",
"898d54359ae10f09", "898d54359ae10f09",
"61b1903f970a1cda" "8bc96e353c45fe20"
] ]
] ]
}, },
{
"id": "61b1903f970a1cda",
"type": "ui-text",
"z": "aab0c030de7df5cc",
"g": "0db8801c7e0e4401",
"group": "c19749d8e5cc1e1f",
"order": 4,
"width": "6",
"height": "1",
"name": "tariff",
"label": "",
"format": "{{msg.payload}}",
"layout": "row-right",
"style": false,
"font": "",
"fontSize": 16,
"color": "#717171",
"className": "",
"x": 2570,
"y": 1740,
"wires": []
},
{ {
"id": "9775046f290c1bf5", "id": "9775046f290c1bf5",
"type": "change", "type": "change",
@ -5418,128 +5315,6 @@
] ]
] ]
}, },
{
"id": "237768ea35c715cc",
"type": "change",
"z": "aab0c030de7df5cc",
"g": "0db8801c7e0e4401",
"name": "from global",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "metrics[msg.bucket]",
"tot": "global"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 770,
"y": 1680,
"wires": [
[
"bdd8dd4ea1399d2c"
]
]
},
{
"id": "bdd8dd4ea1399d2c",
"type": "split",
"z": "aab0c030de7df5cc",
"g": "0db8801c7e0e4401",
"name": "",
"splt": "\\n",
"spltType": "str",
"arraySplt": 1,
"arraySpltType": "len",
"stream": false,
"addname": "measurement",
"x": 950,
"y": 1680,
"wires": [
[
"1d632162649dc370"
]
]
},
{
"id": "1d632162649dc370",
"type": "switch",
"z": "aab0c030de7df5cc",
"g": "0db8801c7e0e4401",
"name": "select measurement",
"property": "measurement",
"propertyType": "msg",
"rules": [
{
"t": "eq",
"v": "power",
"vt": "str"
},
{
"t": "eq",
"v": "tariff",
"vt": "str"
}
],
"checkall": "false",
"repair": false,
"outputs": 2,
"x": 1160,
"y": 1680,
"wires": [
[
"2ef1e88672d3c10e"
],
[
"431dc692e49f3a64"
]
]
},
{
"id": "2ef1e88672d3c10e",
"type": "split",
"z": "aab0c030de7df5cc",
"g": "0db8801c7e0e4401",
"name": "",
"splt": "\\n",
"spltType": "str",
"arraySplt": 1,
"arraySpltType": "len",
"stream": false,
"addname": "field",
"x": 1370,
"y": 1680,
"wires": [
[
"012dbd0798e129d0"
]
]
},
{
"id": "431dc692e49f3a64",
"type": "split",
"z": "aab0c030de7df5cc",
"g": "0db8801c7e0e4401",
"name": "",
"splt": "\\n",
"spltType": "str",
"arraySplt": 1,
"arraySpltType": "len",
"stream": false,
"addname": "field",
"x": 1370,
"y": 1740,
"wires": [
[
"f2de1a8431dc2fae"
]
]
},
{ {
"id": "8bb2921d3035f78f", "id": "8bb2921d3035f78f",
"type": "change", "type": "change",
@ -5567,16 +5342,52 @@
"from": "", "from": "",
"to": "", "to": "",
"reg": false, "reg": false,
"x": 2410, "x": 2110,
"y": 1740, "y": 1740,
"wires": [ "wires": [
[ [
"61b1903f970a1cda" "8bc96e353c45fe20"
] ]
] ]
}, },
{ {
"id": "f2de1a8431dc2fae", "id": "d28afb23b014c0d3",
"type": "change",
"z": "aab0c030de7df5cc",
"g": "0db8801c7e0e4401",
"name": "from global",
"rules": [
{
"t": "set",
"p": "power",
"pt": "msg",
"to": "metrics[msg.bucket]['power'][msg.field]",
"tot": "global"
},
{
"t": "set",
"p": "tariff",
"pt": "msg",
"to": "metrics[msg.bucket]['tariff'][msg.field]",
"tot": "global"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 1010,
"y": 1680,
"wires": [
[
"8baf81aaecbe3ab0",
"f64316cbc425c3fb"
]
]
},
{
"id": "2b7c57be9b721cd6",
"type": "switch", "type": "switch",
"z": "aab0c030de7df5cc", "z": "aab0c030de7df5cc",
"g": "0db8801c7e0e4401", "g": "0db8801c7e0e4401",
@ -5594,19 +5405,150 @@
"checkall": "false", "checkall": "false",
"repair": false, "repair": false,
"outputs": 1, "outputs": 1,
"x": 1570, "x": 610,
"y": 1740, "y": 1560,
"wires": [ "wires": [
[ [
"50bd0c9ee50f09a0" "154312b0a80ad157",
"992ae204a4e2dac4"
] ]
] ]
}, },
{ {
"id": "1842463241e5e29b", "id": "8baf81aaecbe3ab0",
"type": "trigger", "type": "switch",
"z": "aab0c030de7df5cc", "z": "aab0c030de7df5cc",
"g": "0db8801c7e0e4401", "g": "0db8801c7e0e4401",
"name": "power",
"property": "power",
"propertyType": "msg",
"rules": [
{
"t": "nnull"
}
],
"checkall": "false",
"repair": false,
"outputs": 1,
"x": 1190,
"y": 1680,
"wires": [
[
"529b8f85ea492b9a"
]
]
},
{
"id": "f64316cbc425c3fb",
"type": "switch",
"z": "aab0c030de7df5cc",
"g": "0db8801c7e0e4401",
"name": "tariff",
"property": "tariff",
"propertyType": "msg",
"rules": [
{
"t": "nnull"
}
],
"checkall": "false",
"repair": false,
"outputs": 1,
"x": 1190,
"y": 1740,
"wires": [
[
"27ccfea85f2033da"
]
]
},
{
"id": "27ccfea85f2033da",
"type": "change",
"z": "aab0c030de7df5cc",
"g": "0db8801c7e0e4401",
"name": "move",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "tariff",
"tot": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 1350,
"y": 1740,
"wires": [
[
"8bb2921d3035f78f"
]
]
},
{
"id": "529b8f85ea492b9a",
"type": "change",
"z": "aab0c030de7df5cc",
"g": "0db8801c7e0e4401",
"name": "move",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "power",
"tot": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 1350,
"y": 1680,
"wires": [
[
"ce300a4fa3da028b",
"3e26b34cc3ab9745"
]
]
},
{
"id": "154312b0a80ad157",
"type": "delay",
"z": "aab0c030de7df5cc",
"g": "0db8801c7e0e4401",
"name": "100 ms",
"pauseType": "delay",
"timeout": "100",
"timeoutUnits": "milliseconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": false,
"allowrate": false,
"outputs": 1,
"x": 820,
"y": 1680,
"wires": [
[
"d28afb23b014c0d3"
]
]
},
{
"id": "3e26b34cc3ab9745",
"type": "trigger",
"z": "aab0c030de7df5cc",
"name": "", "name": "",
"op1": "", "op1": "",
"op2": "", "op2": "",
@ -5620,7 +5562,7 @@
"bytopic": "all", "bytopic": "all",
"topic": "bucket", "topic": "bucket",
"outputs": 1, "outputs": 1,
"x": 1840, "x": 1540,
"y": 1800, "y": 1800,
"wires": [ "wires": [
[ [
@ -5629,7 +5571,7 @@
] ]
}, },
{ {
"id": "f7fbe14747523905", "id": "a8c19f86a71e21fe",
"type": "change", "type": "change",
"z": "aab0c030de7df5cc", "z": "aab0c030de7df5cc",
"g": "0db8801c7e0e4401", "g": "0db8801c7e0e4401",
@ -5648,86 +5590,34 @@
"from": "", "from": "",
"to": "", "to": "",
"reg": false, "reg": false,
"x": 270, "x": 1350,
"y": 1800, "y": 1800,
"wires": [ "wires": [
[ [
"1842463241e5e29b" "3e26b34cc3ab9745"
] ]
] ]
}, },
{ {
"id": "c625a5bfe4c3e6f2", "id": "8bc96e353c45fe20",
"type": "rbe", "type": "ui-text",
"z": "aab0c030de7df5cc", "z": "aab0c030de7df5cc",
"g": "0db8801c7e0e4401", "g": "0db8801c7e0e4401",
"name": "", "group": "c19749d8e5cc1e1f",
"func": "rbe", "order": 3,
"gap": "", "width": "6",
"start": "", "height": "1",
"inout": "out", "name": "tariff",
"septopics": false, "label": "",
"property": "bucket", "format": "{{msg.payload}}",
"topi": "topic", "layout": "row-right",
"x": 1810, "style": false,
"y": 1560, "font": "",
"wires": [ "fontSize": 16,
[ "color": "#717171",
"992ae204a4e2dac4", "className": "",
"4ca2710a68ee8cf7" "x": 2270,
]
]
},
{
"id": "a1e430f33bf65354",
"type": "delay",
"z": "aab0c030de7df5cc",
"g": "0db8801c7e0e4401",
"name": "30 ms",
"pauseType": "delay",
"timeout": "30",
"timeoutUnits": "milliseconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": false,
"allowrate": false,
"outputs": 1,
"x": 1810,
"y": 1680,
"wires": [
[
"ce300a4fa3da028b"
]
]
},
{
"id": "50bd0c9ee50f09a0",
"type": "delay",
"z": "aab0c030de7df5cc",
"g": "0db8801c7e0e4401",
"name": "10 ms",
"pauseType": "delay",
"timeout": "10",
"timeoutUnits": "milliseconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": false,
"allowrate": false,
"outputs": 1,
"x": 1810,
"y": 1740, "y": 1740,
"wires": [ "wires": []
[
"8bb2921d3035f78f"
]
]
} }
] ]