How to control existing "node-red-contrib-gree-hvac"

Hello,
I want to control the gree ac using node red. I downloaded "node-red-contrib-gree-hvac" but the flow look like this


Can you kindly help me how can I configure this?
I am attaching the flow:

[{"id":"ff9fe48d.da79d8","type":"debug","z":"fcc6883.6f01278","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":550,"y":700,"wires":[]},{"id":"3cfb9d5c.2adfc2","type":"gree-hvac","z":"fcc6883.6f01278","name":"AC","device":"","interval":"1","x":280,"y":640,"wires":[["ff9fe48d.da79d8"],["417b67b1.9d77d8","ff9fe48d.da79d8"]]},{"id":"fab8d073.bed76","type":"switch","z":"fcc6883.6f01278","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":430,"y":460,"wires":[["f36ddc6a.6a76d"],["ed7a4d0b.d3c85"],["7f2711eb.f70ff"],["b0f5ed20.f0dc4"],["bb2fd30d.6faed"],["426d8937.d2e9a8"],["58310de9.08b1c4"],["5be9ffdd.e9e11"],["429db373.92628c"],["29e1bfb7.c963c"]]},{"id":"f36ddc6a.6a76d","type":"ui_switch","z":"fcc6883.6f01278","name":"","label":"Power","tooltip":"","group":"5c569ec8.d608f","order":1,"width":"0","height":"0","passthru":false,"decouple":"true","topic":"power","style":"","onvalue":"on","onvalueType":"str","onicon":"","oncolor":"","offvalue":"off","offvalueType":"str","officon":"","offcolor":"","x":610,"y":80,"wires":[["62c89d4e.1db264"]]},{"id":"429db373.92628c","type":"ui_switch","z":"fcc6883.6f01278","name":"","label":"Lights","tooltip":"","group":"5c569ec8.d608f","order":9,"width":"3","height":"1","passthru":false,"decouple":"true","topic":"lights","style":"","onvalue":"on","onvalueType":"str","onicon":"","oncolor":"","offvalue":"off","offvalueType":"str","officon":"","offcolor":"","x":610,"y":560,"wires":[["62c89d4e.1db264"]]},{"id":"7f2711eb.f70ff","type":"ui_numeric","z":"fcc6883.6f01278","name":"","label":"Temperature","tooltip":"","group":"5c569ec8.d608f","order":2,"width":0,"height":0,"passthru":false,"topic":"temperature","format":"{{value}}","min":"23","max":"25","step":1,"x":630,"y":200,"wires":[["62c89d4e.1db264"]]},{"id":"bb2fd30d.6faed","type":"ui_dropdown","z":"fcc6883.6f01278","name":"","label":"Vertical swing ","tooltip":"","place":"Select option","group":"5c569ec8.d608f","order":6,"width":0,"height":0,"passthru":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","x":640,"y":320,"wires":[["62c89d4e.1db264"]]},{"id":"62c89d4e.1db264","type":"rbe","z":"fcc6883.6f01278","name":"","func":"rbe","gap":"","start":"","inout":"out","property":"payload","x":830,"y":700,"wires":[["3cfb9d5c.2adfc2","ff9fe48d.da79d8"]]},{"id":"426d8937.d2e9a8","type":"ui_dropdown","z":"fcc6883.6f01278","name":"","label":"Horizontal swing ","tooltip":"","place":"Select option","group":"5c569ec8.d608f","order":5,"width":0,"height":0,"passthru":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","x":640,"y":380,"wires":[["62c89d4e.1db264"]],"info":"Controls the swing mode of the horizontal air blades (not available on all units)"},{"id":"b0f5ed20.f0dc4","type":"ui_dropdown","z":"fcc6883.6f01278","name":"","label":"Fan speed","tooltip":"","place":"Select option","group":"5c569ec8.d608f","order":4,"width":0,"height":0,"passthru":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","x":630,"y":260,"wires":[["62c89d4e.1db264"]]},{"id":"29e1bfb7.c963c","type":"ui_switch","z":"fcc6883.6f01278","name":"","label":"Power save","tooltip":"","group":"5c569ec8.d608f","order":10,"width":"3","height":"1","passthru":false,"decouple":"true","topic":"powerSave","style":"","onvalue":"on","onvalueType":"str","onicon":"","oncolor":"","offvalue":"off","offvalueType":"str","officon":"","offcolor":"","x":630,"y":620,"wires":[["62c89d4e.1db264"]]},{"id":"417b67b1.9d77d8","type":"split","z":"fcc6883.6f01278","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"topic","x":290,"y":460,"wires":[["fab8d073.bed76"]]},{"id":"ed7a4d0b.d3c85","type":"ui_dropdown","z":"fcc6883.6f01278","name":"","label":"Mode","tooltip":"","place":"Select option","group":"5c569ec8.d608f","order":3,"width":"0","height":"0","passthru":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","x":610,"y":140,"wires":[["62c89d4e.1db264"]]},{"id":"58310de9.08b1c4","type":"ui_switch","z":"fcc6883.6f01278","name":"","label":"Cold plasma","tooltip":"","group":"5c569ec8.d608f","order":7,"width":"3","height":"1","passthru":false,"decouple":"true","topic":"health","style":"","onvalue":"on","onvalueType":"str","onicon":"","oncolor":"","offvalue":"off","offvalueType":"str","officon":"","offcolor":"","x":630,"y":440,"wires":[["62c89d4e.1db264"]]},{"id":"5be9ffdd.e9e11","type":"ui_switch","z":"fcc6883.6f01278","name":"","label":"X-Fan","tooltip":"","group":"5c569ec8.d608f","order":8,"width":"3","height":"1","passthru":false,"decouple":"true","topic":"blow","style":"","onvalue":"on","onvalueType":"str","onicon":"","oncolor":"","offvalue":"off","offvalueType":"str","officon":"","offcolor":"","x":610,"y":500,"wires":[["62c89d4e.1db264"]]},{"id":"5c569ec8.d608f","type":"ui_group","z":"","name":"AC","tab":"168c092a.469d97","disp":true,"width":"6","collapse":false},{"id":"168c092a.469d97","type":"ui_tab","z":"","name":"Home","icon":"dashboard","disabled":false,"hidden":false}]

gree-hvac link on github:

(https://github.com/inwaar/node-red-contrib-gree-hvac/tree/master/gree-hvac)

That flow has the ui-dashboard node, you will need to install it. node-red-dashboard (node) - Node-RED

Thank you :). It worked! I have another question,
I have a separate temperature sensor and based on the sensor data I want to change the ac temperature and also turn off and on the ac. How can I integrate that into this flow? Any suggestion would be really appreciated. Thank you :slight_smile:

Not having a Hvac so untested.

send
{"topic":"power", "payload":"on"}
to turn on
{"topic":"power", "payload":"off"}
to turn off
{"topic":"mode", "payload":"cool"}
to change to cooling mode
{"topic":"temperature", "payload":20}
to set temp to 20

Thank you for your reply. Where should I modify to send {"topic":"power", "payload":"on"}?

You would need to build your own flow.

here is an example.

[{"id":"a93031d5.229bd","type":"inject","z":"bf9e1e33.030598","name":"icoming temp 20","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"20","payloadType":"num","x":190,"y":4320,"wires":[["86de0040.7aa1b8"]]},{"id":"86de0040.7aa1b8","type":"change","z":"bf9e1e33.030598","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"$$.payload > 20 ? true : false","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":420,"y":4340,"wires":[["57faa569.13cb54"]]},{"id":"6d9e5c7e.97992c","type":"inject","z":"bf9e1e33.030598","name":"icoming temp 23","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"23","payloadType":"num","x":180,"y":4360,"wires":[["86de0040.7aa1b8"]]},{"id":"57faa569.13cb54","type":"rbe","z":"bf9e1e33.030598","name":"","func":"rbe","gap":"","start":"","inout":"out","septopics":true,"property":"payload","x":590,"y":4340,"wires":[["7b71bb84.abaa6c"]]},{"id":"7b71bb84.abaa6c","type":"switch","z":"bf9e1e33.030598","name":"","property":"payload","propertyType":"msg","rules":[{"t":"true"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":720,"y":4340,"wires":[["bcc7dd76.044438"],["12117786.ca41"]]},{"id":"bcc7dd76.044438","type":"change","z":"bf9e1e33.030598","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":900,"y":4320,"wires":[["819430c5.e750b8"]]},{"id":"12117786.ca41","type":"change","z":"bf9e1e33.030598","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"[{\"topic\":\"power\",\"payload\":\"off\"}]","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":900,"y":4380,"wires":[["819430c5.e750b8"]]},{"id":"819430c5.e750b8","type":"split","z":"bf9e1e33.030598","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":1090,"y":4360,"wires":[["ab350f7.e2d1ef"]]},{"id":"ab350f7.e2d1ef","type":"delay","z":"bf9e1e33.030598","name":"","pauseType":"rate","timeout":"5","timeoutUnits":"seconds","rate":"5","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":450,"y":4400,"wires":[["aca8adbd.f5ad88"]]},{"id":"aca8adbd.f5ad88","type":"change","z":"bf9e1e33.030598","name":"","rules":[{"t":"move","p":"payload.topic","pt":"msg","to":"topic","tot":"msg"},{"t":"move","p":"payload.payload","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":630,"y":4400,"wires":[["1f05afa6.0975c"]]},{"id":"1f05afa6.0975c","type":"rbe","z":"bf9e1e33.030598","name":"","func":"rbe","gap":"","start":"","inout":"out","property":"payload","x":510,"y":4460,"wires":[["9bcf0e21.4098e8"]]},{"id":"dfacc4d8.727be8","type":"inject","z":"bf9e1e33.030598","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":190,"y":4420,"wires":[["1f05afa6.0975c"]]},{"id":"9bcf0e21.4098e8","type":"gree-hvac","z":"bf9e1e33.030598","name":"AC","device":"","interval":"1","x":140,"y":4500,"wires":[["ff9fe48d.da79d8"],["ff9fe48d.da79d8"]]},{"id":"ff9fe48d.da79d8","type":"debug","z":"bf9e1e33.030598","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":550,"y":4560,"wires":[]}]

Àgain untest as i do not have the Hvac node installed

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
    }
]

Not sure i understand correctly, do you mead this

[{"id":"3ffd10d4.2c72e","type":"inject","z":"4cf77323.9d057c","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":[["964ed2f1.de5ea"]]},{"id":"964ed2f1.de5ea","type":"change","z":"4cf77323.9d057c","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":[["ae493733.60a228"]]},{"id":"be626130.9193e","type":"inject","z":"4cf77323.9d057c","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":[["964ed2f1.de5ea"]]},{"id":"ae493733.60a228","type":"rbe","z":"4cf77323.9d057c","name":"","func":"rbe","gap":"","start":"","inout":"out","septopics":true,"property":"payload","x":1460,"y":940,"wires":[["f7a24855.5f4638"]]},{"id":"f7a24855.5f4638","type":"switch","z":"4cf77323.9d057c","name":"","property":"payload","propertyType":"msg","rules":[{"t":"true"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":1590,"y":940,"wires":[["be7e4810.2bfc9"],["1ecbd676.f59daa"]]},{"id":"be7e4810.2bfc9","type":"change","z":"4cf77323.9d057c","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":880,"wires":[["571634fc.7c8d6c"]]},{"id":"1ecbd676.f59daa","type":"change","z":"4cf77323.9d057c","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"[{\"topic\":\"power\",\"payload\":\"off\"}]","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":1800,"y":940,"wires":[["571634fc.7c8d6c"]]},{"id":"571634fc.7c8d6c","type":"split","z":"4cf77323.9d057c","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":2030,"y":920,"wires":[["7a51bf9e.f6e89"]]},{"id":"7a51bf9e.f6e89","type":"delay","z":"4cf77323.9d057c","name":"","pauseType":"rate","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":1330,"y":1040,"wires":[["9e869b06.842e"]]},{"id":"9e869b06.842e","type":"change","z":"4cf77323.9d057c","name":"","rules":[{"t":"move","p":"payload.topic","pt":"msg","to":"topic","tot":"msg"},{"t":"move","p":"payload.payload","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1550,"y":1040,"wires":[["2c3b0e88.2a2322"]]},{"id":"2c3b0e88.2a2322","type":"rbe","z":"4cf77323.9d057c","name":"","func":"rbe","gap":"","start":"","inout":"out","septopics":true,"property":"payload","x":690,"y":780,"wires":[["f851fab2.13bbb8","9cbc53c6.d11a8"]]},{"id":"13d9fd04.9edcfb","type":"ui_dropdown","z":"4cf77323.9d057c","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":[["2c3b0e88.2a2322"]]},{"id":"650f28b9.3b3da","type":"ui_dropdown","z":"4cf77323.9d057c","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":[["2c3b0e88.2a2322"]],"info":"Controls the swing mode of the horizontal air blades (not available on all units)"},{"id":"d15b380f.8841f","type":"ui_dropdown","z":"4cf77323.9d057c","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":[["2c3b0e88.2a2322"]]},{"id":"d0cdca21.3616f8","type":"ui_dropdown","z":"4cf77323.9d057c","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":[["2c3b0e88.2a2322"]]},{"id":"f8d1cc6f.f9ae","type":"ui_switch","z":"4cf77323.9d057c","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":[["2c3b0e88.2a2322"]]},{"id":"19ce18da.a501af","type":"ui_switch","z":"4cf77323.9d057c","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":[["2c3b0e88.2a2322"]]},{"id":"594afff6.353b68","type":"ui_switch","z":"4cf77323.9d057c","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":[["2c3b0e88.2a2322"]]},{"id":"c43ac98f.3f3268","type":"ui_switch","z":"4cf77323.9d057c","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":[["2c3b0e88.2a2322"]]},{"id":"68d8bbc5.1afbcc","type":"ui_switch","z":"4cf77323.9d057c","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":[["2c3b0e88.2a2322"]]},{"id":"6caded4a.73e46c","type":"ui_numeric","z":"4cf77323.9d057c","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":[["2c3b0e88.2a2322"]]},{"id":"f7c89e4b.c73f98","type":"inject","z":"4cf77323.9d057c","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":[["2c3b0e88.2a2322"]]},{"id":"f851fab2.13bbb8","type":"gree-hvac","z":"4cf77323.9d057c","name":"AC-Room 1","device":"5f3a784cb1f708d7","interval":"1","debug":false,"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};","x":120,"y":720,"wires":[["9cbc53c6.d11a8","e4840606.3faf"],["7b0cc638.6487b8","9cbc53c6.d11a8","e4840606.3faf"]]},{"id":"9cbc53c6.d11a8","type":"debug","z":"4cf77323.9d057c","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":370,"y":780,"wires":[]},{"id":"7e55579f.b035c","type":"switch","z":"4cf77323.9d057c","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":[["f8d1cc6f.f9ae"],["d0cdca21.3616f8"],["6caded4a.73e46c"],["d15b380f.8841f"],["13d9fd04.9edcfb"],["650f28b9.3b3da"],["c43ac98f.3f3268"],["68d8bbc5.1afbcc"],["19ce18da.a501af"],["594afff6.353b68"]]},{"id":"e4840606.3faf","type":"debug","z":"4cf77323.9d057c","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":1510,"y":1220,"wires":[]},{"id":"7b0cc638.6487b8","type":"split","z":"4cf77323.9d057c","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"topic","x":110,"y":540,"wires":[["7e55579f.b035c"]]},{"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}]

It worked! Thank a lot :slight_smile:

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.