Advertisement
Guest User

Domoticz-MQTT-NodeRed-Govee

a guest
Feb 17th, 2023
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JSON 12.68 KB | Help | 0 0
  1. [
  2.     {
  3.         "id": "0eb14ab90c6fa536",
  4.         "type": "tab",
  5.         "label": "💡Govee",
  6.         "disabled": false,
  7.         "info": "",
  8.         "env": []
  9.     },
  10.     {
  11.         "id": "b1c5806b0e9daa88",
  12.         "type": "mqtt in",
  13.         "z": "0eb14ab90c6fa536",
  14.         "name": "",
  15.         "topic": "domoticz/out",
  16.         "qos": "2",
  17.         "datatype": "auto-detect",
  18.         "broker": "877ba76ef9957bec",
  19.         "nl": false,
  20.         "rap": true,
  21.         "rh": 0,
  22.         "inputs": 0,
  23.         "x": 150,
  24.         "y": 380,
  25.         "wires": [
  26.             [
  27.                 "ca8d98e731c372c8"
  28.             ]
  29.         ]
  30.     },
  31.     {
  32.         "id": "c954b2f005fb35e9",
  33.         "type": "mqtt out",
  34.         "z": "0eb14ab90c6fa536",
  35.         "name": "",
  36.         "topic": "domoticz/in",
  37.         "qos": "",
  38.         "retain": "",
  39.         "respTopic": "",
  40.         "contentType": "",
  41.         "userProps": "",
  42.         "correl": "",
  43.         "expiry": "",
  44.         "broker": "877ba76ef9957bec",
  45.         "x": 1070,
  46.         "y": 120,
  47.         "wires": []
  48.     },
  49.     {
  50.         "id": "b3df5bc66b823cb4",
  51.         "type": "function",
  52.         "z": "0eb14ab90c6fa536",
  53.         "name": "On",
  54.         "func": "msg.payload = { \"command\": \"udevice\", \"idx\": 578, \"nvalue\": 1, \"svalue\": \"On\" };\nreturn msg",
  55.         "outputs": 1,
  56.         "noerr": 0,
  57.         "initialize": "",
  58.         "finalize": "",
  59.         "libs": [],
  60.         "x": 870,
  61.         "y": 180,
  62.         "wires": [
  63.             [
  64.                 "c954b2f005fb35e9"
  65.             ]
  66.         ]
  67.     },
  68.     {
  69.         "id": "7bdf12e4835aa09d",
  70.         "type": "function",
  71.         "z": "0eb14ab90c6fa536",
  72.         "name": "Off",
  73.         "func": "msg.payload = { \"command\": \"udevice\", \"idx\": 578, \"nvalue\": 0, \"svalue\": \"Off\" };\nreturn msg",
  74.         "outputs": 1,
  75.         "noerr": 0,
  76.         "initialize": "",
  77.         "finalize": "",
  78.         "libs": [],
  79.         "x": 870,
  80.         "y": 60,
  81.         "wires": [
  82.             [
  83.                 "c954b2f005fb35e9"
  84.             ]
  85.         ]
  86.     },
  87.     {
  88.         "id": "fcaa8ba78658d16a",
  89.         "type": "switch",
  90.         "z": "0eb14ab90c6fa536",
  91.         "name": "",
  92.         "property": "payload.nvalue",
  93.         "propertyType": "msg",
  94.         "rules": [
  95.             {
  96.                 "t": "eq",
  97.                 "v": "1",
  98.                 "vt": "num"
  99.             },
  100.             {
  101.                 "t": "eq",
  102.                 "v": "0",
  103.                 "vt": "num"
  104.             }
  105.         ],
  106.         "checkall": "true",
  107.         "repair": false,
  108.         "outputs": 2,
  109.         "x": 530,
  110.         "y": 380,
  111.         "wires": [
  112.             [
  113.                 "5ce61fdff8f328fc",
  114.                 "33b7c9c810b6981b"
  115.             ],
  116.             [
  117.                 "d8f66f189902e6c0",
  118.                 "33b7c9c810b6981b"
  119.             ]
  120.         ]
  121.     },
  122.     {
  123.         "id": "9313720187dc3711",
  124.         "type": "http request",
  125.         "z": "0eb14ab90c6fa536",
  126.         "name": "Govee GET",
  127.         "method": "GET",
  128.         "ret": "obj",
  129.         "paytoqs": "body",
  130.         "url": "https://developer-api.govee.com/v1/devices/state?device=MAC-ADDR&model=MODEL",
  131.         "tls": "",
  132.         "persist": false,
  133.         "proxy": "",
  134.         "insecureHTTPParser": false,
  135.         "authType": "",
  136.         "senderr": false,
  137.         "headers": [
  138.             {
  139.                 "keyType": "other",
  140.                 "keyValue": "Govee-API-Key",
  141.                 "valueType": "other",
  142.                 "valueValue": "your-key"
  143.             }
  144.         ],
  145.         "x": 390,
  146.         "y": 120,
  147.         "wires": [
  148.             [
  149.                 "833ed70784f3659f"
  150.             ]
  151.         ]
  152.     },
  153.     {
  154.         "id": "833ed70784f3659f",
  155.         "type": "switch",
  156.         "z": "0eb14ab90c6fa536",
  157.         "name": "",
  158.         "property": "payload.data.properties[1].powerState",
  159.         "propertyType": "msg",
  160.         "rules": [
  161.             {
  162.                 "t": "eq",
  163.                 "v": "off",
  164.                 "vt": "str"
  165.             },
  166.             {
  167.                 "t": "eq",
  168.                 "v": "on",
  169.                 "vt": "str"
  170.             }
  171.         ],
  172.         "checkall": "true",
  173.         "repair": false,
  174.         "outputs": 2,
  175.         "x": 590,
  176.         "y": 120,
  177.         "wires": [
  178.             [
  179.                 "7bdf12e4835aa09d"
  180.             ],
  181.             [
  182.                 "b3df5bc66b823cb4"
  183.             ]
  184.         ]
  185.     },
  186.     {
  187.         "id": "4228af50bc74d381",
  188.         "type": "inject",
  189.         "z": "0eb14ab90c6fa536",
  190.         "name": "Every minutes",
  191.         "props": [
  192.             {
  193.                 "p": "payload"
  194.             },
  195.             {
  196.                 "p": "topic",
  197.                 "vt": "str"
  198.             }
  199.         ],
  200.         "repeat": "60",
  201.         "crontab": "",
  202.         "once": false,
  203.         "onceDelay": 0.1,
  204.         "topic": "",
  205.         "payload": "",
  206.         "payloadType": "date",
  207.         "x": 180,
  208.         "y": 120,
  209.         "wires": [
  210.             [
  211.                 "9313720187dc3711"
  212.             ]
  213.         ]
  214.     },
  215.     {
  216.         "id": "3d089983a880c52f",
  217.         "type": "http request",
  218.         "z": "0eb14ab90c6fa536",
  219.         "name": "Govee PUT",
  220.         "method": "PUT",
  221.         "ret": "obj",
  222.         "paytoqs": "body",
  223.         "url": "https://developer-api.govee.com/v1/devices/control",
  224.         "tls": "",
  225.         "persist": false,
  226.         "proxy": "",
  227.         "insecureHTTPParser": false,
  228.         "authType": "",
  229.         "senderr": false,
  230.         "headers": [
  231.             {
  232.                 "keyType": "other",
  233.                 "keyValue": "Govee-API-Key",
  234.                 "valueType": "other",
  235.                 "valueValue": "your-key"
  236.             }
  237.         ],
  238.         "x": 1230,
  239.         "y": 380,
  240.         "wires": [
  241.             [
  242.                 "a996d26b53d5092b"
  243.             ]
  244.         ]
  245.     },
  246.     {
  247.         "id": "fbe815a0148578a8",
  248.         "type": "function",
  249.         "z": "0eb14ab90c6fa536",
  250.         "name": "API Body",
  251.         "func": "msg.payload = {\n\"device\": \"MAC-ADDR\",\n    \"model\": \"MODEL\",\n        \"cmd\": {\n    \"name\": \"turn\",\n        \"value\": msg.payload.turn\n}\n}\nreturn msg;",
  252.         "outputs": 1,
  253.         "noerr": 0,
  254.         "initialize": "",
  255.         "finalize": "",
  256.         "libs": [],
  257.         "x": 1000,
  258.         "y": 380,
  259.         "wires": [
  260.             [
  261.                 "3d089983a880c52f",
  262.                 "ae4c932504bfc643"
  263.             ]
  264.         ]
  265.     },
  266.     {
  267.         "id": "5ce61fdff8f328fc",
  268.         "type": "function",
  269.         "z": "0eb14ab90c6fa536",
  270.         "name": "Switch Value On",
  271.         "func": "msg.payload.turn = 'on'\nreturn msg;",
  272.         "outputs": 1,
  273.         "noerr": 0,
  274.         "initialize": "",
  275.         "finalize": "",
  276.         "libs": [],
  277.         "x": 760,
  278.         "y": 320,
  279.         "wires": [
  280.             [
  281.                 "fbe815a0148578a8"
  282.             ]
  283.         ]
  284.     },
  285.     {
  286.         "id": "d8f66f189902e6c0",
  287.         "type": "function",
  288.         "z": "0eb14ab90c6fa536",
  289.         "name": "Switch Value Off",
  290.         "func": "msg.payload.turn = 'off'\nreturn msg;",
  291.         "outputs": 1,
  292.         "noerr": 0,
  293.         "initialize": "",
  294.         "finalize": "",
  295.         "libs": [],
  296.         "x": 760,
  297.         "y": 440,
  298.         "wires": [
  299.             [
  300.                 "fbe815a0148578a8"
  301.             ]
  302.         ]
  303.     },
  304.     {
  305.         "id": "ca8d98e731c372c8",
  306.         "type": "switch",
  307.         "z": "0eb14ab90c6fa536",
  308.         "name": "Filtre Device",
  309.         "property": "payload.idx",
  310.         "propertyType": "msg",
  311.         "rules": [
  312.             {
  313.                 "t": "eq",
  314.                 "v": "578",
  315.                 "vt": "str"
  316.             }
  317.         ],
  318.         "checkall": "false",
  319.         "repair": false,
  320.         "outputs": 1,
  321.         "x": 350,
  322.         "y": 380,
  323.         "wires": [
  324.             [
  325.                 "fcaa8ba78658d16a"
  326.             ]
  327.         ],
  328.         "inputLabels": [
  329.             "JSON"
  330.         ],
  331.         "outputLabels": [
  332.             "JSON"
  333.         ],
  334.         "icon": "node-red/arrow-in.svg"
  335.     },
  336.     {
  337.         "id": "a996d26b53d5092b",
  338.         "type": "debug",
  339.         "z": "0eb14ab90c6fa536",
  340.         "name": "Output API",
  341.         "active": false,
  342.         "tosidebar": true,
  343.         "console": false,
  344.         "tostatus": false,
  345.         "complete": "payload",
  346.         "targetType": "msg",
  347.         "statusVal": "",
  348.         "statusType": "auto",
  349.         "x": 1470,
  350.         "y": 380,
  351.         "wires": []
  352.     },
  353.     {
  354.         "id": "33b7c9c810b6981b",
  355.         "type": "debug",
  356.         "z": "0eb14ab90c6fa536",
  357.         "name": "Switch",
  358.         "active": false,
  359.         "tosidebar": true,
  360.         "console": false,
  361.         "tostatus": false,
  362.         "complete": "payload",
  363.         "targetType": "msg",
  364.         "statusVal": "",
  365.         "statusType": "auto",
  366.         "x": 730,
  367.         "y": 380,
  368.         "wires": []
  369.     },
  370.     {
  371.         "id": "ae4c932504bfc643",
  372.         "type": "debug",
  373.         "z": "0eb14ab90c6fa536",
  374.         "name": "Body",
  375.         "active": false,
  376.         "tosidebar": true,
  377.         "console": false,
  378.         "tostatus": false,
  379.         "complete": "payload.cmd.value",
  380.         "targetType": "msg",
  381.         "statusVal": "",
  382.         "statusType": "auto",
  383.         "x": 1210,
  384.         "y": 440,
  385.         "wires": []
  386.     },
  387.     {
  388.         "id": "e281d7769ee720ad",
  389.         "type": "mqtt in",
  390.         "z": "0eb14ab90c6fa536",
  391.         "name": "",
  392.         "topic": "domoticz/out",
  393.         "qos": "2",
  394.         "datatype": "auto-detect",
  395.         "broker": "877ba76ef9957bec",
  396.         "nl": false,
  397.         "rap": true,
  398.         "rh": 0,
  399.         "inputs": 0,
  400.         "x": 150,
  401.         "y": 600,
  402.         "wires": [
  403.             [
  404.                 "35d0860ce18130bb"
  405.             ]
  406.         ]
  407.     },
  408.     {
  409.         "id": "35d0860ce18130bb",
  410.         "type": "switch",
  411.         "z": "0eb14ab90c6fa536",
  412.         "name": "Filtre Device",
  413.         "property": "payload.idx",
  414.         "propertyType": "msg",
  415.         "rules": [
  416.             {
  417.                 "t": "eq",
  418.                 "v": "579",
  419.                 "vt": "str"
  420.             }
  421.         ],
  422.         "checkall": "false",
  423.         "repair": false,
  424.         "outputs": 1,
  425.         "x": 350,
  426.         "y": 600,
  427.         "wires": [
  428.             [
  429.                 "44031452620c6b32"
  430.             ]
  431.         ],
  432.         "inputLabels": [
  433.             "JSON"
  434.         ],
  435.         "outputLabels": [
  436.             "JSON"
  437.         ],
  438.         "icon": "node-red/arrow-in.svg"
  439.     },
  440.     {
  441.         "id": "da85d2c285791c26",
  442.         "type": "http request",
  443.         "z": "0eb14ab90c6fa536",
  444.         "name": "Update RGBWW",
  445.         "method": "GET",
  446.         "ret": "obj",
  447.         "paytoqs": "ignore",
  448.         "url": "",
  449.         "tls": "",
  450.         "persist": false,
  451.         "proxy": "",
  452.         "insecureHTTPParser": false,
  453.         "authType": "",
  454.         "senderr": false,
  455.         "headers": [],
  456.         "x": 1130,
  457.         "y": 600,
  458.         "wires": [
  459.             []
  460.         ]
  461.     },
  462.     {
  463.         "id": "2c9a86676fc4d879",
  464.         "type": "function",
  465.         "z": "0eb14ab90c6fa536",
  466.         "name": "Generate URL",
  467.         "func": "msg.url = \"http://your-domoticz/json.htm?type=command&param=setcolbrightnessvalue&idx=469&color=\" + msg.payload.Color +\" &brightness=\" + msg.payload.Level;\nreturn msg;",
  468.         "outputs": 1,
  469.         "noerr": 0,
  470.         "initialize": "",
  471.         "finalize": "",
  472.         "libs": [],
  473.         "x": 900,
  474.         "y": 600,
  475.         "wires": [
  476.             [
  477.                 "da85d2c285791c26"
  478.             ]
  479.         ]
  480.     },
  481.     {
  482.         "id": "44031452620c6b32",
  483.         "type": "json",
  484.         "z": "0eb14ab90c6fa536",
  485.         "name": "Convert Color JSON to String",
  486.         "property": "payload.Color",
  487.         "action": "",
  488.         "pretty": true,
  489.         "x": 610,
  490.         "y": 600,
  491.         "wires": [
  492.             [
  493.                 "2c9a86676fc4d879"
  494.             ]
  495.         ]
  496.     },
  497.     {
  498.         "id": "877ba76ef9957bec",
  499.         "type": "mqtt-broker",
  500.         "name": "Mosquito",
  501.         "broker": "your-mqtt",
  502.         "port": "port",
  503.         "clientid": "",
  504.         "autoConnect": true,
  505.         "usetls": false,
  506.         "protocolVersion": "3",
  507.         "keepalive": "60",
  508.         "cleansession": true,
  509.         "birthTopic": "",
  510.         "birthQos": "0",
  511.         "birthPayload": "",
  512.         "birthMsg": {},
  513.         "closeTopic": "",
  514.         "closeQos": "0",
  515.         "closePayload": "",
  516.         "closeMsg": {},
  517.         "willTopic": "",
  518.         "willQos": "0",
  519.         "willPayload": "",
  520.         "willMsg": {},
  521.         "userProps": "",
  522.         "sessionExpiry": ""
  523.     }
  524. ]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement