hier der Code für zwei Bodenfeuchtesensoren.
Einfach zum obigen Flow hinzufügen und entsprechend verbinden.
[
{
"id": "2277809b.f1816",
"type": "change",
"z": "915168da.b2a3e8",
"name": "DP100 Battery Status (0=OK)",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "payload.soilbatt1 ? \"OK\" : \"Bad\"",
"tot": "jsonata"
},
{
"t": "set",
"p": "topic",
"pt": "msg",
"to": "weatherstation.dp100_1.battery_status",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 1070,
"y": 320,
"wires": [
[
"6fd0c659.254e98",
"46615f8d.ae734"
]
]
},
{
"id": "22115be8.b76f54",
"type": "change",
"z": "915168da.b2a3e8",
"name": "DP100 Moisture %",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "$number(msg.payload.soilmoisture1)",
"tot": "jsonata"
},
{
"t": "set",
"p": "topic",
"pt": "msg",
"to": "weatherstation.dp100_1.humidity",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 1060,
"y": 260,
"wires": [
[
"7c1ad2b8.4de154",
"e0a4ec70.121948"
]
]
},
{
"id": "e0a4ec70.121948",
"type": "template",
"z": "915168da.b2a3e8",
"name": "",
"field": "payload",
"fieldType": "msg",
"format": "handlebars",
"syntax": "mustache",
"template": "{\"attribute\":{\"id\":561,\"value\":{{payload}}}}",
"output": "json",
"x": 1560,
"y": 260,
"wires": [
[
"6604045e.2d75f4"
]
]
},
{
"id": "6604045e.2d75f4",
"type": "homeeDevice",
"z": "915168da.b2a3e8",
"virtual-homee": "",
"name": "Bodenfeuchtigkeit_Garten_1",
"nodeId": "560",
"showNodeId": true,
"profile": "3001",
"icon": "default",
"attributes": [
{
"state": 1,
"instance": 0,
"minimum": 0,
"maximum": 100,
"current_value": 0,
"target_value": 0,
"last_value": 0,
"data": "",
"name": "Bodenfeuchtigkeit",
"unit": "%25",
"step_value": 1,
"editable": 0,
"last_changed": 1601812276,
"changed_by": 1,
"changed_by_id": 0,
"based_on": 1,
"options": [],
"type": 7,
"id": 561,
"node_id": 560
},
{
"type": 8,
"state": 1,
"instance": 0,
"minimum": 0,
"maximum": 100,
"current_value": 0,
"target_value": 0,
"last_value": 0,
"data": "",
"name": "",
"unit": "%25",
"step_value": 1,
"editable": 0,
"last_changed": 1610714713,
"changed_by": 1,
"changed_by_id": 0,
"based_on": 1,
"options": [],
"id": 562,
"node_id": 560
}
],
"statusTemplate": "",
"x": 1820,
"y": 260,
"wires": [
[]
]
},
{
"id": "46615f8d.ae734",
"type": "change",
"z": "915168da.b2a3e8",
"name": "",
"rules": [
{
"t": "change",
"p": "payload",
"pt": "msg",
"from": "OK",
"fromt": "str",
"to": "100",
"tot": "num"
},
{
"t": "change",
"p": "payload",
"pt": "msg",
"from": "BAD",
"fromt": "str",
"to": "10",
"tot": "num"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 1340,
"y": 320,
"wires": [
[
"7c8fa907.7b9a9"
]
]
},
{
"id": "7c8fa907.7b9a9",
"type": "template",
"z": "915168da.b2a3e8",
"name": "",
"field": "payload",
"fieldType": "msg",
"format": "handlebars",
"syntax": "mustache",
"template": "{\"attribute\":{\"id\":562,\"value\":{{payload}}}}",
"output": "json",
"x": 1560,
"y": 320,
"wires": [
[
"6604045e.2d75f4"
]
]
},
{
"id": "74f69be0.6d2dd4",
"type": "homeeDevice",
"z": "915168da.b2a3e8",
"virtual-homee": "",
"name": "Bodenfeuchtigkeit_Garten_2",
"nodeId": "565",
"showNodeId": true,
"profile": "3001",
"icon": "default",
"attributes": [
{
"state": 1,
"instance": 0,
"minimum": 0,
"maximum": 100,
"current_value": 0,
"target_value": 0,
"last_value": 0,
"data": "",
"name": "Bodenfeuchtigkeit",
"unit": "%25",
"step_value": 1,
"editable": 0,
"last_changed": 1601812276,
"changed_by": 1,
"changed_by_id": 0,
"based_on": 1,
"options": [],
"type": 7,
"id": 566,
"node_id": 565
},
{
"type": 8,
"state": 1,
"instance": 0,
"minimum": 0,
"maximum": 100,
"current_value": 0,
"target_value": 0,
"last_value": 0,
"data": "",
"name": "",
"unit": "%25",
"step_value": 1,
"editable": 0,
"last_changed": 1610714713,
"changed_by": 1,
"changed_by_id": 0,
"based_on": 1,
"options": [],
"id": 567,
"node_id": 565
}
],
"statusTemplate": "",
"x": 1820,
"y": 140,
"wires": [
[]
]
},
{
"id": "f6636d72.58f5b",
"type": "change",
"z": "915168da.b2a3e8",
"name": "DP100 Battery Status (0=OK)",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "payload.soilbatt2 ? \"OK\" : \"Bad\"",
"tot": "jsonata"
},
{
"t": "set",
"p": "topic",
"pt": "msg",
"to": "weatherstation.dp100_2.battery_status",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 1050,
"y": 200,
"wires": [
[
"54cb538f.dc6e04",
"6fd0c659.254e98"
]
]
},
{
"id": "6ee391f5.be4398",
"type": "change",
"z": "915168da.b2a3e8",
"name": "DP100 Moisture %",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "$number(msg.payload.soilmoisture2)",
"tot": "jsonata"
},
{
"t": "set",
"p": "topic",
"pt": "msg",
"to": "weatherstation.dp100_2.humidity",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 1070,
"y": 140,
"wires": [
[
"beece4c9.54f508",
"7c1ad2b8.4de154"
]
]
},
{
"id": "beece4c9.54f508",
"type": "template",
"z": "915168da.b2a3e8",
"name": "",
"field": "payload",
"fieldType": "msg",
"format": "handlebars",
"syntax": "mustache",
"template": "{\"attribute\":{\"id\":566,\"value\":{{payload}}}}",
"output": "json",
"x": 1570,
"y": 140,
"wires": [
[
"74f69be0.6d2dd4"
]
]
},
{
"id": "54cb538f.dc6e04",
"type": "change",
"z": "915168da.b2a3e8",
"name": "",
"rules": [
{
"t": "change",
"p": "payload",
"pt": "msg",
"from": "OK",
"fromt": "str",
"to": "100",
"tot": "num"
},
{
"t": "change",
"p": "payload",
"pt": "msg",
"from": "BAD",
"fromt": "str",
"to": "10",
"tot": "num"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 1350,
"y": 200,
"wires": [
[
"adbea67d.a563f8"
]
]
},
{
"id": "adbea67d.a563f8",
"type": "template",
"z": "915168da.b2a3e8",
"name": "",
"field": "payload",
"fieldType": "msg",
"format": "handlebars",
"syntax": "mustache",
"template": "{\"attribute\":{\"id\":567,\"value\":{{payload}}}}",
"output": "json",
"x": 1570,
"y": 200,
"wires": [
[
"74f69be0.6d2dd4"
]
]
}
]
@medicus07 vielleicht kannste das ja oben noch im Eingangspost hinterlegen
16.03.2021: Kleine Fehlerkorrektur, dass die Bezeichnung „Bodenfeuchtigkeit“ in homee korrekt ist.