Advertisement
NittyGritty

IKEA-Button

Dec 15th, 2021
1,390
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JSON 13.40 KB | None | 0 0
  1. [
  2.     {
  3.         "id": "cc7414fb.91f278",
  4.         "type": "tab",
  5.         "label": "Ikea-Button",
  6.         "disabled": false,
  7.         "info": ""
  8.     },
  9.     {
  10.         "id": "90f50d13.e7349",
  11.         "type": "mqtt in",
  12.         "z": "cc7414fb.91f278",
  13.         "name": "IKEA Button",
  14.         "topic": "/home/zigbee/Ikea-Button",
  15.         "qos": "2",
  16.         "datatype": "auto",
  17.         "broker": "595dfa51.2c1224",
  18.         "inputs": 0,
  19.         "x": 130,
  20.         "y": 300,
  21.         "wires": [
  22.             [
  23.                 "a5a7d870.8eb7f8"
  24.             ]
  25.         ]
  26.     },
  27.     {
  28.         "id": "c9757d4f.fc9b7",
  29.         "type": "debug",
  30.         "z": "cc7414fb.91f278",
  31.         "name": "Ikea-Button",
  32.         "active": false,
  33.         "tosidebar": true,
  34.         "console": false,
  35.         "tostatus": false,
  36.         "complete": "payload",
  37.         "targetType": "msg",
  38.         "x": 890,
  39.         "y": 1000,
  40.         "wires": []
  41.     },
  42.     {
  43.         "id": "54c8c41b.3c689c",
  44.         "type": "function",
  45.         "z": "cc7414fb.91f278",
  46.         "name": "",
  47.         "func": "var Knoten = \"Button\"\nvar Click = msg.payload.action\nvar duration = msg.payload.duration\nvar qual = msg.payload.linkquality\nvar bat  = msg.payload.battery\n\nmsg.payload = [{\n    Room: Knoten,\n    Click: Click,\n    Duration: duration,\n    Qual: qual,\n    Bat: bat\n}]\n\nnode.status({fill:\"blue\",shape:\"ring\",text:\"Click: \" + Click + \", Qual: \" + qual + \"%\" + \", Duration: \" + duration + \"sec\" });\n// node.status({fill:\"blue\",shape:\"ring\",text:\"Click: \" + Click + \", Qual: \" + qual + \"%\" });\nreturn msg;",
  48.         "outputs": 1,
  49.         "noerr": 0,
  50.         "x": 570,
  51.         "y": 1000,
  52.         "wires": [
  53.             [
  54.                 "c9757d4f.fc9b7"
  55.             ]
  56.         ]
  57.     },
  58.     {
  59.         "id": "a5a7d870.8eb7f8",
  60.         "type": "json",
  61.         "z": "cc7414fb.91f278",
  62.         "name": "",
  63.         "property": "payload",
  64.         "action": "",
  65.         "pretty": false,
  66.         "x": 290,
  67.         "y": 300,
  68.         "wires": [
  69.             [
  70.                 "54c8c41b.3c689c",
  71.                 "6b87e3c0.694bfc",
  72.                 "35c2421d.27180e",
  73.                 "ca674756.f8bbc8",
  74.                 "dd05e125.7ba94",
  75.                 "14c8b050.1758f"
  76.             ]
  77.         ]
  78.     },
  79.     {
  80.         "id": "6b87e3c0.694bfc",
  81.         "type": "switch",
  82.         "z": "cc7414fb.91f278",
  83.         "name": "Arrow Right",
  84.         "property": "payload.action",
  85.         "propertyType": "msg",
  86.         "rules": [
  87.             {
  88.                 "t": "eq",
  89.                 "v": "arrow_right_click",
  90.                 "vt": "str"
  91.             },
  92.             {
  93.                 "t": "eq",
  94.                 "v": "arrow_right_hold",
  95.                 "vt": "str"
  96.             },
  97.             {
  98.                 "t": "eq",
  99.                 "v": "arrow_right_release",
  100.                 "vt": "str"
  101.             }
  102.         ],
  103.         "checkall": "true",
  104.         "repair": false,
  105.         "outputs": 3,
  106.         "x": 630,
  107.         "y": 100,
  108.         "wires": [
  109.             [
  110.                 "15f262c.aba469d"
  111.             ],
  112.             [
  113.                 "c25b2666.b77318"
  114.             ],
  115.             [
  116.                 "e2e8c6e3.564d48"
  117.             ]
  118.         ]
  119.     },
  120.     {
  121.         "id": "15f262c.aba469d",
  122.         "type": "debug",
  123.         "z": "cc7414fb.91f278",
  124.         "name": "Arrow_Right_Click",
  125.         "active": true,
  126.         "tosidebar": false,
  127.         "console": false,
  128.         "tostatus": true,
  129.         "complete": "payload",
  130.         "targetType": "msg",
  131.         "statusVal": "payload",
  132.         "statusType": "auto",
  133.         "x": 890,
  134.         "y": 40,
  135.         "wires": []
  136.     },
  137.     {
  138.         "id": "c25b2666.b77318",
  139.         "type": "debug",
  140.         "z": "cc7414fb.91f278",
  141.         "name": "Arrow_Right_Hold",
  142.         "active": true,
  143.         "tosidebar": false,
  144.         "console": false,
  145.         "tostatus": true,
  146.         "complete": "payload",
  147.         "targetType": "msg",
  148.         "statusVal": "payload",
  149.         "statusType": "auto",
  150.         "x": 890,
  151.         "y": 100,
  152.         "wires": []
  153.     },
  154.     {
  155.         "id": "e2e8c6e3.564d48",
  156.         "type": "debug",
  157.         "z": "cc7414fb.91f278",
  158.         "name": "Arrow_Right_Release",
  159.         "active": true,
  160.         "tosidebar": false,
  161.         "console": false,
  162.         "tostatus": true,
  163.         "complete": "payload",
  164.         "targetType": "msg",
  165.         "statusVal": "payload",
  166.         "statusType": "auto",
  167.         "x": 900,
  168.         "y": 160,
  169.         "wires": []
  170.     },
  171.     {
  172.         "id": "35c2421d.27180e",
  173.         "type": "switch",
  174.         "z": "cc7414fb.91f278",
  175.         "name": "Arrow Left",
  176.         "property": "payload.action",
  177.         "propertyType": "msg",
  178.         "rules": [
  179.             {
  180.                 "t": "eq",
  181.                 "v": "arrow_left_click",
  182.                 "vt": "str"
  183.             },
  184.             {
  185.                 "t": "eq",
  186.                 "v": "arrow_left_hold",
  187.                 "vt": "str"
  188.             },
  189.             {
  190.                 "t": "eq",
  191.                 "v": "arrow_left_release",
  192.                 "vt": "str"
  193.             }
  194.         ],
  195.         "checkall": "true",
  196.         "repair": false,
  197.         "outputs": 3,
  198.         "x": 630,
  199.         "y": 300,
  200.         "wires": [
  201.             [
  202.                 "aff91674.8c7458"
  203.             ],
  204.             [
  205.                 "5bc7b784.9d95f8"
  206.             ],
  207.             [
  208.                 "8aad4afd.9c74b8"
  209.             ]
  210.         ]
  211.     },
  212.     {
  213.         "id": "aff91674.8c7458",
  214.         "type": "debug",
  215.         "z": "cc7414fb.91f278",
  216.         "name": "Arrow_Left_Click",
  217.         "active": true,
  218.         "tosidebar": false,
  219.         "console": false,
  220.         "tostatus": true,
  221.         "complete": "payload",
  222.         "targetType": "msg",
  223.         "statusVal": "payload",
  224.         "statusType": "auto",
  225.         "x": 890,
  226.         "y": 240,
  227.         "wires": []
  228.     },
  229.     {
  230.         "id": "5bc7b784.9d95f8",
  231.         "type": "debug",
  232.         "z": "cc7414fb.91f278",
  233.         "name": "Arrow_Left_Hold",
  234.         "active": true,
  235.         "tosidebar": false,
  236.         "console": false,
  237.         "tostatus": true,
  238.         "complete": "payload",
  239.         "targetType": "msg",
  240.         "statusVal": "payload",
  241.         "statusType": "auto",
  242.         "x": 890,
  243.         "y": 300,
  244.         "wires": []
  245.     },
  246.     {
  247.         "id": "8aad4afd.9c74b8",
  248.         "type": "debug",
  249.         "z": "cc7414fb.91f278",
  250.         "name": "Arrow_Left_Release",
  251.         "active": true,
  252.         "tosidebar": false,
  253.         "console": false,
  254.         "tostatus": true,
  255.         "complete": "payload",
  256.         "targetType": "msg",
  257.         "statusVal": "payload",
  258.         "statusType": "auto",
  259.         "x": 900,
  260.         "y": 360,
  261.         "wires": []
  262.     },
  263.     {
  264.         "id": "ca674756.f8bbc8",
  265.         "type": "switch",
  266.         "z": "cc7414fb.91f278",
  267.         "name": "Brightness Up",
  268.         "property": "payload.action",
  269.         "propertyType": "msg",
  270.         "rules": [
  271.             {
  272.                 "t": "eq",
  273.                 "v": "brightness_up_click",
  274.                 "vt": "str"
  275.             },
  276.             {
  277.                 "t": "eq",
  278.                 "v": "brightness_up_hold",
  279.                 "vt": "str"
  280.             },
  281.             {
  282.                 "t": "eq",
  283.                 "v": "brightness_up_release",
  284.                 "vt": "str"
  285.             }
  286.         ],
  287.         "checkall": "true",
  288.         "repair": false,
  289.         "outputs": 3,
  290.         "x": 620,
  291.         "y": 500,
  292.         "wires": [
  293.             [
  294.                 "ab95a88.7281858"
  295.             ],
  296.             [
  297.                 "15c41dfd.ec9cd2"
  298.             ],
  299.             [
  300.                 "1f202961.d4bc77"
  301.             ]
  302.         ]
  303.     },
  304.     {
  305.         "id": "dd05e125.7ba94",
  306.         "type": "switch",
  307.         "z": "cc7414fb.91f278",
  308.         "name": "Brightness Down",
  309.         "property": "payload.action",
  310.         "propertyType": "msg",
  311.         "rules": [
  312.             {
  313.                 "t": "eq",
  314.                 "v": "brightness_down_click",
  315.                 "vt": "str"
  316.             },
  317.             {
  318.                 "t": "eq",
  319.                 "v": "brightness_down_hold",
  320.                 "vt": "str"
  321.             },
  322.             {
  323.                 "t": "eq",
  324.                 "v": "brightness_down_release",
  325.                 "vt": "str"
  326.             }
  327.         ],
  328.         "checkall": "true",
  329.         "repair": false,
  330.         "outputs": 3,
  331.         "x": 610,
  332.         "y": 700,
  333.         "wires": [
  334.             [
  335.                 "318f1334.a1295c"
  336.             ],
  337.             [
  338.                 "d3b6ba7e.a4c588"
  339.             ],
  340.             [
  341.                 "cd4b345f.188d38"
  342.             ]
  343.         ]
  344.     },
  345.     {
  346.         "id": "318f1334.a1295c",
  347.         "type": "debug",
  348.         "z": "cc7414fb.91f278",
  349.         "name": "Brightness_Down_Click",
  350.         "active": true,
  351.         "tosidebar": false,
  352.         "console": false,
  353.         "tostatus": true,
  354.         "complete": "payload",
  355.         "targetType": "msg",
  356.         "statusVal": "payload",
  357.         "statusType": "auto",
  358.         "x": 910,
  359.         "y": 640,
  360.         "wires": []
  361.     },
  362.     {
  363.         "id": "d3b6ba7e.a4c588",
  364.         "type": "debug",
  365.         "z": "cc7414fb.91f278",
  366.         "name": "Brightness_Down_Hold",
  367.         "active": true,
  368.         "tosidebar": false,
  369.         "console": false,
  370.         "tostatus": true,
  371.         "complete": "payload",
  372.         "targetType": "msg",
  373.         "statusVal": "payload",
  374.         "statusType": "auto",
  375.         "x": 910,
  376.         "y": 700,
  377.         "wires": []
  378.     },
  379.     {
  380.         "id": "cd4b345f.188d38",
  381.         "type": "debug",
  382.         "z": "cc7414fb.91f278",
  383.         "name": "Brightness_Down_Release",
  384.         "active": true,
  385.         "tosidebar": false,
  386.         "console": false,
  387.         "tostatus": true,
  388.         "complete": "payload",
  389.         "targetType": "msg",
  390.         "statusVal": "payload",
  391.         "statusType": "auto",
  392.         "x": 920,
  393.         "y": 760,
  394.         "wires": []
  395.     },
  396.     {
  397.         "id": "ab95a88.7281858",
  398.         "type": "debug",
  399.         "z": "cc7414fb.91f278",
  400.         "name": "Brightness_Up_Click",
  401.         "active": true,
  402.         "tosidebar": false,
  403.         "console": false,
  404.         "tostatus": true,
  405.         "complete": "payload",
  406.         "targetType": "msg",
  407.         "statusVal": "payload",
  408.         "statusType": "auto",
  409.         "x": 900,
  410.         "y": 440,
  411.         "wires": []
  412.     },
  413.     {
  414.         "id": "15c41dfd.ec9cd2",
  415.         "type": "debug",
  416.         "z": "cc7414fb.91f278",
  417.         "name": "Brightness_Up_Hold",
  418.         "active": true,
  419.         "tosidebar": false,
  420.         "console": false,
  421.         "tostatus": true,
  422.         "complete": "payload",
  423.         "targetType": "msg",
  424.         "statusVal": "payload",
  425.         "statusType": "auto",
  426.         "x": 900,
  427.         "y": 500,
  428.         "wires": []
  429.     },
  430.     {
  431.         "id": "1f202961.d4bc77",
  432.         "type": "debug",
  433.         "z": "cc7414fb.91f278",
  434.         "name": "Brightness_Up_Release",
  435.         "active": true,
  436.         "tosidebar": false,
  437.         "console": false,
  438.         "tostatus": true,
  439.         "complete": "payload",
  440.         "targetType": "msg",
  441.         "statusVal": "payload",
  442.         "statusType": "auto",
  443.         "x": 910,
  444.         "y": 560,
  445.         "wires": []
  446.     },
  447.     {
  448.         "id": "14c8b050.1758f",
  449.         "type": "switch",
  450.         "z": "cc7414fb.91f278",
  451.         "name": "Toggle",
  452.         "property": "payload.action",
  453.         "propertyType": "msg",
  454.         "rules": [
  455.             {
  456.                 "t": "eq",
  457.                 "v": "toggle",
  458.                 "vt": "str"
  459.             },
  460.             {
  461.                 "t": "eq",
  462.                 "v": "toggle_hold",
  463.                 "vt": "str"
  464.             }
  465.         ],
  466.         "checkall": "true",
  467.         "repair": false,
  468.         "outputs": 2,
  469.         "x": 650,
  470.         "y": 880,
  471.         "wires": [
  472.             [
  473.                 "dad0115e.d5eb9"
  474.             ],
  475.             [
  476.                 "263283d1.2e596c"
  477.             ]
  478.         ]
  479.     },
  480.     {
  481.         "id": "dad0115e.d5eb9",
  482.         "type": "debug",
  483.         "z": "cc7414fb.91f278",
  484.         "name": "Toggle",
  485.         "active": true,
  486.         "tosidebar": false,
  487.         "console": false,
  488.         "tostatus": true,
  489.         "complete": "payload",
  490.         "targetType": "msg",
  491.         "statusVal": "payload",
  492.         "statusType": "auto",
  493.         "x": 850,
  494.         "y": 840,
  495.         "wires": []
  496.     },
  497.     {
  498.         "id": "263283d1.2e596c",
  499.         "type": "debug",
  500.         "z": "cc7414fb.91f278",
  501.         "name": "Toggle_Hold",
  502.         "active": true,
  503.         "tosidebar": false,
  504.         "console": false,
  505.         "tostatus": true,
  506.         "complete": "payload",
  507.         "targetType": "msg",
  508.         "statusVal": "payload",
  509.         "statusType": "auto",
  510.         "x": 870,
  511.         "y": 900,
  512.         "wires": []
  513.     },
  514.     {
  515.         "id": "595dfa51.2c1224",
  516.         "type": "mqtt-broker",
  517.         "name": "",
  518.         "broker": "192.168.123.16",
  519.         "port": "1883",
  520.         "clientid": "",
  521.         "usetls": false,
  522.         "compatmode": true,
  523.         "keepalive": "60",
  524.         "cleansession": true,
  525.         "birthTopic": "",
  526.         "birthQos": "0",
  527.         "birthPayload": "",
  528.         "closeTopic": "",
  529.         "closePayload": "",
  530.         "willTopic": "",
  531.         "willQos": "0",
  532.         "willPayload": ""
  533.     }
  534. ]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement