Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [
- {
- "id": "0eb14ab90c6fa536",
- "type": "tab",
- "label": "💡Govee",
- "disabled": false,
- "info": "",
- "env": []
- },
- {
- "id": "b1c5806b0e9daa88",
- "type": "mqtt in",
- "z": "0eb14ab90c6fa536",
- "name": "",
- "topic": "domoticz/out",
- "qos": "2",
- "datatype": "auto-detect",
- "broker": "877ba76ef9957bec",
- "nl": false,
- "rap": true,
- "rh": 0,
- "inputs": 0,
- "x": 150,
- "y": 380,
- "wires": [
- [
- "ca8d98e731c372c8"
- ]
- ]
- },
- {
- "id": "c954b2f005fb35e9",
- "type": "mqtt out",
- "z": "0eb14ab90c6fa536",
- "name": "",
- "topic": "domoticz/in",
- "qos": "",
- "retain": "",
- "respTopic": "",
- "contentType": "",
- "userProps": "",
- "correl": "",
- "expiry": "",
- "broker": "877ba76ef9957bec",
- "x": 1070,
- "y": 120,
- "wires": []
- },
- {
- "id": "b3df5bc66b823cb4",
- "type": "function",
- "z": "0eb14ab90c6fa536",
- "name": "On",
- "func": "msg.payload = { \"command\": \"udevice\", \"idx\": 578, \"nvalue\": 1, \"svalue\": \"On\" };\nreturn msg",
- "outputs": 1,
- "noerr": 0,
- "initialize": "",
- "finalize": "",
- "libs": [],
- "x": 870,
- "y": 180,
- "wires": [
- [
- "c954b2f005fb35e9"
- ]
- ]
- },
- {
- "id": "7bdf12e4835aa09d",
- "type": "function",
- "z": "0eb14ab90c6fa536",
- "name": "Off",
- "func": "msg.payload = { \"command\": \"udevice\", \"idx\": 578, \"nvalue\": 0, \"svalue\": \"Off\" };\nreturn msg",
- "outputs": 1,
- "noerr": 0,
- "initialize": "",
- "finalize": "",
- "libs": [],
- "x": 870,
- "y": 60,
- "wires": [
- [
- "c954b2f005fb35e9"
- ]
- ]
- },
- {
- "id": "fcaa8ba78658d16a",
- "type": "switch",
- "z": "0eb14ab90c6fa536",
- "name": "",
- "property": "payload.nvalue",
- "propertyType": "msg",
- "rules": [
- {
- "t": "eq",
- "v": "1",
- "vt": "num"
- },
- {
- "t": "eq",
- "v": "0",
- "vt": "num"
- }
- ],
- "checkall": "true",
- "repair": false,
- "outputs": 2,
- "x": 530,
- "y": 380,
- "wires": [
- [
- "5ce61fdff8f328fc",
- "33b7c9c810b6981b"
- ],
- [
- "d8f66f189902e6c0",
- "33b7c9c810b6981b"
- ]
- ]
- },
- {
- "id": "9313720187dc3711",
- "type": "http request",
- "z": "0eb14ab90c6fa536",
- "name": "Govee GET",
- "method": "GET",
- "ret": "obj",
- "paytoqs": "body",
- "url": "https://developer-api.govee.com/v1/devices/state?device=MAC-ADDR&model=MODEL",
- "tls": "",
- "persist": false,
- "proxy": "",
- "insecureHTTPParser": false,
- "authType": "",
- "senderr": false,
- "headers": [
- {
- "keyType": "other",
- "keyValue": "Govee-API-Key",
- "valueType": "other",
- "valueValue": "your-key"
- }
- ],
- "x": 390,
- "y": 120,
- "wires": [
- [
- "833ed70784f3659f"
- ]
- ]
- },
- {
- "id": "833ed70784f3659f",
- "type": "switch",
- "z": "0eb14ab90c6fa536",
- "name": "",
- "property": "payload.data.properties[1].powerState",
- "propertyType": "msg",
- "rules": [
- {
- "t": "eq",
- "v": "off",
- "vt": "str"
- },
- {
- "t": "eq",
- "v": "on",
- "vt": "str"
- }
- ],
- "checkall": "true",
- "repair": false,
- "outputs": 2,
- "x": 590,
- "y": 120,
- "wires": [
- [
- "7bdf12e4835aa09d"
- ],
- [
- "b3df5bc66b823cb4"
- ]
- ]
- },
- {
- "id": "4228af50bc74d381",
- "type": "inject",
- "z": "0eb14ab90c6fa536",
- "name": "Every minutes",
- "props": [
- {
- "p": "payload"
- },
- {
- "p": "topic",
- "vt": "str"
- }
- ],
- "repeat": "60",
- "crontab": "",
- "once": false,
- "onceDelay": 0.1,
- "topic": "",
- "payload": "",
- "payloadType": "date",
- "x": 180,
- "y": 120,
- "wires": [
- [
- "9313720187dc3711"
- ]
- ]
- },
- {
- "id": "3d089983a880c52f",
- "type": "http request",
- "z": "0eb14ab90c6fa536",
- "name": "Govee PUT",
- "method": "PUT",
- "ret": "obj",
- "paytoqs": "body",
- "url": "https://developer-api.govee.com/v1/devices/control",
- "tls": "",
- "persist": false,
- "proxy": "",
- "insecureHTTPParser": false,
- "authType": "",
- "senderr": false,
- "headers": [
- {
- "keyType": "other",
- "keyValue": "Govee-API-Key",
- "valueType": "other",
- "valueValue": "your-key"
- }
- ],
- "x": 1230,
- "y": 380,
- "wires": [
- [
- "a996d26b53d5092b"
- ]
- ]
- },
- {
- "id": "fbe815a0148578a8",
- "type": "function",
- "z": "0eb14ab90c6fa536",
- "name": "API Body",
- "func": "msg.payload = {\n\"device\": \"MAC-ADDR\",\n \"model\": \"MODEL\",\n \"cmd\": {\n \"name\": \"turn\",\n \"value\": msg.payload.turn\n}\n}\nreturn msg;",
- "outputs": 1,
- "noerr": 0,
- "initialize": "",
- "finalize": "",
- "libs": [],
- "x": 1000,
- "y": 380,
- "wires": [
- [
- "3d089983a880c52f",
- "ae4c932504bfc643"
- ]
- ]
- },
- {
- "id": "5ce61fdff8f328fc",
- "type": "function",
- "z": "0eb14ab90c6fa536",
- "name": "Switch Value On",
- "func": "msg.payload.turn = 'on'\nreturn msg;",
- "outputs": 1,
- "noerr": 0,
- "initialize": "",
- "finalize": "",
- "libs": [],
- "x": 760,
- "y": 320,
- "wires": [
- [
- "fbe815a0148578a8"
- ]
- ]
- },
- {
- "id": "d8f66f189902e6c0",
- "type": "function",
- "z": "0eb14ab90c6fa536",
- "name": "Switch Value Off",
- "func": "msg.payload.turn = 'off'\nreturn msg;",
- "outputs": 1,
- "noerr": 0,
- "initialize": "",
- "finalize": "",
- "libs": [],
- "x": 760,
- "y": 440,
- "wires": [
- [
- "fbe815a0148578a8"
- ]
- ]
- },
- {
- "id": "ca8d98e731c372c8",
- "type": "switch",
- "z": "0eb14ab90c6fa536",
- "name": "Filtre Device",
- "property": "payload.idx",
- "propertyType": "msg",
- "rules": [
- {
- "t": "eq",
- "v": "578",
- "vt": "str"
- }
- ],
- "checkall": "false",
- "repair": false,
- "outputs": 1,
- "x": 350,
- "y": 380,
- "wires": [
- [
- "fcaa8ba78658d16a"
- ]
- ],
- "inputLabels": [
- "JSON"
- ],
- "outputLabels": [
- "JSON"
- ],
- "icon": "node-red/arrow-in.svg"
- },
- {
- "id": "a996d26b53d5092b",
- "type": "debug",
- "z": "0eb14ab90c6fa536",
- "name": "Output API",
- "active": false,
- "tosidebar": true,
- "console": false,
- "tostatus": false,
- "complete": "payload",
- "targetType": "msg",
- "statusVal": "",
- "statusType": "auto",
- "x": 1470,
- "y": 380,
- "wires": []
- },
- {
- "id": "33b7c9c810b6981b",
- "type": "debug",
- "z": "0eb14ab90c6fa536",
- "name": "Switch",
- "active": false,
- "tosidebar": true,
- "console": false,
- "tostatus": false,
- "complete": "payload",
- "targetType": "msg",
- "statusVal": "",
- "statusType": "auto",
- "x": 730,
- "y": 380,
- "wires": []
- },
- {
- "id": "ae4c932504bfc643",
- "type": "debug",
- "z": "0eb14ab90c6fa536",
- "name": "Body",
- "active": false,
- "tosidebar": true,
- "console": false,
- "tostatus": false,
- "complete": "payload.cmd.value",
- "targetType": "msg",
- "statusVal": "",
- "statusType": "auto",
- "x": 1210,
- "y": 440,
- "wires": []
- },
- {
- "id": "e281d7769ee720ad",
- "type": "mqtt in",
- "z": "0eb14ab90c6fa536",
- "name": "",
- "topic": "domoticz/out",
- "qos": "2",
- "datatype": "auto-detect",
- "broker": "877ba76ef9957bec",
- "nl": false,
- "rap": true,
- "rh": 0,
- "inputs": 0,
- "x": 150,
- "y": 600,
- "wires": [
- [
- "35d0860ce18130bb"
- ]
- ]
- },
- {
- "id": "35d0860ce18130bb",
- "type": "switch",
- "z": "0eb14ab90c6fa536",
- "name": "Filtre Device",
- "property": "payload.idx",
- "propertyType": "msg",
- "rules": [
- {
- "t": "eq",
- "v": "579",
- "vt": "str"
- }
- ],
- "checkall": "false",
- "repair": false,
- "outputs": 1,
- "x": 350,
- "y": 600,
- "wires": [
- [
- "44031452620c6b32"
- ]
- ],
- "inputLabels": [
- "JSON"
- ],
- "outputLabels": [
- "JSON"
- ],
- "icon": "node-red/arrow-in.svg"
- },
- {
- "id": "da85d2c285791c26",
- "type": "http request",
- "z": "0eb14ab90c6fa536",
- "name": "Update RGBWW",
- "method": "GET",
- "ret": "obj",
- "paytoqs": "ignore",
- "url": "",
- "tls": "",
- "persist": false,
- "proxy": "",
- "insecureHTTPParser": false,
- "authType": "",
- "senderr": false,
- "headers": [],
- "x": 1130,
- "y": 600,
- "wires": [
- []
- ]
- },
- {
- "id": "2c9a86676fc4d879",
- "type": "function",
- "z": "0eb14ab90c6fa536",
- "name": "Generate URL",
- "func": "msg.url = \"http://your-domoticz/json.htm?type=command¶m=setcolbrightnessvalue&idx=469&color=\" + msg.payload.Color +\" &brightness=\" + msg.payload.Level;\nreturn msg;",
- "outputs": 1,
- "noerr": 0,
- "initialize": "",
- "finalize": "",
- "libs": [],
- "x": 900,
- "y": 600,
- "wires": [
- [
- "da85d2c285791c26"
- ]
- ]
- },
- {
- "id": "44031452620c6b32",
- "type": "json",
- "z": "0eb14ab90c6fa536",
- "name": "Convert Color JSON to String",
- "property": "payload.Color",
- "action": "",
- "pretty": true,
- "x": 610,
- "y": 600,
- "wires": [
- [
- "2c9a86676fc4d879"
- ]
- ]
- },
- {
- "id": "877ba76ef9957bec",
- "type": "mqtt-broker",
- "name": "Mosquito",
- "broker": "your-mqtt",
- "port": "port",
- "clientid": "",
- "autoConnect": true,
- "usetls": false,
- "protocolVersion": "3",
- "keepalive": "60",
- "cleansession": true,
- "birthTopic": "",
- "birthQos": "0",
- "birthPayload": "",
- "birthMsg": {},
- "closeTopic": "",
- "closeQos": "0",
- "closePayload": "",
- "closeMsg": {},
- "willTopic": "",
- "willQos": "0",
- "willPayload": "",
- "willMsg": {},
- "userProps": "",
- "sessionExpiry": ""
- }
- ]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement