mirror of
https://github.com/bemble/node-red-contrib-mi-devices.git
synced 2026-03-11 21:55:42 +01:00
fix(devices): fix prepareForGatewayRequest call for default nodes
This commit is contained in:
@@ -1,13 +1,15 @@
|
||||
[
|
||||
{
|
||||
"id": "a27cc591.60157",
|
||||
"id": "d6af659e.672c78",
|
||||
"type": "tab",
|
||||
"label": "Flow 1"
|
||||
"label": "Mi Devices Overview",
|
||||
"disabled": false,
|
||||
"info": ""
|
||||
},
|
||||
{
|
||||
"id": "98fadf6b.93ace8",
|
||||
"id": "8b46a76a.3750f8",
|
||||
"type": "xiaomi-gateway in",
|
||||
"z": "a27cc591.60157",
|
||||
"z": "d6af659e.672c78",
|
||||
"name": "",
|
||||
"gateway": "",
|
||||
"ip": "",
|
||||
@@ -15,19 +17,19 @@
|
||||
"y": 260,
|
||||
"wires": [
|
||||
[
|
||||
"81afc500.7aaa3",
|
||||
"cb33991f.f28cf",
|
||||
"c99b4545.b1c2a",
|
||||
"64dca666.0bfbd",
|
||||
"89e83211.c691b",
|
||||
"76067c35.ffa28c"
|
||||
"c6c7895f.ca9ed",
|
||||
"fff96479.f72ff8",
|
||||
"896173ae.aff0c",
|
||||
"55f81bbe.cdf944",
|
||||
"e3bc2a33.7bc178",
|
||||
"6b4e0181.7aac38"
|
||||
]
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "81afc500.7aaa3",
|
||||
"id": "c6c7895f.ca9ed",
|
||||
"type": "xiaomi-ht",
|
||||
"z": "a27cc591.60157",
|
||||
"z": "d6af659e.672c78",
|
||||
"gateway": "",
|
||||
"name": "",
|
||||
"sid": "",
|
||||
@@ -35,14 +37,14 @@
|
||||
"y": 120,
|
||||
"wires": [
|
||||
[
|
||||
"b9a37252.56508"
|
||||
"a196a200.9d0ca8"
|
||||
]
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "cb33991f.f28cf",
|
||||
"id": "fff96479.f72ff8",
|
||||
"type": "xiaomi-magnet",
|
||||
"z": "a27cc591.60157",
|
||||
"z": "d6af659e.672c78",
|
||||
"gateway": "",
|
||||
"name": "",
|
||||
"sid": "",
|
||||
@@ -50,14 +52,14 @@
|
||||
"y": 180,
|
||||
"wires": [
|
||||
[
|
||||
"b9a37252.56508"
|
||||
"a196a200.9d0ca8"
|
||||
]
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "c99b4545.b1c2a",
|
||||
"id": "896173ae.aff0c",
|
||||
"type": "xiaomi-motion",
|
||||
"z": "a27cc591.60157",
|
||||
"z": "d6af659e.672c78",
|
||||
"gateway": "",
|
||||
"name": "",
|
||||
"sid": "",
|
||||
@@ -68,14 +70,14 @@
|
||||
"y": 240,
|
||||
"wires": [
|
||||
[
|
||||
"b9a37252.56508"
|
||||
"a196a200.9d0ca8"
|
||||
]
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "64dca666.0bfbd",
|
||||
"id": "55f81bbe.cdf944",
|
||||
"type": "xiaomi-switch",
|
||||
"z": "a27cc591.60157",
|
||||
"z": "d6af659e.672c78",
|
||||
"gateway": "",
|
||||
"name": "",
|
||||
"sid": "",
|
||||
@@ -86,28 +88,28 @@
|
||||
"y": 300,
|
||||
"wires": [
|
||||
[
|
||||
"b9a37252.56508"
|
||||
"a196a200.9d0ca8"
|
||||
]
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "89e83211.c691b",
|
||||
"id": "e3bc2a33.7bc178",
|
||||
"type": "xiaomi-gateway",
|
||||
"z": "a27cc591.60157",
|
||||
"z": "d6af659e.672c78",
|
||||
"gateway": "",
|
||||
"name": "",
|
||||
"x": 440,
|
||||
"y": 360,
|
||||
"wires": [
|
||||
[
|
||||
"b9a37252.56508"
|
||||
"a196a200.9d0ca8"
|
||||
]
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "76067c35.ffa28c",
|
||||
"id": "6b4e0181.7aac38",
|
||||
"type": "xiaomi-plug",
|
||||
"z": "a27cc591.60157",
|
||||
"z": "d6af659e.672c78",
|
||||
"gateway": "",
|
||||
"name": "",
|
||||
"sid": "",
|
||||
@@ -118,14 +120,14 @@
|
||||
"y": 420,
|
||||
"wires": [
|
||||
[
|
||||
"b9a37252.56508"
|
||||
"a196a200.9d0ca8"
|
||||
]
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "b9a37252.56508",
|
||||
"id": "a196a200.9d0ca8",
|
||||
"type": "debug",
|
||||
"z": "a27cc591.60157",
|
||||
"z": "d6af659e.672c78",
|
||||
"name": "",
|
||||
"active": true,
|
||||
"console": "false",
|
||||
@@ -135,9 +137,9 @@
|
||||
"wires": []
|
||||
},
|
||||
{
|
||||
"id": "67b347e2.6a534",
|
||||
"id": "fced461e.36cda",
|
||||
"type": "xiaomi-ht",
|
||||
"z": "a27cc591.60157",
|
||||
"z": "d6af659e.672c78",
|
||||
"gateway": "",
|
||||
"name": "",
|
||||
"sid": "",
|
||||
@@ -145,14 +147,14 @@
|
||||
"y": 580,
|
||||
"wires": [
|
||||
[
|
||||
"80913b13.6abde8"
|
||||
"f2d6b99.0cc43c8"
|
||||
]
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "4d7101c0.34b03",
|
||||
"id": "5f9390f2.5a3798",
|
||||
"type": "xiaomi-magnet",
|
||||
"z": "a27cc591.60157",
|
||||
"z": "d6af659e.672c78",
|
||||
"gateway": "",
|
||||
"name": "",
|
||||
"sid": "",
|
||||
@@ -160,14 +162,14 @@
|
||||
"y": 640,
|
||||
"wires": [
|
||||
[
|
||||
"80913b13.6abde8"
|
||||
"f2d6b99.0cc43c8"
|
||||
]
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "d693568c.d4361",
|
||||
"id": "727ea237.226064",
|
||||
"type": "xiaomi-motion",
|
||||
"z": "a27cc591.60157",
|
||||
"z": "d6af659e.672c78",
|
||||
"gateway": "",
|
||||
"name": "",
|
||||
"sid": "",
|
||||
@@ -178,14 +180,14 @@
|
||||
"y": 700,
|
||||
"wires": [
|
||||
[
|
||||
"80913b13.6abde8"
|
||||
"f2d6b99.0cc43c8"
|
||||
]
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "698abb61.5abd4c",
|
||||
"id": "9b7afab9.3b9d28",
|
||||
"type": "xiaomi-switch",
|
||||
"z": "a27cc591.60157",
|
||||
"z": "d6af659e.672c78",
|
||||
"gateway": "",
|
||||
"name": "",
|
||||
"sid": "",
|
||||
@@ -196,34 +198,34 @@
|
||||
"y": 760,
|
||||
"wires": [
|
||||
[
|
||||
"80913b13.6abde8",
|
||||
"478d086b.03d228",
|
||||
"15e41dc2.040d2a"
|
||||
"f2d6b99.0cc43c8",
|
||||
"87e3d24d.dca938",
|
||||
"17f55e85.67fa39"
|
||||
]
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "7d859dfb.4b9654",
|
||||
"id": "56b84611.e528d",
|
||||
"type": "xiaomi-gateway",
|
||||
"z": "a27cc591.60157",
|
||||
"z": "d6af659e.672c78",
|
||||
"gateway": "",
|
||||
"name": "",
|
||||
"x": 500,
|
||||
"y": 820,
|
||||
"wires": [
|
||||
[
|
||||
"80913b13.6abde8",
|
||||
"70587543.82d5e4",
|
||||
"575fa4d4.fc33a4",
|
||||
"ebe3b7c3.e992a",
|
||||
"1d0a8872.4d0768"
|
||||
"f2d6b99.0cc43c8",
|
||||
"63506419.25ea9c",
|
||||
"802789b5.325168",
|
||||
"f5d2d9a.c0cfaa8",
|
||||
"714e9c81.a6814c"
|
||||
]
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "a5e8199.79366e8",
|
||||
"id": "f56c4e2.98543b",
|
||||
"type": "inject",
|
||||
"z": "a27cc591.60157",
|
||||
"z": "d6af659e.672c78",
|
||||
"name": "",
|
||||
"topic": "",
|
||||
"payload": "",
|
||||
@@ -235,22 +237,22 @@
|
||||
"y": 700,
|
||||
"wires": [
|
||||
[
|
||||
"67b347e2.6a534",
|
||||
"4d7101c0.34b03",
|
||||
"d693568c.d4361",
|
||||
"698abb61.5abd4c",
|
||||
"7d859dfb.4b9654",
|
||||
"14721d5a.c43ffb",
|
||||
"c537654a.b43598",
|
||||
"2c89de3d.6e4982",
|
||||
"e4012d10.dc47b8"
|
||||
"fced461e.36cda",
|
||||
"5f9390f2.5a3798",
|
||||
"727ea237.226064",
|
||||
"9b7afab9.3b9d28",
|
||||
"56b84611.e528d",
|
||||
"cde54564.5db488",
|
||||
"2e035ef8.13ee12",
|
||||
"6e073d99.348974",
|
||||
"5d917375.467da4"
|
||||
]
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "14721d5a.c43ffb",
|
||||
"id": "cde54564.5db488",
|
||||
"type": "xiaomi-plug",
|
||||
"z": "a27cc591.60157",
|
||||
"z": "d6af659e.672c78",
|
||||
"gateway": "",
|
||||
"name": "",
|
||||
"sid": "",
|
||||
@@ -261,16 +263,16 @@
|
||||
"y": 880,
|
||||
"wires": [
|
||||
[
|
||||
"80913b13.6abde8",
|
||||
"66151627.9213d8",
|
||||
"373c3dc7.ca5912"
|
||||
"f2d6b99.0cc43c8",
|
||||
"6dde3295.cc1f94",
|
||||
"bc27b766.47eb"
|
||||
]
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "c537654a.b43598",
|
||||
"id": "2e035ef8.13ee12",
|
||||
"type": "xiaomi-plug-wifi",
|
||||
"z": "a27cc591.60157",
|
||||
"z": "d6af659e.672c78",
|
||||
"name": "",
|
||||
"ip": "",
|
||||
"onmsg": "",
|
||||
@@ -283,35 +285,35 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "80913b13.6abde8",
|
||||
"id": "f2d6b99.0cc43c8",
|
||||
"type": "xiaomi-actions read",
|
||||
"z": "a27cc591.60157",
|
||||
"z": "d6af659e.672c78",
|
||||
"name": "",
|
||||
"x": 810,
|
||||
"y": 580,
|
||||
"wires": [
|
||||
[
|
||||
"70314d8a.34e17c"
|
||||
"39eb644e.a67c94"
|
||||
]
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "70587543.82d5e4",
|
||||
"id": "63506419.25ea9c",
|
||||
"type": "xiaomi-actions get_id_list",
|
||||
"z": "a27cc591.60157",
|
||||
"z": "d6af659e.672c78",
|
||||
"name": "",
|
||||
"x": 820,
|
||||
"y": 800,
|
||||
"wires": [
|
||||
[
|
||||
"70314d8a.34e17c"
|
||||
"39eb644e.a67c94"
|
||||
]
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "575fa4d4.fc33a4",
|
||||
"id": "802789b5.325168",
|
||||
"type": "xiaomi-actions gateway_light",
|
||||
"z": "a27cc591.60157",
|
||||
"z": "d6af659e.672c78",
|
||||
"gateway": "",
|
||||
"name": "",
|
||||
"brightness": 100,
|
||||
@@ -325,14 +327,14 @@
|
||||
"y": 840,
|
||||
"wires": [
|
||||
[
|
||||
"70314d8a.34e17c"
|
||||
"39eb644e.a67c94"
|
||||
]
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "ebe3b7c3.e992a",
|
||||
"id": "f5d2d9a.c0cfaa8",
|
||||
"type": "xiaomi-actions gateway_sound",
|
||||
"z": "a27cc591.60157",
|
||||
"z": "d6af659e.672c78",
|
||||
"gateway": "",
|
||||
"name": "",
|
||||
"mid": "",
|
||||
@@ -341,82 +343,82 @@
|
||||
"y": 880,
|
||||
"wires": [
|
||||
[
|
||||
"70314d8a.34e17c"
|
||||
"39eb644e.a67c94"
|
||||
]
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "1d0a8872.4d0768",
|
||||
"id": "714e9c81.a6814c",
|
||||
"type": "xiaomi-actions gateway_stop_sound",
|
||||
"z": "a27cc591.60157",
|
||||
"z": "d6af659e.672c78",
|
||||
"gateway": "",
|
||||
"name": "",
|
||||
"x": 830,
|
||||
"y": 920,
|
||||
"wires": [
|
||||
[
|
||||
"70314d8a.34e17c"
|
||||
"39eb644e.a67c94"
|
||||
]
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "66151627.9213d8",
|
||||
"id": "6dde3295.cc1f94",
|
||||
"type": "xiaomi-actions on",
|
||||
"z": "a27cc591.60157",
|
||||
"z": "d6af659e.672c78",
|
||||
"gateway": "",
|
||||
"name": "",
|
||||
"x": 820,
|
||||
"y": 980,
|
||||
"wires": [
|
||||
[
|
||||
"70314d8a.34e17c"
|
||||
"39eb644e.a67c94"
|
||||
]
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "373c3dc7.ca5912",
|
||||
"id": "bc27b766.47eb",
|
||||
"type": "xiaomi-actions off",
|
||||
"z": "a27cc591.60157",
|
||||
"z": "d6af659e.672c78",
|
||||
"gateway": "",
|
||||
"name": "",
|
||||
"x": 820,
|
||||
"y": 1020,
|
||||
"wires": [
|
||||
[
|
||||
"70314d8a.34e17c"
|
||||
"39eb644e.a67c94"
|
||||
]
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "478d086b.03d228",
|
||||
"id": "87e3d24d.dca938",
|
||||
"type": "xiaomi-actions click",
|
||||
"z": "a27cc591.60157",
|
||||
"z": "d6af659e.672c78",
|
||||
"name": "",
|
||||
"x": 810,
|
||||
"y": 680,
|
||||
"wires": [
|
||||
[
|
||||
"70314d8a.34e17c"
|
||||
"39eb644e.a67c94"
|
||||
]
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "15e41dc2.040d2a",
|
||||
"id": "17f55e85.67fa39",
|
||||
"type": "xiaomi-actions double_click",
|
||||
"z": "a27cc591.60157",
|
||||
"z": "d6af659e.672c78",
|
||||
"name": "",
|
||||
"x": 830,
|
||||
"y": 720,
|
||||
"wires": [
|
||||
[
|
||||
"70314d8a.34e17c"
|
||||
"39eb644e.a67c94"
|
||||
]
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "70314d8a.34e17c",
|
||||
"id": "39eb644e.a67c94",
|
||||
"type": "xiaomi-gateway out",
|
||||
"z": "a27cc591.60157",
|
||||
"z": "d6af659e.672c78",
|
||||
"name": "",
|
||||
"gateway": "",
|
||||
"ip": "",
|
||||
@@ -425,37 +427,37 @@
|
||||
"wires": []
|
||||
},
|
||||
{
|
||||
"id": "2c89de3d.6e4982",
|
||||
"id": "6e073d99.348974",
|
||||
"type": "xiaomi-actions on",
|
||||
"z": "a27cc591.60157",
|
||||
"z": "d6af659e.672c78",
|
||||
"gateway": "",
|
||||
"name": "",
|
||||
"x": 280,
|
||||
"y": 920,
|
||||
"wires": [
|
||||
[
|
||||
"c537654a.b43598"
|
||||
"2e035ef8.13ee12"
|
||||
]
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "e4012d10.dc47b8",
|
||||
"id": "5d917375.467da4",
|
||||
"type": "xiaomi-actions off",
|
||||
"z": "a27cc591.60157",
|
||||
"z": "d6af659e.672c78",
|
||||
"gateway": "",
|
||||
"name": "",
|
||||
"x": 280,
|
||||
"y": 960,
|
||||
"wires": [
|
||||
[
|
||||
"c537654a.b43598"
|
||||
"2e035ef8.13ee12"
|
||||
]
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "f475f762.1c84a",
|
||||
"id": "bd81cdbf.1964",
|
||||
"type": "comment",
|
||||
"z": "a27cc591.60157",
|
||||
"z": "d6af659e.672c78",
|
||||
"name": "Filter incoming",
|
||||
"info": "",
|
||||
"x": 420,
|
||||
@@ -463,9 +465,9 @@
|
||||
"wires": []
|
||||
},
|
||||
{
|
||||
"id": "1692dd61.5f4893",
|
||||
"id": "99d83097.bf0968",
|
||||
"type": "comment",
|
||||
"z": "a27cc591.60157",
|
||||
"z": "d6af659e.672c78",
|
||||
"name": "Outgoing",
|
||||
"info": "",
|
||||
"x": 420,
|
||||
|
||||
@@ -1,13 +1,15 @@
|
||||
[
|
||||
{
|
||||
"id": "ade6666b.a390c8",
|
||||
"id": "821cff63.382248",
|
||||
"type": "tab",
|
||||
"label": "Flow 1"
|
||||
"label": "Mi Devices Sample",
|
||||
"disabled": false,
|
||||
"info": ""
|
||||
},
|
||||
{
|
||||
"id": "524f7aeb.c784cc",
|
||||
"id": "6caf94b0.f846f4",
|
||||
"type": "comment",
|
||||
"z": "ade6666b.a390c8",
|
||||
"z": "821cff63.382248",
|
||||
"name": "Get all sensors and gateway statuses",
|
||||
"info": "",
|
||||
"x": 390,
|
||||
@@ -15,9 +17,9 @@
|
||||
"wires": []
|
||||
},
|
||||
{
|
||||
"id": "629029ec.ac6cf8",
|
||||
"id": "e28ead99.c33338",
|
||||
"type": "inject",
|
||||
"z": "ade6666b.a390c8",
|
||||
"z": "821cff63.382248",
|
||||
"name": "",
|
||||
"topic": "",
|
||||
"payload": "",
|
||||
@@ -29,43 +31,43 @@
|
||||
"y": 95,
|
||||
"wires": [
|
||||
[
|
||||
"9e997e5e.27b76",
|
||||
"2fbcb15b.776afe"
|
||||
"db3b7e35.9432a8",
|
||||
"eae70f40.0c904"
|
||||
]
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "9e997e5e.27b76",
|
||||
"id": "db3b7e35.9432a8",
|
||||
"type": "xiaomi-all",
|
||||
"z": "ade6666b.a390c8",
|
||||
"z": "821cff63.382248",
|
||||
"gateway": "",
|
||||
"name": "",
|
||||
"x": 300,
|
||||
"y": 100,
|
||||
"wires": [
|
||||
[
|
||||
"c0c7989f.68b528"
|
||||
"2e706194.3c27ee"
|
||||
]
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "2fbcb15b.776afe",
|
||||
"id": "eae70f40.0c904",
|
||||
"type": "xiaomi-gateway",
|
||||
"z": "ade6666b.a390c8",
|
||||
"z": "821cff63.382248",
|
||||
"gateway": "",
|
||||
"name": "",
|
||||
"x": 320,
|
||||
"y": 160,
|
||||
"wires": [
|
||||
[
|
||||
"cde190e9.0964d"
|
||||
"aa109dae.2d9438"
|
||||
]
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "c0c7989f.68b528",
|
||||
"id": "2e706194.3c27ee",
|
||||
"type": "split",
|
||||
"z": "ade6666b.a390c8",
|
||||
"z": "821cff63.382248",
|
||||
"name": "",
|
||||
"splt": "\\n",
|
||||
"spltType": "str",
|
||||
@@ -77,14 +79,14 @@
|
||||
"y": 100,
|
||||
"wires": [
|
||||
[
|
||||
"40a6c2e5.f08c5c"
|
||||
"e1cbbde3.9a2ab8"
|
||||
]
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "40a6c2e5.f08c5c",
|
||||
"id": "e1cbbde3.9a2ab8",
|
||||
"type": "change",
|
||||
"z": "ade6666b.a390c8",
|
||||
"z": "821cff63.382248",
|
||||
"name": "set id",
|
||||
"rules": [
|
||||
{
|
||||
@@ -104,27 +106,27 @@
|
||||
"y": 100,
|
||||
"wires": [
|
||||
[
|
||||
"cde190e9.0964d"
|
||||
"aa109dae.2d9438"
|
||||
]
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "cde190e9.0964d",
|
||||
"id": "aa109dae.2d9438",
|
||||
"type": "xiaomi-actions read",
|
||||
"z": "ade6666b.a390c8",
|
||||
"z": "821cff63.382248",
|
||||
"name": "",
|
||||
"x": 810,
|
||||
"y": 100,
|
||||
"wires": [
|
||||
[
|
||||
"f867af40.57ba08"
|
||||
"d42a0577.a9bbb"
|
||||
]
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "f867af40.57ba08",
|
||||
"id": "d42a0577.a9bbb",
|
||||
"type": "xiaomi-gateway out",
|
||||
"z": "ade6666b.a390c8",
|
||||
"z": "821cff63.382248",
|
||||
"name": "",
|
||||
"gateway": "",
|
||||
"ip": "",
|
||||
@@ -133,9 +135,9 @@
|
||||
"wires": []
|
||||
},
|
||||
{
|
||||
"id": "a0b884dc.c53688",
|
||||
"id": "43eaf652.25b4b8",
|
||||
"type": "comment",
|
||||
"z": "ade6666b.a390c8",
|
||||
"z": "821cff63.382248",
|
||||
"name": "Check if a window at least one window open",
|
||||
"info": "",
|
||||
"x": 410,
|
||||
@@ -143,24 +145,24 @@
|
||||
"wires": []
|
||||
},
|
||||
{
|
||||
"id": "46856121.3b579",
|
||||
"id": "2df06b27.29db24",
|
||||
"type": "xiaomi-all",
|
||||
"z": "ade6666b.a390c8",
|
||||
"z": "821cff63.382248",
|
||||
"gateway": "",
|
||||
"name": "",
|
||||
"x": 300,
|
||||
"y": 360,
|
||||
"wires": [
|
||||
[
|
||||
"11205903.0cc817",
|
||||
"3bac4cbb.04ddb4"
|
||||
"219409ac.757b0e",
|
||||
"b6ad7f55.18f99"
|
||||
]
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "c9823238.f0de8",
|
||||
"id": "e1ff739f.b36108",
|
||||
"type": "split",
|
||||
"z": "ade6666b.a390c8",
|
||||
"z": "821cff63.382248",
|
||||
"name": "",
|
||||
"splt": "\\n",
|
||||
"spltType": "str",
|
||||
@@ -172,14 +174,14 @@
|
||||
"y": 360,
|
||||
"wires": [
|
||||
[
|
||||
"242201e2.f80c66"
|
||||
"f03d4922.cee86"
|
||||
]
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "11205903.0cc817",
|
||||
"id": "219409ac.757b0e",
|
||||
"type": "function",
|
||||
"z": "ade6666b.a390c8",
|
||||
"z": "821cff63.382248",
|
||||
"name": "filter windows",
|
||||
"func": "let windowSensors = msg.payload.filter((e) => {\n return e.model === \"magnet\";\n});\nmsg.payload = windowSensors;\nreturn msg;",
|
||||
"outputs": 1,
|
||||
@@ -188,14 +190,14 @@
|
||||
"y": 360,
|
||||
"wires": [
|
||||
[
|
||||
"c9823238.f0de8"
|
||||
"e1ff739f.b36108"
|
||||
]
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "242201e2.f80c66",
|
||||
"id": "f03d4922.cee86",
|
||||
"type": "change",
|
||||
"z": "ade6666b.a390c8",
|
||||
"z": "821cff63.382248",
|
||||
"name": "set id",
|
||||
"rules": [
|
||||
{
|
||||
@@ -215,27 +217,27 @@
|
||||
"y": 360,
|
||||
"wires": [
|
||||
[
|
||||
"922d6ca6.96b83"
|
||||
"fc9ceef6.4b5ab"
|
||||
]
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "922d6ca6.96b83",
|
||||
"id": "fc9ceef6.4b5ab",
|
||||
"type": "xiaomi-actions read",
|
||||
"z": "ade6666b.a390c8",
|
||||
"z": "821cff63.382248",
|
||||
"name": "",
|
||||
"x": 910,
|
||||
"y": 360,
|
||||
"wires": [
|
||||
[
|
||||
"de2a89d1.8e32c8"
|
||||
"5b0ada34.5af104"
|
||||
]
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "de2a89d1.8e32c8",
|
||||
"id": "5b0ada34.5af104",
|
||||
"type": "xiaomi-gateway out",
|
||||
"z": "ade6666b.a390c8",
|
||||
"z": "821cff63.382248",
|
||||
"name": "",
|
||||
"gateway": "",
|
||||
"ip": "",
|
||||
@@ -244,9 +246,9 @@
|
||||
"wires": []
|
||||
},
|
||||
{
|
||||
"id": "8139cbfb.cb0d1",
|
||||
"id": "d9ffa93a.e40638",
|
||||
"type": "xiaomi-gateway in",
|
||||
"z": "ade6666b.a390c8",
|
||||
"z": "821cff63.382248",
|
||||
"name": "",
|
||||
"gateway": "",
|
||||
"ip": "",
|
||||
@@ -254,14 +256,14 @@
|
||||
"y": 480,
|
||||
"wires": [
|
||||
[
|
||||
"b5f98d8a.5e8298"
|
||||
"1c6df817.0a0bb"
|
||||
]
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "b5f98d8a.5e8298",
|
||||
"id": "1c6df817.0a0bb",
|
||||
"type": "function",
|
||||
"z": "ade6666b.a390c8",
|
||||
"z": "821cff63.382248",
|
||||
"name": "set window sensor value",
|
||||
"func": "if ([\"magnet\", \"sensor_magnet.aq2\"].indexOf(msg.payload.model) >= 0 && msg.payload.sid !== \"158d0001ab1fa8\") {\n let globalKey = `windowSensorStatus-${msg.payload.sid}`;\n global.set(globalKey, msg.payload.data.status);\n}\n",
|
||||
"outputs": "0",
|
||||
@@ -271,9 +273,9 @@
|
||||
"wires": []
|
||||
},
|
||||
{
|
||||
"id": "3812ee82.85f612",
|
||||
"id": "e030edc3.f85a18",
|
||||
"type": "function",
|
||||
"z": "ade6666b.a390c8",
|
||||
"z": "821cff63.382248",
|
||||
"name": "get window sensors values",
|
||||
"func": "let windowSensors = {};\nmsg.payload.filter((e) => {\n return e.model === \"magnet\";\n}).forEach((e) => {\n let globalKey = `windowSensorStatus-${e.sid}`;\n let value = global.get(globalKey);\n if(!value || value == \"open\") {\n windowSensors[e.sid] = value || \"na\";\n }\n});\n\nmsg.payload = windowSensors;\nif(Object.keys(windowSensors).length) {\n return [msg, null];\n}\nreturn [null, msg];",
|
||||
"outputs": "2",
|
||||
@@ -290,9 +292,9 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "3bac4cbb.04ddb4",
|
||||
"id": "b6ad7f55.18f99",
|
||||
"type": "delay",
|
||||
"z": "ade6666b.a390c8",
|
||||
"z": "821cff63.382248",
|
||||
"name": "",
|
||||
"pauseType": "delay",
|
||||
"timeout": "500",
|
||||
@@ -308,14 +310,14 @@
|
||||
"y": 420,
|
||||
"wires": [
|
||||
[
|
||||
"3812ee82.85f612"
|
||||
"e030edc3.f85a18"
|
||||
]
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "4172e627.352338",
|
||||
"id": "7838f0b6.d0ea5",
|
||||
"type": "comment",
|
||||
"z": "ade6666b.a390c8",
|
||||
"z": "821cff63.382248",
|
||||
"name": "Doorbell",
|
||||
"info": "",
|
||||
"x": 300,
|
||||
@@ -323,9 +325,9 @@
|
||||
"wires": []
|
||||
},
|
||||
{
|
||||
"id": "24cf3af8.5d14ae",
|
||||
"id": "8de3e2f.b76f2a",
|
||||
"type": "xiaomi-gateway in",
|
||||
"z": "ade6666b.a390c8",
|
||||
"z": "821cff63.382248",
|
||||
"name": "",
|
||||
"gateway": "",
|
||||
"ip": "",
|
||||
@@ -333,14 +335,14 @@
|
||||
"y": 660,
|
||||
"wires": [
|
||||
[
|
||||
"6f68150a.27ebd4"
|
||||
"f96c8911.21e9"
|
||||
]
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "303dbf84.93647",
|
||||
"id": "26684d11.692aa2",
|
||||
"type": "function",
|
||||
"z": "ade6666b.a390c8",
|
||||
"z": "821cff63.382248",
|
||||
"name": "is click",
|
||||
"func": "if(msg.payload.cmd === \"report\" && msg.payload.data.status == \"click\") {\n return msg;\n}\nreturn null;",
|
||||
"outputs": "1",
|
||||
@@ -349,16 +351,16 @@
|
||||
"y": 660,
|
||||
"wires": [
|
||||
[
|
||||
"5f7b5c66.a6aae4",
|
||||
"d030347d.988258",
|
||||
"b6476cff.be3b08"
|
||||
"2be5185d.959f2",
|
||||
"1d76619d.106536",
|
||||
"1afbffce.6c1d2"
|
||||
]
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "5f7b5c66.a6aae4",
|
||||
"id": "2be5185d.959f2",
|
||||
"type": "xiaomi-actions gateway_sound",
|
||||
"z": "ade6666b.a390c8",
|
||||
"z": "821cff63.382248",
|
||||
"gateway": "",
|
||||
"name": "",
|
||||
"mid": "10",
|
||||
@@ -367,14 +369,14 @@
|
||||
"y": 640,
|
||||
"wires": [
|
||||
[
|
||||
"6e37698a.70dda"
|
||||
"7fa04a92.0851dc"
|
||||
]
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "6e37698a.70dda",
|
||||
"id": "7fa04a92.0851dc",
|
||||
"type": "xiaomi-gateway out",
|
||||
"z": "ade6666b.a390c8",
|
||||
"z": "821cff63.382248",
|
||||
"name": "",
|
||||
"gateway": "",
|
||||
"ip": "",
|
||||
@@ -383,9 +385,9 @@
|
||||
"wires": []
|
||||
},
|
||||
{
|
||||
"id": "1aea30f.c00254f",
|
||||
"id": "21b53d98.e9ecca",
|
||||
"type": "template",
|
||||
"z": "ade6666b.a390c8",
|
||||
"z": "821cff63.382248",
|
||||
"name": "off",
|
||||
"field": "brightness",
|
||||
"fieldType": "msg",
|
||||
@@ -397,14 +399,14 @@
|
||||
"y": 800,
|
||||
"wires": [
|
||||
[
|
||||
"464cf932.2d56"
|
||||
"7bac4ce.ffef434"
|
||||
]
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "d030347d.988258",
|
||||
"id": "1d76619d.106536",
|
||||
"type": "template",
|
||||
"z": "ade6666b.a390c8",
|
||||
"z": "821cff63.382248",
|
||||
"name": "on",
|
||||
"field": "brightness",
|
||||
"fieldType": "msg",
|
||||
@@ -416,28 +418,28 @@
|
||||
"y": 760,
|
||||
"wires": [
|
||||
[
|
||||
"464cf932.2d56"
|
||||
"7bac4ce.ffef434"
|
||||
]
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "464cf932.2d56",
|
||||
"id": "7bac4ce.ffef434",
|
||||
"type": "xiaomi-actions gateway_light",
|
||||
"z": "ade6666b.a390c8",
|
||||
"z": "821cff63.382248",
|
||||
"gateway": "",
|
||||
"name": "",
|
||||
"x": 1000,
|
||||
"y": 760,
|
||||
"wires": [
|
||||
[
|
||||
"6e37698a.70dda"
|
||||
"7fa04a92.0851dc"
|
||||
]
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "b6476cff.be3b08",
|
||||
"id": "1afbffce.6c1d2",
|
||||
"type": "delay",
|
||||
"z": "ade6666b.a390c8",
|
||||
"z": "821cff63.382248",
|
||||
"name": "500ms",
|
||||
"pauseType": "delay",
|
||||
"timeout": "500",
|
||||
@@ -453,15 +455,15 @@
|
||||
"y": 720,
|
||||
"wires": [
|
||||
[
|
||||
"1aea30f.c00254f",
|
||||
"4673a161.b816d8"
|
||||
"21b53d98.e9ecca",
|
||||
"ad79b644.f7e05"
|
||||
]
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "4673a161.b816d8",
|
||||
"id": "ad79b644.f7e05",
|
||||
"type": "delay",
|
||||
"z": "ade6666b.a390c8",
|
||||
"z": "821cff63.382248",
|
||||
"name": "500ms",
|
||||
"pauseType": "delay",
|
||||
"timeout": "500",
|
||||
@@ -477,15 +479,15 @@
|
||||
"y": 760,
|
||||
"wires": [
|
||||
[
|
||||
"d030347d.988258",
|
||||
"e07cace.7d37c5"
|
||||
"1d76619d.106536",
|
||||
"8916da4a.6aeb58"
|
||||
]
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "e07cace.7d37c5",
|
||||
"id": "8916da4a.6aeb58",
|
||||
"type": "delay",
|
||||
"z": "ade6666b.a390c8",
|
||||
"z": "821cff63.382248",
|
||||
"name": "500ms",
|
||||
"pauseType": "delay",
|
||||
"timeout": "500",
|
||||
@@ -501,15 +503,15 @@
|
||||
"y": 800,
|
||||
"wires": [
|
||||
[
|
||||
"1aea30f.c00254f",
|
||||
"f12b5663.1a82c8"
|
||||
"21b53d98.e9ecca",
|
||||
"b83a24c8.4d0f38"
|
||||
]
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "f12b5663.1a82c8",
|
||||
"id": "b83a24c8.4d0f38",
|
||||
"type": "delay",
|
||||
"z": "ade6666b.a390c8",
|
||||
"z": "821cff63.382248",
|
||||
"name": "500ms",
|
||||
"pauseType": "delay",
|
||||
"timeout": "500",
|
||||
@@ -525,15 +527,15 @@
|
||||
"y": 840,
|
||||
"wires": [
|
||||
[
|
||||
"d030347d.988258",
|
||||
"4b1d8119.5d292"
|
||||
"1d76619d.106536",
|
||||
"ce69d5d.693d4a8"
|
||||
]
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "4b1d8119.5d292",
|
||||
"id": "ce69d5d.693d4a8",
|
||||
"type": "delay",
|
||||
"z": "ade6666b.a390c8",
|
||||
"z": "821cff63.382248",
|
||||
"name": "500ms",
|
||||
"pauseType": "delay",
|
||||
"timeout": "500",
|
||||
@@ -549,14 +551,14 @@
|
||||
"y": 880,
|
||||
"wires": [
|
||||
[
|
||||
"1aea30f.c00254f"
|
||||
"21b53d98.e9ecca"
|
||||
]
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "7db6953.95a0cec",
|
||||
"id": "b7526133.93348",
|
||||
"type": "comment",
|
||||
"z": "ade6666b.a390c8",
|
||||
"z": "821cff63.382248",
|
||||
"name": "gateway light flick 3 times",
|
||||
"info": "",
|
||||
"x": 890,
|
||||
@@ -564,9 +566,9 @@
|
||||
"wires": []
|
||||
},
|
||||
{
|
||||
"id": "6f68150a.27ebd4",
|
||||
"id": "f96c8911.21e9",
|
||||
"type": "xiaomi-switch",
|
||||
"z": "ade6666b.a390c8",
|
||||
"z": "821cff63.382248",
|
||||
"gateway": "",
|
||||
"name": "",
|
||||
"sid": "",
|
||||
@@ -577,7 +579,7 @@
|
||||
"y": 660,
|
||||
"wires": [
|
||||
[
|
||||
"303dbf84.93647"
|
||||
"26684d11.692aa2"
|
||||
]
|
||||
]
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "node-red-contrib-mi-devices",
|
||||
"version": "1.0.2",
|
||||
"version": "1.0.3",
|
||||
"description": "A set of nodes to control some of the popular Xiaomi sensors which are connected to the Xiaomi Gateway, and the Gateway itself.",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 127 KiB After Width: | Height: | Size: 93 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 78 KiB After Width: | Height: | Size: 70 KiB |
@@ -91,13 +91,13 @@ module.exports = {
|
||||
// Input from gateway
|
||||
if (payload.sid) {
|
||||
if (payload.sid == node.sid) {
|
||||
miDevicesUtils.setStatus(node, payload.data);
|
||||
this.setStatus(node, payload.data);
|
||||
node.send([msg]);
|
||||
}
|
||||
}
|
||||
// Prepare for request
|
||||
else {
|
||||
miDevicesUtils.prepareForGatewayRequest(node, msg);
|
||||
this.prepareForGatewayRequest(node, msg);
|
||||
node.send(msg);
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user