Hello
i have 5 Curatin Switches. There work fine with the smart life app.
i want to controll the curtain with a the Nodered Dashboard-Button.
But i dont know how i can do it?
have anyone a flow for me that i can import it to my nodered?
I have done an experiment before, and cotrol 2 curtain switches via zigbee2mqtt.
And the NR code here:
[
{
"id": "995375fae4eaf28c",
"type": "tab",
"label": "娴佺▼ 1",
"disabled": false,
"info": "",
"env": []
},
{
"id": "8c7e38f42b91085a",
"type": "mqtt in",
"z": "995375fae4eaf28c",
"name": "鏃犵嚎寮€鍏?,
"topic": "zigbee2mqtt/0x00158d00087f6b67",
"qos": "2",
"datatype": "auto-detect",
"broker": "b036e740b5a6f7fb",
"nl": false,
"rap": true,
"rh": 0,
"inputs": 0,
"x": 120,
"y": 100,
"wires": [
[
"f42bbf1a9e58eee9",
"85beb4c1718f86a7"
]
]
},
{
"id": "080318948cefe690",
"type": "debug",
"z": "995375fae4eaf28c",
"name": "debug 1",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 460,
"y": 160,
"wires": []
},
{
"id": "f42bbf1a9e58eee9",
"type": "function",
"z": "995375fae4eaf28c",
"name": "鎺ユ敹鎸夐挳鎸囦护锛屾帶鍒剁獥甯?,
"func": "if (msg.payload.action == \"quadruple\"){\n msg.payload = \"{\\\"state\\\": \\\"CLOSE\\\"}\";//鎺у埗绐楀笜鍏砛n return msg;\n}\nif (msg.payload.action == \"triple\") {\n //鎺у埗绐楀笜寮€\n msg.payload = \"{\\\"state\\\": \\\"OPEN\\\"}\";\n return msg;\n}\n//return msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 170,
"y": 240,
"wires": [
[
"080318948cefe690",
"6b5864dc6432ec25",
"e86c28e92c1c65bc"
]
]
},
{
"id": "6b5864dc6432ec25",
"type": "mqtt out",
"z": "995375fae4eaf28c",
"name": "鎺у埗鍙崇獥甯?,
"topic": "zigbee2mqtt/0x54ef44100050c9a7/set",
"qos": "",
"retain": "",
"respTopic": "",
"contentType": "",
"userProps": "",
"correl": "",
"expiry": "",
"broker": "b036e740b5a6f7fb",
"x": 510,
"y": 280,
"wires": []
},
{
"id": "e86c28e92c1c65bc",
"type": "mqtt out",
"z": "995375fae4eaf28c",
"name": "鎺у埗宸︾獥甯?,
"topic": "zigbee2mqtt/0x54ef4410005b5dad/set",
"qos": "",
"retain": "",
"respTopic": "",
"contentType": "",
"userProps": "",
"correl": "",
"expiry": "",
"broker": "b036e740b5a6f7fb",
"x": 530,
"y": 380,
"wires": []
},
{
"id": "9435f59efbe12c77",
"type": "mqtt in",
"z": "995375fae4eaf28c",
"name": "绾㈠浼犳劅鍣?,
"topic": "zigbee2mqtt/0x00158d0006c03205",
"qos": "2",
"datatype": "auto-detect",
"broker": "b036e740b5a6f7fb",
"nl": false,
"rap": true,
"rh": 0,
"inputs": 0,
"x": 100,
"y": 480,
"wires": [
[
"4aabc93276398041"
]
]
},
{
"id": "4aabc93276398041",
"type": "function",
"z": "995375fae4eaf28c",
"name": "绾㈠妫€娴嬫湁浜?,
"func": "if (Boolean(msg.payload.occupancy)){\n //msg.payload = \"{\\\"LED\\\": \\\"Blink\\\"}\";\n return msg;\n}\n//return msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 320,
"y": 540,
"wires": [
[
"4da51fc46f6486c1"
]
]
},
{
"id": "4da51fc46f6486c1",
"type": "debug",
"z": "995375fae4eaf28c",
"name": "debug 2",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 480,
"y": 560,
"wires": []
},
{
"id": "85beb4c1718f86a7",
"type": "debug",
"z": "995375fae4eaf28c",
"name": "debug 3",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 300,
"y": 60,
"wires": []
},
{
"id": "2222e361bf23a331",
"type": "simpletime",
"z": "995375fae4eaf28c",
"name": "",
"mydate": true,
"myymd": true,
"myyear": true,
"mymonth": true,
"mymonthn": true,
"mydom": true,
"mydoy": true,
"myday": true,
"myhourpm": true,
"myhour": true,
"mytime": true,
"mytimes": true,
"myminute": true,
"myminutes": true,
"mysecond": true,
"mymillis": true,
"myepoch": true,
"myrawdate": true,
"mypm": true,
"x": 150,
"y": 400,
"wires": [
[
"83d907c81b3db07e"
]
]
},
{
"id": "83d907c81b3db07e",
"type": "function",
"z": "995375fae4eaf28c",
"name": "妫€娴嬫椂闂?,
"func": "var payload = msg;\n \nif (payload.myhour == 8){\n //鎺у埗绐楀笜寮€\n msg.payload = \"{\\\"state\\\": \\\"OPEN\\\"}\";\n return msg;\n}\nelse if (payload.myhour == 21){\n msg.payload = \"{\\\"state\\\": \\\"CLOSE\\\"}\";//鎺у埗绐楀笜鍏砛n return msg;\n}",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 320,
"y": 400,
"wires": [
[
"6b5864dc6432ec25",
"e86c28e92c1c65bc"
]
]
},
{
"id": "f4ae16d5c5030bf5",
"type": "inject",
"z": "995375fae4eaf28c",
"name": "",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "1800",
"crontab": "",
"once": true,
"onceDelay": 0.1,
"topic": "",
"payload": "",
"payloadType": "date",
"x": 140,
"y": 320,
"wires": [
[
"2222e361bf23a331"
]
]
},
{
"id": "b036e740b5a6f7fb",
"type": "mqtt-broker",
"name": "",
"broker": "192.168.0.115",
"port": "1883",
"clientid": "",
"autoConnect": true,
"usetls": false,
"protocolVersion": "4",
"keepalive": "60",
"cleansession": true,
"birthTopic": "",
"birthQos": "0",
"birthPayload": "",
"birthMsg": {},
"closeTopic": "",
"closeQos": "0",
"closePayload": "",
"closeMsg": {},
"willTopic": "",
"willQos": "0",
"willPayload": "",
"willMsg": {},
"userProps": "",
"sessionExpiry": ""
}
]
This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.