EZ_Licht: Lichtsensor richtig ausgewertet

This commit is contained in:
rxf
2026-05-27 16:35:09 +02:00
parent efe8dcf126
commit 401b701689
+569 -77
View File
@@ -1086,7 +1086,7 @@
"page": "9a5095b780d6917f", "page": "9a5095b780d6917f",
"width": "6", "width": "6",
"height": "1", "height": "1",
"order": 4, "order": 5,
"showTitle": true, "showTitle": true,
"className": "", "className": "",
"visible": "true", "visible": "true",
@@ -1293,7 +1293,7 @@
"page": "9a5095b780d6917f", "page": "9a5095b780d6917f",
"width": 6, "width": 6,
"height": 1, "height": 1,
"order": 5, "order": 4,
"showTitle": true, "showTitle": true,
"className": "", "className": "",
"visible": "true", "visible": "true",
@@ -1331,20 +1331,6 @@
"userProps": "", "userProps": "",
"sessionExpiry": "" "sessionExpiry": ""
}, },
{
"id": "883598fbde3d4269",
"type": "ui-group",
"name": "Boden_Temp",
"page": "c6f339624d3ba639",
"width": 6,
"height": 1,
"order": 3,
"showTitle": true,
"className": "",
"visible": "true",
"disabled": "false",
"groupType": "default"
},
{ {
"id": "c6f339624d3ba639", "id": "c6f339624d3ba639",
"type": "ui-page", "type": "ui-page",
@@ -1398,7 +1384,7 @@
{ {
"id": "1f934e808f93452b", "id": "1f934e808f93452b",
"type": "ui-group", "type": "ui-group",
"name": "Boden-Feuchte", "name": "Boden-Feuchte_ELV",
"page": "c6f339624d3ba639", "page": "c6f339624d3ba639",
"width": 6, "width": 6,
"height": 1, "height": 1,
@@ -1412,7 +1398,7 @@
{ {
"id": "da32bdb1eddd2918", "id": "da32bdb1eddd2918",
"type": "ui-group", "type": "ui-group",
"name": "BodeWerte", "name": "BodeWerte_ELV",
"page": "c6f339624d3ba639", "page": "c6f339624d3ba639",
"width": "12", "width": "12",
"height": 1, "height": 1,
@@ -1423,6 +1409,62 @@
"disabled": "false", "disabled": "false",
"groupType": "default" "groupType": "default"
}, },
{
"id": "883598fbde3d4269",
"type": "ui-group",
"name": "Boden_Temp_ELV",
"page": "c6f339624d3ba639",
"width": 6,
"height": 1,
"order": 3,
"showTitle": true,
"className": "",
"visible": "true",
"disabled": "false",
"groupType": "default"
},
{
"id": "95a73cfa6c5013af",
"type": "ui-group",
"name": "Boden_Feucht_Z",
"page": "c6f339624d3ba639",
"width": 6,
"height": 1,
"order": 5,
"showTitle": true,
"className": "",
"visible": "true",
"disabled": "false",
"groupType": "default"
},
{
"id": "09959787270d8e78",
"type": "ui-group",
"name": "Boden_Temp_Z",
"page": "c6f339624d3ba639",
"width": 6,
"height": 1,
"order": 6,
"showTitle": true,
"className": "",
"visible": "true",
"disabled": "false",
"groupType": "default"
},
{
"id": "852d8e455b1c7d1e",
"type": "ui-group",
"name": "Boden_Werte_Z",
"page": "c6f339624d3ba639",
"width": "12",
"height": 1,
"order": 7,
"showTitle": false,
"className": "",
"visible": "true",
"disabled": "false",
"groupType": "default"
},
{ {
"id": "4d2812cbd43e95b7", "id": "4d2812cbd43e95b7",
"type": "mqtt in", "type": "mqtt in",
@@ -9361,6 +9403,7 @@
"name": "detect_motion", "name": "detect_motion",
"func": "if (msg.payload.occupancy === true) {\n msg.payload = { \"state\": \"on\" }\n}\nreturn msg", "func": "if (msg.payload.occupancy === true) {\n msg.payload = { \"state\": \"on\" }\n}\nreturn msg",
"outputs": 1, "outputs": 1,
"timeout": "",
"noerr": 0, "noerr": 0,
"initialize": "", "initialize": "",
"finalize": "", "finalize": "",
@@ -9411,8 +9454,9 @@
"type": "function", "type": "function",
"z": "c23febdb48bc9327", "z": "c23febdb48bc9327",
"name": "check brightness", "name": "check brightness",
"func": "\nconst helltop = flow.get('helltop')\nconst hellbot = flow.get('hellbot')\n\nlet hell = msg.payload.illuminance_lux\nflow.set('hell',hell)\nmsg.topic = 'control'\nif (hell >= helltop) {\n msg.payload = 'close'\n} else if (hell <= hellbot) {\n msg.payload = 'open'\n} else {\n msg.payload = ''\n}\nmsg.debug = hell\nreturn msg;", "func": "\nconst helltop = flow.get('helltop')\nconst hellbot = flow.get('hellbot')\n\nlet hell = msg.payload.illuminance\nflow.set('hell',hell)\nmsg.topic = 'control'\nif (hell >= helltop) {\n msg.payload = 'close'\n} else if (hell <= hellbot) {\n msg.payload = 'open'\n} else {\n msg.payload = ''\n}\nmsg.debug = hell\nreturn msg;",
"outputs": 1, "outputs": 1,
"timeout": "",
"noerr": 0, "noerr": 0,
"initialize": "", "initialize": "",
"finalize": "", "finalize": "",
@@ -9431,7 +9475,7 @@
"type": "debug", "type": "debug",
"z": "c23febdb48bc9327", "z": "c23febdb48bc9327",
"name": "debug 132", "name": "debug 132",
"active": true, "active": false,
"tosidebar": true, "tosidebar": true,
"console": false, "console": false,
"tostatus": false, "tostatus": false,
@@ -9528,54 +9572,10 @@
"y": 300, "y": 300,
"wires": [ "wires": [
[ [
"14c06742e472c598" "a402db460858613f"
] ]
] ]
}, },
{
"id": "14c06742e472c598",
"type": "ui_chart",
"z": "c23febdb48bc9327",
"name": "Helligkeit",
"group": "51bf0475.ddfd2c",
"order": 14,
"width": 0,
"height": 0,
"label": "Helligkeit [lux]",
"chartType": "line",
"legend": "false",
"xformat": "HH:mm",
"interpolate": "cubic",
"nodata": "",
"dot": false,
"ymin": "",
"ymax": "",
"removeOlder": "1",
"removeOlderPoints": "",
"removeOlderUnit": "3600",
"cutout": 0,
"useOneColor": false,
"useUTC": false,
"colors": [
"#1f77b4",
"#aec7e8",
"#ff7f0e",
"#2ca02c",
"#98df8a",
"#d62728",
"#ff9896",
"#9467bd",
"#c5b0d5"
],
"outputs": 1,
"useDifferentColor": false,
"className": "",
"x": 740,
"y": 300,
"wires": [
[]
]
},
{ {
"id": "a9f57cca28d627b2", "id": "a9f57cca28d627b2",
"type": "trigger", "type": "trigger",
@@ -9670,7 +9670,7 @@
"type": "debug", "type": "debug",
"z": "c23febdb48bc9327", "z": "c23febdb48bc9327",
"name": "debug 135", "name": "debug 135",
"active": true, "active": false,
"tosidebar": true, "tosidebar": true,
"console": false, "console": false,
"tostatus": false, "tostatus": false,
@@ -9687,7 +9687,7 @@
"type": "debug", "type": "debug",
"z": "c23febdb48bc9327", "z": "c23febdb48bc9327",
"name": "debug 136", "name": "debug 136",
"active": true, "active": false,
"tosidebar": true, "tosidebar": true,
"console": false, "console": false,
"tostatus": false, "tostatus": false,
@@ -9790,7 +9790,7 @@
"type": "debug", "type": "debug",
"z": "c23febdb48bc9327", "z": "c23febdb48bc9327",
"name": "debug 138", "name": "debug 138",
"active": true, "active": false,
"tosidebar": true, "tosidebar": true,
"console": false, "console": false,
"tostatus": false, "tostatus": false,
@@ -9904,7 +9904,7 @@
"group": "4939a011a90edf7b", "group": "4939a011a90edf7b",
"name": "Licht aus", "name": "Licht aus",
"label": "Lich AUS", "label": "Lich AUS",
"order": 1, "order": 2,
"width": 0, "width": 0,
"height": 0, "height": 0,
"emulateClick": false, "emulateClick": false,
@@ -9943,7 +9943,7 @@
"group": "4939a011a90edf7b", "group": "4939a011a90edf7b",
"name": "Licht ein", "name": "Licht ein",
"label": "Lich EIN", "label": "Lich EIN",
"order": 2, "order": 3,
"width": 0, "width": 0,
"height": 0, "height": 0,
"emulateClick": false, "emulateClick": false,
@@ -9975,6 +9975,68 @@
] ]
] ]
}, },
{
"id": "a402db460858613f",
"type": "ui-chart",
"z": "c23febdb48bc9327",
"group": "4939a011a90edf7b",
"name": "Helligkeit",
"label": "chart",
"order": 1,
"chartType": "line",
"category": "topic",
"categoryType": "msg",
"xAxisLabel": "",
"xAxisProperty": "",
"xAxisPropertyType": "timestamp",
"xAxisType": "time",
"xAxisFormat": "",
"xAxisFormatType": "auto",
"xmin": "",
"xmax": "",
"yAxisLabel": "lux",
"yAxisProperty": "payload",
"yAxisPropertyType": "msg",
"ymin": "",
"ymax": "",
"bins": 10,
"action": "append",
"stackSeries": false,
"pointShape": "circle",
"pointRadius": 4,
"showLegend": true,
"removeOlder": "12",
"removeOlderUnit": "3600",
"removeOlderPoints": "",
"colors": [
"#0095ff",
"#ff0000",
"#ff7f0e",
"#2ca02c",
"#a347e1",
"#d62728",
"#ff9896",
"#9467bd",
"#c5b0d5"
],
"textColor": [
"#666666"
],
"textColorDefault": true,
"gridColor": [
"#e5e5e5"
],
"gridColorDefault": true,
"width": 6,
"height": 8,
"className": "",
"interpolation": "linear",
"x": 720,
"y": 300,
"wires": [
[]
]
},
{ {
"id": "60dea7cbf33ac553", "id": "60dea7cbf33ac553",
"type": "mqtt in", "type": "mqtt in",
@@ -15367,9 +15429,9 @@
"id": "57c3b66a5f1320b3", "id": "57c3b66a5f1320b3",
"type": "comment", "type": "comment",
"z": "a78d7fab32058fcd", "z": "a78d7fab32058fcd",
"name": "Bodenfeuchte messen und anzeigen", "name": "Bodenfeuchte_elv messen und anzeigen",
"info": "", "info": "",
"x": 340, "x": 360,
"y": 180, "y": 180,
"wires": [] "wires": []
}, },
@@ -15514,11 +15576,11 @@
"order": 2, "order": 2,
"width": "6", "width": "6",
"height": "1", "height": "1",
"name": "", "name": "Batterie",
"label": "Batterie [V]", "label": "",
"format": "{{msg.payload}}", "format": "{{msg.payload}}",
"layout": "row-center", "layout": "row-center",
"style": false, "style": true,
"font": "", "font": "",
"fontSize": 16, "fontSize": 16,
"color": "#717171", "color": "#717171",
@@ -15526,7 +15588,7 @@
"className": "", "className": "",
"value": "payload", "value": "payload",
"valueType": "msg", "valueType": "msg",
"x": 1290, "x": 1280,
"y": 500, "y": 500,
"wires": [] "wires": []
}, },
@@ -15664,7 +15726,7 @@
"y": 440, "y": 440,
"wires": [ "wires": [
[ [
"a75a0af638bad79d" "a7645b487ad18cb2"
] ]
] ]
}, },
@@ -15836,5 +15898,435 @@
"x": 1180, "x": 1180,
"y": 700, "y": 700,
"wires": [] "wires": []
},
{
"id": "7ba750808e28bf09",
"type": "comment",
"z": "a78d7fab32058fcd",
"name": "Bodenfeuchte_zigbee messen und anzeigen",
"info": "",
"x": 390,
"y": 860,
"wires": []
},
{
"id": "370cffd1bc1e014c",
"type": "mqtt in",
"z": "a78d7fab32058fcd",
"name": "Bodenfeuchte_zigbee",
"topic": "zigbee2mqtt/Bodenfeuchte_Zigbee",
"qos": "0",
"datatype": "auto-detect",
"broker": "c46833d59903b816",
"nl": false,
"rap": true,
"rh": 0,
"inputs": 0,
"x": 340,
"y": 960,
"wires": [
[
"831e515311203731",
"dd4881cf4084270c",
"da5febbde802ed74",
"cc466cf1f5464343"
]
]
},
{
"id": "831e515311203731",
"type": "debug",
"z": "a78d7fab32058fcd",
"name": "debug 10",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 460,
"y": 900,
"wires": []
},
{
"id": "dd4881cf4084270c",
"type": "change",
"z": "a78d7fab32058fcd",
"name": "Feuchte",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "payload.soil_moisture",
"tot": "msg"
},
{
"t": "set",
"p": "topic",
"pt": "msg",
"to": "Feuchte",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 640,
"y": 940,
"wires": [
[
"5ff75c361419dec5",
"c6a53ad477b705f6"
]
]
},
{
"id": "da5febbde802ed74",
"type": "change",
"z": "a78d7fab32058fcd",
"name": "Temperatur",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "payload.temperature",
"tot": "msg"
},
{
"t": "set",
"p": "topic",
"pt": "msg",
"to": "Temperatur",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 650,
"y": 1000,
"wires": [
[
"8e56ead367e152a3",
"32645fba88793151"
]
]
},
{
"id": "8e56ead367e152a3",
"type": "ui-gauge",
"z": "a78d7fab32058fcd",
"name": "TempZ_Uhr",
"group": "09959787270d8e78",
"order": 1,
"value": "payload",
"valueType": "msg",
"width": "3",
"height": "3",
"gtype": "gauge-half",
"gstyle": "needle",
"title": "Temperatur",
"alwaysShowTitle": false,
"floatingTitlePosition": "top-left",
"units": "°C",
"icon": "",
"prefix": "",
"suffix": "",
"segments": [
{
"from": "0",
"color": "#ffc800",
"text": "",
"textType": "label"
},
{
"from": "10",
"color": "#5cd65c",
"text": "",
"textType": "label"
},
{
"from": "20",
"color": "#ea5353",
"text": "",
"textType": "label"
}
],
"min": 0,
"max": "30",
"sizeThickness": 16,
"sizeGap": 4,
"sizeKeyThickness": 8,
"styleRounded": true,
"styleGlow": false,
"className": "",
"x": 970,
"y": 1020,
"wires": [
[]
]
},
{
"id": "32645fba88793151",
"type": "ui-chart",
"z": "a78d7fab32058fcd",
"group": "09959787270d8e78",
"name": "TempZ_chart",
"label": "Temperatur [°C]",
"order": 2,
"chartType": "line",
"category": "topic",
"categoryType": "msg",
"xAxisLabel": "",
"xAxisProperty": "",
"xAxisPropertyType": "timestamp",
"xAxisType": "time",
"xAxisFormat": "",
"xAxisFormatType": "auto",
"xmin": "",
"xmax": "",
"yAxisLabel": "",
"yAxisProperty": "payload",
"yAxisPropertyType": "msg",
"ymin": "",
"ymax": "",
"bins": 10,
"action": "append",
"stackSeries": false,
"pointShape": "circle",
"pointRadius": 4,
"showLegend": true,
"removeOlder": "12",
"removeOlderUnit": "3600",
"removeOlderPoints": "",
"colors": [
"#0095ff",
"#ff0000",
"#ff7f0e",
"#2ca02c",
"#a347e1",
"#d62728",
"#ff9896",
"#9467bd",
"#c5b0d5"
],
"textColor": [
"#666666"
],
"textColorDefault": true,
"gridColor": [
"#e5e5e5"
],
"gridColorDefault": true,
"width": "6",
"height": "8",
"className": "",
"interpolation": "linear",
"x": 970,
"y": 1080,
"wires": [
[]
]
},
{
"id": "5ff75c361419dec5",
"type": "ui-gauge",
"z": "a78d7fab32058fcd",
"name": "FeuchteZ_Uhr",
"group": "95a73cfa6c5013af",
"order": 1,
"value": "payload",
"valueType": "msg",
"width": "3",
"height": "3",
"gtype": "gauge-half",
"gstyle": "needle",
"title": "Feuchte",
"alwaysShowTitle": false,
"floatingTitlePosition": "top-left",
"units": "%",
"icon": "",
"prefix": "",
"suffix": "",
"segments": [
{
"from": "0",
"color": "#ffc800",
"text": "",
"textType": "label"
},
{
"from": "30",
"color": "#5cd65c",
"text": "",
"textType": "label"
},
{
"from": "50",
"color": "#ea5353",
"text": "",
"textType": "label"
}
],
"min": 0,
"max": "100",
"sizeThickness": 16,
"sizeGap": 4,
"sizeKeyThickness": 8,
"styleRounded": true,
"styleGlow": false,
"className": "",
"x": 980,
"y": 880,
"wires": [
[]
]
},
{
"id": "c6a53ad477b705f6",
"type": "ui-chart",
"z": "a78d7fab32058fcd",
"group": "95a73cfa6c5013af",
"name": "FeuchteZ_Chart",
"label": "Feuchte [%]",
"order": 2,
"chartType": "line",
"category": "topic",
"categoryType": "msg",
"xAxisLabel": "",
"xAxisProperty": "",
"xAxisPropertyType": "timestamp",
"xAxisType": "time",
"xAxisFormat": "",
"xAxisFormatType": "auto",
"xmin": "",
"xmax": "",
"yAxisLabel": "",
"yAxisProperty": "payload",
"yAxisPropertyType": "msg",
"ymin": "0",
"ymax": "100",
"bins": 10,
"action": "append",
"stackSeries": false,
"pointShape": "circle",
"pointRadius": 4,
"showLegend": true,
"removeOlder": "12",
"removeOlderUnit": "3600",
"removeOlderPoints": "",
"colors": [
"#0095ff",
"#ff0000",
"#ff7f0e",
"#2ca02c",
"#a347e1",
"#d62728",
"#ff9896",
"#9467bd",
"#c5b0d5"
],
"textColor": [
"#666666"
],
"textColorDefault": true,
"gridColor": [
"#e5e5e5"
],
"gridColorDefault": true,
"width": "6",
"height": "8",
"className": "",
"interpolation": "linear",
"x": 980,
"y": 940,
"wires": [
[]
]
},
{
"id": "cc466cf1f5464343",
"type": "change",
"z": "a78d7fab32058fcd",
"name": "extract TBatterie",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "payload.battery",
"tot": "msg"
},
{
"t": "set",
"p": "topic",
"pt": "msg",
"to": "Batterie",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 670,
"y": 1080,
"wires": [
[
"261c666ccf5c91d7"
]
]
},
{
"id": "261c666ccf5c91d7",
"type": "ui-text",
"z": "a78d7fab32058fcd",
"group": "852d8e455b1c7d1e",
"order": 1,
"width": "6",
"height": "1",
"name": "",
"label": "Batterie_Z ",
"format": "{{msg.payload}}",
"layout": "row-center",
"style": false,
"font": "",
"fontSize": 16,
"color": "#717171",
"wrapText": false,
"className": "",
"value": "payload",
"valueType": "msg",
"x": 970,
"y": 1140,
"wires": []
},
{
"id": "a7645b487ad18cb2",
"type": "function",
"z": "a78d7fab32058fcd",
"name": "function 9",
"func": "msg.payload = \"Batterie \" + msg.payload + \" V\";\nreturn msg;\n",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 1040,
"y": 500,
"wires": [
[
"a75a0af638bad79d"
]
]
} }
] ]