Bitteschön
[
{
"id": "a20fc7a8.f651b",
"type": "tab",
"label": "Tuya Smart TH SZ (170)",
"disabled": false,
"info": "Tuya Wireless Temperature & Humidity Detector via hih"
},
{
"id": "44f9c51b.5d0a94",
"type": "ioBroker in",
"z": "a20fc7a8.f651b",
"name": "TS0201 | SZ Temperature",
"topic": "zigbee.0.bc33acfffe28b1fa.temperature",
"payloadType": "value",
"onlyack": false,
"func": "rbe",
"gap": "",
"fireOnStart": "true",
"x": 230,
"y": 160,
"wires": [
[
"167b34d0.a469b3"
]
]
},
{
"id": "2af78e6b.08bd72",
"type": "ioBroker in",
"z": "a20fc7a8.f651b",
"name": "TS0201 | SZ Humidity",
"topic": "zigbee.0.bc33acfffe28b1fa.humidity",
"payloadType": "value",
"onlyack": "",
"func": "all",
"gap": "",
"fireOnStart": "true",
"x": 220,
"y": 220,
"wires": [
[
"1161535b.8ffb6d"
]
]
},
{
"id": "75071b1c.feb8f4",
"type": "ioBroker in",
"z": "a20fc7a8.f651b",
"name": "TS0201 | SZ Link quality",
"topic": "zigbee.0.bc33acfffe28b1fa.link_quality",
"payloadType": "value",
"onlyack": "",
"func": "all",
"gap": "",
"fireOnStart": "true",
"x": 230,
"y": 280,
"wires": [
[
"1e549834.fd46e8"
]
]
},
{
"id": "1e549834.fd46e8",
"type": "function",
"z": "a20fc7a8.f651b",
"name": "Set Link Quality",
"func": "var level=parseInt(msg.payload);\n\n// Verbindungsqualität von dbm in 0-4 umrechnen\nif (level > 90) {\n level = 4\n}\nelse if (level > 80) {\n level = 3\n}\nelse if (level > 60) {\n level = 2\n}\nelse if (level > 40) {\n level = 1\n}\nelse {\n level = 0\n}\nmsg.payload = {\"attribute\":{ \"id\":173, \"value\": level}};\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"x": 440,
"y": 280,
"wires": [
[
"74f29841.fafcc8"
]
]
},
{
"id": "167b34d0.a469b3",
"type": "template",
"z": "a20fc7a8.f651b",
"name": "",
"field": "payload",
"fieldType": "msg",
"format": "handlebars",
"syntax": "mustache",
"template": "{\"attribute\":{\"id\":171,\"value\":{{payload}}}}",
"output": "json",
"x": 440,
"y": 160,
"wires": [
[
"74f29841.fafcc8"
]
]
},
{
"id": "1161535b.8ffb6d",
"type": "template",
"z": "a20fc7a8.f651b",
"name": "",
"field": "payload",
"fieldType": "msg",
"format": "handlebars",
"syntax": "mustache",
"template": "{\"attribute\":{\"id\":172,\"value\":{{payload}}}}",
"output": "json",
"x": 440,
"y": 220,
"wires": [
[
"74f29841.fafcc8"
]
]
},
{
"id": "74f29841.fafcc8",
"type": "homeeDevice",
"z": "a20fc7a8.f651b",
"virtual-homee": "",
"name": "SZ | Tuya Smart TH Sensor",
"nodeId": "170",
"showNodeId": true,
"profile": "3001",
"icon": "default",
"attributes": [
{
"instance": 0,
"minimum": -10,
"maximum": 55,
"current_value": 0,
"target_value": 0,
"last_value": 1,
"unit": "%C2%B0C",
"step_value": 1,
"editable": 0,
"state": 1,
"last_changed": 1570085457,
"changed_by": 1,
"changed_by_id": 0,
"based_on": 1,
"data": "",
"type": 5,
"id": 171,
"node_id": 170
},
{
"instance": 0,
"minimum": 0,
"maximum": 100,
"current_value": 0,
"target_value": 0,
"last_value": 1,
"unit": "%25",
"step_value": 0.1,
"editable": 0,
"state": 1,
"last_changed": 1570085457,
"changed_by": 1,
"changed_by_id": 0,
"based_on": 1,
"data": "",
"type": 7,
"id": 172,
"node_id": 170
},
{
"instance": 0,
"minimum": 0,
"maximum": 4,
"current_value": 3,
"target_value": 3,
"last_value": 3,
"unit": "n%2Fa",
"step_value": 1,
"editable": 0,
"state": 1,
"last_changed": 1572634009,
"changed_by": 1,
"changed_by_id": 0,
"based_on": 4,
"data": "RSSI",
"type": 33,
"id": 173,
"node_id": 170
},
{
"instance": 0,
"minimum": 0,
"maximum": 100,
"current_value": 30,
"target_value": 1,
"last_value": 1,
"unit": "%25",
"step_value": 1,
"editable": 0,
"state": 1,
"last_changed": 1572634009,
"changed_by": 1,
"changed_by_id": 0,
"based_on": 4,
"data": "",
"type": 8,
"id": 174,
"node_id": 170
},
{
"instance": 0,
"minimum": 0,
"maximum": 4,
"current_value": 1,
"target_value": 1,
"last_value": 1,
"unit": "V",
"step_value": 0.1,
"editable": 0,
"state": 1,
"last_changed": 1572634009,
"changed_by": 1,
"changed_by_id": 0,
"based_on": 4,
"data": "",
"type": 195,
"id": 175,
"node_id": 170
}
],
"statusTemplate": "",
"x": 760,
"y": 220,
"wires": [
[]
]
},
{
"id": "93392cf6.79def",
"type": "ioBroker in",
"z": "a20fc7a8.f651b",
"name": "TS0201 | SZ Battery percent",
"topic": "zigbee.0.bc33acfffe28b1fa.battery",
"payloadType": "value",
"onlyack": "",
"func": "all",
"gap": "",
"fireOnStart": "true",
"x": 240,
"y": 340,
"wires": [
[
"c016205f.8dce38"
]
]
},
{
"id": "c016205f.8dce38",
"type": "template",
"z": "a20fc7a8.f651b",
"name": "",
"field": "payload",
"fieldType": "msg",
"format": "handlebars",
"syntax": "mustache",
"template": "{\"attribute\":{\"id\":174,\"value\":{{payload}}}}",
"output": "json",
"x": 440,
"y": 340,
"wires": [
[
"74f29841.fafcc8"
]
]
},
{
"id": "baede268.4bfff8",
"type": "ioBroker in",
"z": "a20fc7a8.f651b",
"name": "TS0201 | SZ Battery voltage",
"topic": "zigbee.0.bc33acfffe28b1fa.voltage",
"payloadType": "value",
"onlyack": "",
"func": "all",
"gap": "",
"fireOnStart": "true",
"x": 240,
"y": 400,
"wires": [
[
"2a4675e6.c0538a"
]
]
},
{
"id": "2a4675e6.c0538a",
"type": "template",
"z": "a20fc7a8.f651b",
"name": "",
"field": "payload",
"fieldType": "msg",
"format": "handlebars",
"syntax": "mustache",
"template": "{\"attribute\":{\"id\":175,\"value\":{{payload}}}}",
"output": "json",
"x": 440,
"y": 400,
"wires": [
[
"74f29841.fafcc8"
]
]
},
{
"id": "47f519c.63143e8",
"type": "ioBroker in",
"z": "a20fc7a8.f651b",
"name": "TS0201 | SZ available",
"topic": "zigbee.0.bc33acfffe28b1fa.available",
"payloadType": "value",
"onlyack": "",
"func": "all",
"gap": "",
"fireOnStart": "true",
"x": 220,
"y": 460,
"wires": [
[
"6b4c80e0.299888"
]
]
},
{
"id": "6b4c80e0.299888",
"type": "change",
"z": "a20fc7a8.f651b",
"name": "",
"rules": [
{
"t": "change",
"p": "payload",
"pt": "msg",
"from": "true",
"fromt": "str",
"to": "{\"state\":1}",
"tot": "json"
},
{
"t": "change",
"p": "payload",
"pt": "msg",
"from": "false",
"fromt": "str",
"to": "{\"state\":2}",
"tot": "json"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 420,
"y": 460,
"wires": [
[
"74f29841.fafcc8"
]
]
}
]