Advertisement
NittyGritty

Mi-Button (Node REd)

Jul 24th, 2021
1,224
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JSON 6.04 KB | None | 0 0
  1. [
  2.     {
  3.         "id": "8ac04ff6.c9177",
  4.         "type": "mqtt in",
  5.         "z": "adffa1d1.469c8",
  6.         "name": "Mi Button",
  7.         "topic": "/home/zigbee/Button",
  8.         "qos": "2",
  9.         "datatype": "auto",
  10.         "broker": "595dfa51.2c1224",
  11.         "x": 100,
  12.         "y": 180,
  13.         "wires": [
  14.             [
  15.                 "3a425cfa.aecc64"
  16.             ]
  17.         ]
  18.     },
  19.     {
  20.         "id": "93147768.c40168",
  21.         "type": "debug",
  22.         "z": "adffa1d1.469c8",
  23.         "name": "",
  24.         "active": false,
  25.         "tosidebar": true,
  26.         "console": false,
  27.         "tostatus": false,
  28.         "complete": "false",
  29.         "x": 710,
  30.         "y": 300,
  31.         "wires": []
  32.     },
  33.     {
  34.         "id": "d5a28f99.17d5",
  35.         "type": "function",
  36.         "z": "adffa1d1.469c8",
  37.         "name": "",
  38.         "func": "var Knoten = \"Button\"\nvar Click = msg.payload.click\nvar volt = msg.payload.voltage/1000\nvar qual = msg.payload.linkquality\nvar duration = 0;\nduration = msg.payload.duration/1000\nvar bat  = msg.payload.battery\n\nmsg.payload = [{\n    Room: Knoten,\n    Click: Click,\n    Volt: volt,\n    Qual: qual,\n    Bat: bat\n}]\n\nnode.status({fill:\"blue\",shape:\"ring\",text:\"Click: \" + Click + \", Qual: \" + qual + \"%, Volt: \" + volt + \"V\" + \", Duration: \" + duration +\"sec\" });\nreturn msg;",
  39.         "outputs": 1,
  40.         "noerr": 0,
  41.         "initialize": "",
  42.         "finalize": "",
  43.         "x": 510,
  44.         "y": 300,
  45.         "wires": [
  46.             [
  47.                 "93147768.c40168"
  48.             ]
  49.         ]
  50.     },
  51.     {
  52.         "id": "3a425cfa.aecc64",
  53.         "type": "json",
  54.         "z": "adffa1d1.469c8",
  55.         "name": "",
  56.         "property": "payload",
  57.         "action": "",
  58.         "pretty": false,
  59.         "x": 330,
  60.         "y": 180,
  61.         "wires": [
  62.             [
  63.                 "d5a28f99.17d5",
  64.                 "faafe038.ed117"
  65.             ]
  66.         ]
  67.     },
  68.     {
  69.         "id": "c0f9345e.722848",
  70.         "type": "debug",
  71.         "z": "adffa1d1.469c8",
  72.         "name": "Single",
  73.         "active": true,
  74.         "tosidebar": true,
  75.         "console": false,
  76.         "tostatus": false,
  77.         "complete": "payload",
  78.         "targetType": "msg",
  79.         "x": 690,
  80.         "y": 40,
  81.         "wires": []
  82.     },
  83.     {
  84.         "id": "c4ee567c.e59908",
  85.         "type": "debug",
  86.         "z": "adffa1d1.469c8",
  87.         "name": "Double",
  88.         "active": true,
  89.         "tosidebar": true,
  90.         "console": false,
  91.         "tostatus": false,
  92.         "complete": "payload",
  93.         "targetType": "msg",
  94.         "x": 700,
  95.         "y": 80,
  96.         "wires": []
  97.     },
  98.     {
  99.         "id": "d60bffa4.63337",
  100.         "type": "debug",
  101.         "z": "adffa1d1.469c8",
  102.         "name": "Long Release",
  103.         "active": true,
  104.         "tosidebar": true,
  105.         "console": false,
  106.         "tostatus": false,
  107.         "complete": "payload",
  108.         "targetType": "msg",
  109.         "x": 720,
  110.         "y": 240,
  111.         "wires": []
  112.     },
  113.     {
  114.         "id": "faafe038.ed117",
  115.         "type": "switch",
  116.         "z": "adffa1d1.469c8",
  117.         "name": "",
  118.         "property": "payload.click",
  119.         "propertyType": "msg",
  120.         "rules": [
  121.             {
  122.                 "t": "eq",
  123.                 "v": "single",
  124.                 "vt": "str"
  125.             },
  126.             {
  127.                 "t": "eq",
  128.                 "v": "double",
  129.                 "vt": "str"
  130.             },
  131.             {
  132.                 "t": "eq",
  133.                 "v": "triple",
  134.                 "vt": "str"
  135.             },
  136.             {
  137.                 "t": "eq",
  138.                 "v": "quadruple",
  139.                 "vt": "str"
  140.             },
  141.             {
  142.                 "t": "eq",
  143.                 "v": "many",
  144.                 "vt": "str"
  145.             },
  146.             {
  147.                 "t": "eq",
  148.                 "v": "long_release",
  149.                 "vt": "str"
  150.             }
  151.         ],
  152.         "checkall": "true",
  153.         "repair": false,
  154.         "outputs": 6,
  155.         "x": 510,
  156.         "y": 140,
  157.         "wires": [
  158.             [
  159.                 "c0f9345e.722848"
  160.             ],
  161.             [
  162.                 "c4ee567c.e59908"
  163.             ],
  164.             [
  165.                 "2eb7793a.4bc9c6"
  166.             ],
  167.             [
  168.                 "8ed3dba.e2b0328"
  169.             ],
  170.             [
  171.                 "d45a15e4.2c2a78"
  172.             ],
  173.             [
  174.                 "d60bffa4.63337"
  175.             ]
  176.         ]
  177.     },
  178.     {
  179.         "id": "2eb7793a.4bc9c6",
  180.         "type": "debug",
  181.         "z": "adffa1d1.469c8",
  182.         "name": "Triple",
  183.         "active": true,
  184.         "tosidebar": true,
  185.         "console": false,
  186.         "tostatus": false,
  187.         "complete": "payload",
  188.         "targetType": "msg",
  189.         "x": 690,
  190.         "y": 120,
  191.         "wires": []
  192.     },
  193.     {
  194.         "id": "8ed3dba.e2b0328",
  195.         "type": "debug",
  196.         "z": "adffa1d1.469c8",
  197.         "name": "Quadruple",
  198.         "active": true,
  199.         "tosidebar": true,
  200.         "console": false,
  201.         "tostatus": false,
  202.         "complete": "payload",
  203.         "targetType": "msg",
  204.         "x": 710,
  205.         "y": 160,
  206.         "wires": []
  207.     },
  208.     {
  209.         "id": "d45a15e4.2c2a78",
  210.         "type": "debug",
  211.         "z": "adffa1d1.469c8",
  212.         "name": "Many",
  213.         "active": true,
  214.         "tosidebar": true,
  215.         "console": false,
  216.         "tostatus": false,
  217.         "complete": "payload",
  218.         "targetType": "msg",
  219.         "x": 690,
  220.         "y": 200,
  221.         "wires": []
  222.     },
  223.     {
  224.         "id": "595dfa51.2c1224",
  225.         "type": "mqtt-broker",
  226.         "name": "",
  227.         "broker": "192.168.123.16",
  228.         "port": "1883",
  229.         "clientid": "",
  230.         "usetls": false,
  231.         "compatmode": true,
  232.         "keepalive": "60",
  233.         "cleansession": true,
  234.         "birthTopic": "",
  235.         "birthQos": "0",
  236.         "birthPayload": "",
  237.         "closeTopic": "",
  238.         "closePayload": "",
  239.         "willTopic": "",
  240.         "willQos": "0",
  241.         "willPayload": ""
  242.     }
  243. ]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement