Thank you for your kind reply. I added it to my flow. Can you please tell me what should I set in 'change: 2 rules' node to work?
[
{
"id": "bbe25f6c30a03fd9",
"type": "tab",
"label": "Flow 1",
"disabled": false,
"info": "",
"env": []
},
{
"id": "24884f205c0c3a93",
"type": "debug",
"z": "bbe25f6c30a03fd9",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"x": 370,
"y": 780,
"wires": []
},
{
"id": "326d144904ac61c6",
"type": "gree-hvac",
"z": "bbe25f6c30a03fd9",
"name": "AC-Room 1",
"device": "5f3a784cb1f708d7",
"interval": "1",
"debug": false,
"x": 120,
"y": 720,
"wires": [
[
"24884f205c0c3a93",
"ff9fe48d.da79d8"
],
[
"b6ead64c0781a312",
"24884f205c0c3a93",
"ff9fe48d.da79d8"
]
],
"info": "const Gree = require('gree-hvac-client');\r\n\r\nmodule.exports = function (RED) {\r\n function GreeHvacNode(config) {\r\n RED.nodes.createNode(this, config);\r\n const node = this;\r\n const device = RED.nodes.getNode(config.device);\r\n\r\n node.status({});\r\n\r\n const pollingInterval = config.interval * 1000;\r\n let client = new Gree.Client({\r\n host: device.host,\r\n pollingInterval: pollingInterval,\r\n pollingTimeout: pollingInterval / 2,\r\n debug: config.debug\r\n });\r\n\r\n const statusConnected = () => {\r\n node.status({fill: 'green', shape: 'dot', text: 'connected to ' + client.getDeviceId()})\r\n };\r\n\r\n const statusConnecting = () => node.status({fill: 'yellow', shape: 'dot', text: 'connecting...'});\r\n const statusNoResponse = () => node.status({fill: 'yellow', shape: 'dot', text: 'no response...'});\r\n\r\n statusConnecting();\r\n\r\n client.on('connect', statusConnected);\r\n client.on('update', (updatedProperties, properties) => {\r\n statusConnected();\r\n node.send([{\r\n topic: 'updated',\r\n payload: updatedProperties\r\n }, {\r\n topic: 'properties',\r\n payload: properties\r\n }]);\r\n });\r\n client.on('success', (updatedProperties, properties) => {\r\n node.send([{\r\n topic: 'acknowledged',\r\n payload: updatedProperties\r\n }, {\r\n topic: 'properties',\r\n payload: properties\r\n }]);\r\n });\r\n client.on('disconnect', statusConnecting);\r\n client.on('no_response', statusNoResponse);\r\n\r\n this.on('input', function (msg) {\r\n if (typeof msg.payload === \"object\")\r\n client.setProperties(msg.payload);\r\n else\r\n client.setProperty(msg.topic, msg.payload);\r\n });\r\n\r\n this.on('close', function () {\r\n client.disconnect();\r\n client = null;\r\n });\r\n }\r\n\r\n RED.nodes.registerType('gree-hvac', GreeHvacNode);\r\n};"
},
{
"id": "133e10690ead3817",
"type": "switch",
"z": "bbe25f6c30a03fd9",
"name": "",
"property": "topic",
"propertyType": "msg",
"rules": [
{
"t": "eq",
"v": "power",
"vt": "str"
},
{
"t": "eq",
"v": "mode",
"vt": "str"
},
{
"t": "eq",
"v": "temperature",
"vt": "str"
},
{
"t": "eq",
"v": "fanSpeed",
"vt": "str"
},
{
"t": "eq",
"v": "swingVert",
"vt": "str"
},
{
"t": "eq",
"v": "swingHor",
"vt": "str"
},
{
"t": "eq",
"v": "health",
"vt": "str"
},
{
"t": "eq",
"v": "blow",
"vt": "str"
},
{
"t": "eq",
"v": "lights",
"vt": "str"
},
{
"t": "eq",
"v": "powerSave",
"vt": "str"
}
],
"checkall": "true",
"repair": false,
"outputs": 10,
"x": 250,
"y": 540,
"wires": [
[
"ba2cc26ca2fd1c6d"
],
[
"0beddd3a437faba9"
],
[
"4e88ee55c88cd61d"
],
[
"e50fac7c6a4ea1b2"
],
[
"6065dbd722624d50"
],
[
"3c6239d25c49110c"
],
[
"3fd3ce02605045d5"
],
[
"0f358cf0de52707a"
],
[
"ba3309b31e941c6a"
],
[
"109eaa55ee8f836f"
]
]
},
{
"id": "17bf672b1819b85a",
"type": "rbe",
"z": "bbe25f6c30a03fd9",
"name": "",
"func": "rbe",
"gap": "",
"start": "",
"inout": "out",
"septopics": true,
"property": "payload",
"topi": "topic",
"x": 690,
"y": 780,
"wires": [
[
"326d144904ac61c6",
"24884f205c0c3a93"
]
]
},
{
"id": "b6ead64c0781a312",
"type": "split",
"z": "bbe25f6c30a03fd9",
"name": "",
"splt": "\\n",
"spltType": "str",
"arraySplt": 1,
"arraySpltType": "len",
"stream": false,
"addname": "topic",
"x": 110,
"y": 540,
"wires": [
[
"133e10690ead3817"
]
]
},
{
"id": "6065dbd722624d50",
"type": "ui_dropdown",
"z": "bbe25f6c30a03fd9",
"name": "",
"label": "Vertical swing ",
"tooltip": "",
"place": "Select option",
"group": "5c569ec8.d608f",
"order": 6,
"width": 0,
"height": 0,
"passthru": false,
"multiple": false,
"options": [
{
"label": "Default",
"value": "default",
"type": "str"
},
{
"label": "Swing in full range",
"value": "full",
"type": "str"
},
{
"label": "Fixed top",
"value": "fixedTop",
"type": "str"
},
{
"label": "Fixed mid-top",
"value": "fixedMidTop",
"type": "str"
},
{
"label": "Fixed mid",
"value": "fixedMid",
"type": "str"
},
{
"label": "Fixed mid-bottom",
"value": "fixedMidBottom",
"type": "str"
},
{
"label": "Fixed bottom",
"value": "fixedBottom",
"type": "str"
},
{
"label": "Swing bottom",
"value": "swingBottom",
"type": "str"
},
{
"label": "Swing mid-bottom",
"value": "swingMidBottom",
"type": "str"
},
{
"label": "Swing mid",
"value": "swingMid",
"type": "str"
},
{
"label": "Swing mid top",
"value": "swingMidTop",
"type": "str"
},
{
"label": "Swing top",
"value": "swingTop",
"type": "str"
}
],
"payload": "",
"topic": "swingVert",
"topicType": "str",
"className": "",
"x": 480,
"y": 360,
"wires": [
[
"17bf672b1819b85a"
]
]
},
{
"id": "3c6239d25c49110c",
"type": "ui_dropdown",
"z": "bbe25f6c30a03fd9",
"name": "",
"label": "Horizontal swing ",
"tooltip": "",
"place": "Select option",
"group": "5c569ec8.d608f",
"order": 5,
"width": 0,
"height": 0,
"passthru": false,
"multiple": false,
"options": [
{
"label": "Default",
"value": "default",
"type": "str"
},
{
"label": "Full",
"value": "full",
"type": "str"
},
{
"label": "Fixed left",
"value": "fixedLeft",
"type": "str"
},
{
"label": "Fixed mid-left",
"value": "fixedMidLeft",
"type": "str"
},
{
"label": "Fixed mid",
"value": "fixedMid",
"type": "str"
},
{
"label": "Fixed mid-right",
"value": "fixedMidRight",
"type": "str"
},
{
"label": "Fixed right",
"value": "fixedRight",
"type": "str"
},
{
"label": "Full alt",
"value": "fullAlt",
"type": "str"
}
],
"payload": "",
"topic": "swingHor",
"topicType": "str",
"className": "",
"x": 480,
"y": 420,
"wires": [
[
"17bf672b1819b85a"
]
],
"info": "Controls the swing mode of the horizontal air blades (not available on all units)"
},
{
"id": "e50fac7c6a4ea1b2",
"type": "ui_dropdown",
"z": "bbe25f6c30a03fd9",
"name": "",
"label": "Fan speed",
"tooltip": "",
"place": "Select option",
"group": "5c569ec8.d608f",
"order": 4,
"width": 0,
"height": 0,
"passthru": false,
"multiple": false,
"options": [
{
"label": "Auto",
"value": "auto",
"type": "str"
},
{
"label": "Low",
"value": "low",
"type": "str"
},
{
"label": "Medium low",
"value": "mediumLow",
"type": "str"
},
{
"label": "Medium",
"value": "medium",
"type": "str"
},
{
"label": "Medium high",
"value": "mediumHigh",
"type": "str"
},
{
"label": "High",
"value": "high",
"type": "str"
}
],
"payload": "",
"topic": "fanSpeed",
"topicType": "str",
"className": "",
"x": 470,
"y": 300,
"wires": [
[
"17bf672b1819b85a"
]
]
},
{
"id": "0beddd3a437faba9",
"type": "ui_dropdown",
"z": "bbe25f6c30a03fd9",
"name": "",
"label": "Mode",
"tooltip": "",
"place": "Select option",
"group": "5c569ec8.d608f",
"order": 3,
"width": "0",
"height": "0",
"passthru": false,
"multiple": false,
"options": [
{
"label": "Auto",
"value": "auto",
"type": "str"
},
{
"label": "Cool",
"value": "cool",
"type": "str"
},
{
"label": "Dry",
"value": "dry",
"type": "str"
},
{
"label": "Fan only",
"value": "fan_only",
"type": "str"
},
{
"label": "Heat",
"value": "heat",
"type": "str"
}
],
"payload": "",
"topic": "mode",
"topicType": "str",
"className": "",
"x": 470,
"y": 140,
"wires": [
[
"17bf672b1819b85a"
]
]
},
{
"id": "ba2cc26ca2fd1c6d",
"type": "ui_switch",
"z": "bbe25f6c30a03fd9",
"name": "",
"label": "Power",
"tooltip": "",
"group": "5c569ec8.d608f",
"order": 1,
"width": "0",
"height": "0",
"passthru": false,
"decouple": "true",
"topic": "power",
"topicType": "str",
"style": "",
"onvalue": "on",
"onvalueType": "str",
"onicon": "",
"oncolor": "",
"offvalue": "off",
"offvalueType": "str",
"officon": "",
"offcolor": "",
"animate": true,
"className": "",
"x": 470,
"y": 60,
"wires": [
[
"17bf672b1819b85a"
]
]
},
{
"id": "ba3309b31e941c6a",
"type": "ui_switch",
"z": "bbe25f6c30a03fd9",
"name": "",
"label": "Lights",
"tooltip": "",
"group": "5c569ec8.d608f",
"order": 9,
"width": "3",
"height": "1",
"passthru": false,
"decouple": "true",
"topic": "lights",
"topicType": "str",
"style": "",
"onvalue": "on",
"onvalueType": "str",
"onicon": "",
"oncolor": "",
"offvalue": "off",
"offvalueType": "str",
"officon": "",
"offcolor": "",
"animate": true,
"className": "",
"x": 450,
"y": 600,
"wires": [
[
"17bf672b1819b85a"
]
]
},
{
"id": "109eaa55ee8f836f",
"type": "ui_switch",
"z": "bbe25f6c30a03fd9",
"name": "",
"label": "Power save",
"tooltip": "",
"group": "5c569ec8.d608f",
"order": 10,
"width": "3",
"height": "1",
"passthru": false,
"decouple": "true",
"topic": "powerSave",
"topicType": "str",
"style": "",
"onvalue": "on",
"onvalueType": "str",
"onicon": "",
"oncolor": "",
"offvalue": "off",
"offvalueType": "str",
"officon": "",
"offcolor": "",
"animate": true,
"className": "",
"x": 470,
"y": 660,
"wires": [
[
"17bf672b1819b85a"
]
]
},
{
"id": "3fd3ce02605045d5",
"type": "ui_switch",
"z": "bbe25f6c30a03fd9",
"name": "",
"label": "Cold plasma",
"tooltip": "",
"group": "5c569ec8.d608f",
"order": 7,
"width": "3",
"height": "1",
"passthru": false,
"decouple": "true",
"topic": "health",
"topicType": "str",
"style": "",
"onvalue": "on",
"onvalueType": "str",
"onicon": "",
"oncolor": "",
"offvalue": "off",
"offvalueType": "str",
"officon": "",
"offcolor": "",
"animate": true,
"className": "",
"x": 470,
"y": 480,
"wires": [
[
"17bf672b1819b85a"
]
]
},
{
"id": "0f358cf0de52707a",
"type": "ui_switch",
"z": "bbe25f6c30a03fd9",
"name": "",
"label": "X-Fan",
"tooltip": "",
"group": "5c569ec8.d608f",
"order": 8,
"width": "3",
"height": "1",
"passthru": false,
"decouple": "true",
"topic": "blow",
"topicType": "str",
"style": "",
"onvalue": "on",
"onvalueType": "str",
"onicon": "",
"oncolor": "",
"offvalue": "off",
"offvalueType": "str",
"officon": "",
"offcolor": "",
"animate": true,
"className": "",
"x": 450,
"y": 540,
"wires": [
[
"17bf672b1819b85a"
]
]
},
{
"id": "4e88ee55c88cd61d",
"type": "ui_numeric",
"z": "bbe25f6c30a03fd9",
"name": "",
"label": "Temperature",
"tooltip": "",
"group": "5c569ec8.d608f",
"order": 2,
"width": 0,
"height": 0,
"wrap": false,
"passthru": false,
"topic": "temperature",
"topicType": "str",
"format": "{{value}}",
"min": "23",
"max": "25",
"step": 1,
"className": "",
"x": 470,
"y": 220,
"wires": [
[
"17bf672b1819b85a"
]
]
},
{
"id": "da9088eb34879f12",
"type": "pythonshell in",
"z": "bbe25f6c30a03fd9",
"name": "",
"pyfile": "/home/pi3/ac.py",
"virtualenv": "",
"continuous": true,
"stdInData": false,
"x": 140,
"y": 100,
"wires": [
[
"7f4ec3a4a8fbe0f1"
]
]
},
{
"id": "7f4ec3a4a8fbe0f1",
"type": "debug",
"z": "bbe25f6c30a03fd9",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 210,
"y": 180,
"wires": []
},
{
"id": "a93031d5.229bd",
"type": "inject",
"z": "bbe25f6c30a03fd9",
"name": "icoming temp 20",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "20",
"payloadType": "num",
"x": 1080,
"y": 800,
"wires": [
[
"86de0040.7aa1b8"
]
]
},
{
"id": "86de0040.7aa1b8",
"type": "change",
"z": "bbe25f6c30a03fd9",
"name": "",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "$$.payload > 20 ? true : false",
"tot": "jsonata"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 1290,
"y": 940,
"wires": [
[
"57faa569.13cb54"
]
]
},
{
"id": "6d9e5c7e.97992c",
"type": "inject",
"z": "bbe25f6c30a03fd9",
"name": "icoming temp 23",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "23",
"payloadType": "num",
"x": 1060,
"y": 880,
"wires": [
[
"86de0040.7aa1b8"
]
]
},
{
"id": "57faa569.13cb54",
"type": "rbe",
"z": "bbe25f6c30a03fd9",
"name": "",
"func": "rbe",
"gap": "",
"start": "",
"inout": "out",
"septopics": true,
"property": "payload",
"topi": "topic",
"x": 1460,
"y": 940,
"wires": [
[
"7b71bb84.abaa6c"
]
]
},
{
"id": "7b71bb84.abaa6c",
"type": "switch",
"z": "bbe25f6c30a03fd9",
"name": "",
"property": "payload",
"propertyType": "msg",
"rules": [
{
"t": "true"
},
{
"t": "else"
}
],
"checkall": "true",
"repair": false,
"outputs": 2,
"x": 1590,
"y": 940,
"wires": [
[
"bcc7dd76.044438"
],
[
"12117786.ca41"
]
]
},
{
"id": "bcc7dd76.044438",
"type": "change",
"z": "bbe25f6c30a03fd9",
"name": "",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "[{\"topic\":\"power\",\"payload\":\"on\"},{\"topic\":\"mode\",\"payload\":\"cool\"}]",
"tot": "json"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 1800,
"y": 860,
"wires": [
[
"819430c5.e750b8"
]
]
},
{
"id": "12117786.ca41",
"type": "change",
"z": "bbe25f6c30a03fd9",
"name": "",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "[{\"topic\":\"power\",\"payload\":\"off\"}]",
"tot": "json"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 1800,
"y": 920,
"wires": [
[
"819430c5.e750b8"
]
]
},
{
"id": "819430c5.e750b8",
"type": "split",
"z": "bbe25f6c30a03fd9",
"name": "",
"splt": "\\n",
"spltType": "str",
"arraySplt": 1,
"arraySpltType": "len",
"stream": false,
"addname": "",
"x": 2030,
"y": 920,
"wires": [
[
"ab350f7.e2d1ef"
]
]
},
{
"id": "ab350f7.e2d1ef",
"type": "delay",
"z": "bbe25f6c30a03fd9",
"name": "",
"pauseType": "rate",
"timeout": "5",
"timeoutUnits": "seconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": false,
"allowrate": false,
"outputs": 1,
"x": 1330,
"y": 1040,
"wires": [
[
"aca8adbd.f5ad88"
]
]
},
{
"id": "aca8adbd.f5ad88",
"type": "change",
"z": "bbe25f6c30a03fd9",
"name": "",
"rules": [
{
"t": "set",
"p": "payload.payload",
"pt": "msg",
"to": "[{\"topic\":\"power\",\"payload\":\"on\"},{\"topic\":\"mode\",\"payload\":\"cool\"}]",
"tot": "json"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 1550,
"y": 1060,
"wires": [
[
"1f05afa6.0975c"
]
]
},
{
"id": "1f05afa6.0975c",
"type": "rbe",
"z": "bbe25f6c30a03fd9",
"name": "",
"func": "rbe",
"gap": "",
"start": "",
"inout": "out",
"property": "payload",
"x": 1030,
"y": 1180,
"wires": [
[
"326d144904ac61c6"
]
]
},
{
"id": "dfacc4d8.727be8",
"type": "inject",
"z": "bbe25f6c30a03fd9",
"name": "set temp to 20",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "temperature",
"payload": "20",
"payloadType": "num",
"x": 1030,
"y": 960,
"wires": [
[
"1f05afa6.0975c"
]
]
},
{
"id": "ff9fe48d.da79d8",
"type": "debug",
"z": "bbe25f6c30a03fd9",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"x": 1510,
"y": 1220,
"wires": []
},
{
"id": "5f3a784cb1f708d7",
"type": "gree-hvac-config",
"name": "AC",
"host": "192.168.189.44",
"info": "module.exports = function (RED) {\r\n function GreeHvacConfigNode(config) {\r\n RED.nodes.createNode(this, config);\r\n\r\n this.host = config.host;\r\n }\r\n\r\n RED.nodes.registerType(\"gree-hvac-config\", GreeHvacConfigNode, {});\r\n};"
},
{
"id": "5c569ec8.d608f",
"type": "ui_group",
"name": "AC",
"tab": "168c092a.469d97",
"order": 1,
"disp": true,
"width": "6",
"collapse": false
},
{
"id": "168c092a.469d97",
"type": "ui_tab",
"name": "Home",
"icon": "dashboard",
"disabled": false,
"hidden": false
}
]