Foddy / node-red-contrib-huemagic

Philips Hue node to control bridges, lights, groups, motion sensors, temperature sensors and Lux sensors using Node-RED.
https://flows.nodered.org/node/node-red-contrib-huemagic
Apache License 2.0
201 stars 67 forks source link

Universal mode of group node not working #305

Open aL1aL7 opened 2 years ago

aL1aL7 commented 2 years ago

Describe the bug There are 2 issues with universal mode: a) sending group ID (ID for API version 2) as msg.topic and msg.payload = true || false to group node in universal mode works at the first shot - doing it again results in an error of the group node "No group ID defined" Sending the message a third time to the group node --> group node is working as expected Sending the message a fourth time to the group node --> group node is not working

b) Group node in universal mode doesn't create any output messages - according to the docs, the group nodes should create output messages for every status messages of the same type

Flow to Reproduce

[
    {
        "id": "71643ee79f0c90ad",
        "type": "tab",
        "label": "Hue-Test",
        "disabled": false,
        "info": "",
        "env": []
    },
    {
        "id": "f075c6e7150bb7d9",
        "type": "hue-group",
        "z": "71643ee79f0c90ad",
        "name": "UNIVERSAL GROUP MODE",
        "bridge": "dea3c250.dbc968",
        "groupid": "",
        "skipevents": false,
        "initevents": false,
        "x": 710,
        "y": 80,
        "wires": [
            [
                "7577787d699f731e"
            ]
        ]
    },
    {
        "id": "db2fb2b06cdf9f40",
        "type": "function",
        "z": "71643ee79f0c90ad",
        "name": "ON FNC",
        "func": "msg.topic = \"e5c8e65b-c669-4035-847a-450c199f3302\";\nmsg.payload = true;\n\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 360,
        "y": 60,
        "wires": [
            [
                "f075c6e7150bb7d9"
            ]
        ]
    },
    {
        "id": "e82159ecdb57d0e4",
        "type": "function",
        "z": "71643ee79f0c90ad",
        "name": "OFF FNC",
        "func": "msg.topic = \"e5c8e65b-c669-4035-847a-450c199f3302\";\nmsg.payload= false;\n\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 360,
        "y": 120,
        "wires": [
            [
                "f075c6e7150bb7d9"
            ]
        ]
    },
    {
        "id": "a02c18a193fdb95b",
        "type": "inject",
        "z": "71643ee79f0c90ad",
        "name": "INJECT-BUTTON",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "x": 160,
        "y": 60,
        "wires": [
            [
                "db2fb2b06cdf9f40"
            ]
        ]
    },
    {
        "id": "8475d7a8a44de8a5",
        "type": "inject",
        "z": "71643ee79f0c90ad",
        "name": "INJECT BUTTON",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "x": 160,
        "y": 120,
        "wires": [
            [
                "e82159ecdb57d0e4"
            ]
        ]
    },
    {
        "id": "7577787d699f731e",
        "type": "debug",
        "z": "71643ee79f0c90ad",
        "name": "FULL MESSAGE",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "true",
        "targetType": "full",
        "statusVal": "",
        "statusType": "auto",
        "x": 1030,
        "y": 80,
        "wires": []
    },
    {
        "id": "dea3c250.dbc968",
        "type": "hue-bridge",
        "name": "hue-bridge01",
        "bridge": "192.168.2.49",
        "key": "B6iyXcKu22q346FYBKn38kvN2Knh8GIXR9OW8zyf",
        "worker": "10",
        "disableupdates": false
    }
]

Expected behavior a) every message with ID as string at msg.topic should work in universal group mode b) group node receives and outputs all status messages of the same type in universal mode

Screenshots If applicable, add screenshots to help explain your problem. Screenshot_20220129_143536

Please complete the following information:

Additional context Add any other context about the problem here.

MBombeck commented 2 years ago

Can confirm the bug - same behavior here.

ralfhille commented 2 years ago

I can also confirm this.

ralfhille commented 2 years ago

same with light in universal modus

jacobdeane commented 2 years ago

I can also confirm the bug - similar behaviour. Sometimes group node doesn't work for a number of inputs. Sometimes it seems to work every other input. I also see "No group ID defined" error messages.

mkatanski commented 2 years ago

I also confirm this bug