I would create a JS object which contains all properties as booleans. Putting this object into a change of function node, you can check the properties with AND or OR.
or as I said you put your JS object into a switch or change node. Here are my nodes, I use in my local libary:
Zusammenfassung
[
{
"id": "225fdcf0.030744",
"type": "switch",
"z": "54b226bc.0793e8",
"name": "AND?",
"property": "$reduce(payload.*,function($i, $j){$i and $j})",
"propertyType": "jsonata",
"rules": [
{
"t": "true"
},
{
"t": "false"
}
],
"checkall": "true",
"repair": false,
"outputs": 2,
"x": 470,
"y": 3200,
"wires": [
[],
[]
],
"info": "# All properties of an object must be true.\n\nAll properties of an object must be true.\n\n`{\n \"Office\": true,\n \"Bedroom\": true,\n \"Living Room Balcony\": true,\n \"Living Room Right Window\": true,\n \"Living Room Left Window\": true\n}`\n\nis true,\n\n`{\n \"Office\": true,\n \"Bedroom\": false,\n \"Living Room Balcony\": true,\n \"Living Room Right Window\": true,\n \"Living Room Left Window\": true\n}`\n\nis false.\n\n# Alle Eigenschaften eines Objektes müssen wahr sein\n\nAlle Eigenschaften eines Objektes müssen wahr sein.\n\n`{\n \"Büro Balkon\": true,\n \"Schlafzimmer Balkon\": true,\n \"Wohnzimmer Balkon\": true,\n \"Wohnzimmer rechtes Fenster\": true,\n \"Wohnzimmer linkes Fenster\": true\n}`\n\nergibt true,\n\n`{\n \"Büro Balkon\": true,\n \"Schlafzimmer Balkon\": true,\n \"Wohnzimmer Balkon\": true,\n \"Wohnzimmer rechtes Fenster\": false,\n \"Wohnzimmer linkes Fenster\": true\n}`\n\nergibt false."
},
{
"id": "2a274afb.2f7d76",
"type": "change",
"z": "54b226bc.0793e8",
"name": "AND ?",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "$reduce(payload.*,function($i, $j){$i and $j})",
"tot": "jsonata"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 470,
"y": 3240,
"wires": [
[]
],
"info": "# All Property of an object must be true.\n\nAll properties of an object must be true.\n\n`{\n \"Office\": true,\n \"Bedroom\": true,\n \"Living Room Balcony\": true,\n \"Living Room Right Window\": true,\n \"Living Room Left Window\": true\n}`\n\nis true,\n\n`{\n \"Office\": true,\n \"Bedroom\": false,\n \"Living Room Balcony\": true,\n \"Living Room Right Window\": true,\n \"Living Room Left Window\": true\n}`\n\nis false.\n\n# Alle Eigenschaften eines Objektes müssen wahr sein\n\nAlle Eigenschaften eines Objektes müssen wahr sein.\n\n`{\n \"Büro Balkon\": true,\n \"Schlafzimmer Balkon\": true,\n \"Wohnzimmer Balkon\": true,\n \"Wohnzimmer rechtes Fenster\": true,\n \"Wohnzimmer linkes Fenster\": true\n}`\n\nergibt true,\n\n`{\n \"Büro Balkon\": true,\n \"Schlafzimmer Balkon\": true,\n \"Wohnzimmer Balkon\": true,\n \"Wohnzimmer rechtes Fenster\": false,\n \"Wohnzimmer linkes Fenster\": true\n}`\n\nergibt false."
},
{
"id": "3a1e5265.93622e",
"type": "switch",
"z": "54b226bc.0793e8",
"name": "OR?",
"property": "$reduce(payload.*,function($i, $j){$i or $j})",
"propertyType": "jsonata",
"rules": [
{
"t": "true"
},
{
"t": "false"
}
],
"checkall": "true",
"repair": false,
"outputs": 2,
"x": 630,
"y": 3200,
"wires": [
[],
[]
],
"info": "# Only one or more properties of an object need to be true.\n\n Only one or more properties of an object need to be true.\n\n`{\n \"Office\": false,\n \"Bedroom\": false,\n \"Living Room Balcony\": false,\n \"Liviueng Room Right Window\": false,\n \"Living Room Left Window\": false\n}`\n\nis false,\n\n`{\n \"Office\": false,\n \"Bedroom\": true,\n \"Living Room Balcony\": false,\n \"Living Room Right Window\": false,\n \"Living Room Left Window\": false\n}`\n\nis true.\n\n# Mindestens eine Eigenschaft des Objektes muss wahr sein.\n\nMindestens eine Eigenschaft des Objektes muss wahr sein.\n\n`{\n \"Büro Balkon\": false,\n \"Schlafzimmer Balkon\": false,\n \"Wohnzimmer Balkon\": false,\n \"Wohnzimmer rechtes Fenster\": false,\n \"Wohnzimmer linkes Fenster\": false\n}`\n\nergibt false,\n\n`{\n \"Büro Balkon\": false,\n \"Schlafzimmer Balkon\": true,\n \"Wohnzimmer Balkon\": false,\n \"Wohnzimmer rechtes Fenster\": false,\n \"Wohnzimmer linkes Fenster\": false\n}`\n\nergibt true (wahr)."
},
{
"id": "f3066bc6.8bf028",
"type": "change",
"z": "54b226bc.0793e8",
"name": "OR ?",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "$reduce(payload.*,function($i, $j){$i or $j})",
"tot": "jsonata"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 630,
"y": 3240,
"wires": [
[]
],
"info": "# Only one or more properties of an object need to be true.\n\n Only one or more properties of an object need to be true.\n\n`{\n \"Office\": false,\n \"Bedroom\": false,\n \"Living Room Balcony\": false,\n \"Liviueng Room Right Window\": false,\n \"Living Room Left Window\": false\n}`\n\nis false,\n\n`{\n \"Office\": false,\n \"Bedroom\": true,\n \"Living Room Balcony\": false,\n \"Living Room Right Window\": false,\n \"Living Room Left Window\": false\n}`\n\nis true.\n\n# Mindestens eine Eigenschaft des Objektes muss wahr sein.\n\nMindestens eine Eigenschaft des Objektes muss wahr sein.\n\n`{\n \"Büro Balkon\": false,\n \"Schlafzimmer Balkon\": false,\n \"Wohnzimmer Balkon\": false,\n \"Wohnzimmer rechtes Fenster\": false,\n \"Wohnzimmer linkes Fenster\": false\n}`\n\nergibt false,\n\n`{\n \"Büro Balkon\": false,\n \"Schlafzimmer Balkon\": true,\n \"Wohnzimmer Balkon\": false,\n \"Wohnzimmer rechtes Fenster\": false,\n \"Wohnzimmer linkes Fenster\": false\n}`\n\nergibt true (wahr)."
},
{
"id": "31176ff0.ed4e5",
"type": "change",
"z": "54b226bc.0793e8",
"name": "NOT",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "$not(payload)\t",
"tot": "jsonata"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 790,
"y": 3220,
"wires": [
[]
]
}
]