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

Groups are not available anymore since update 2.7.1 #178

Closed Spampunk closed 4 years ago

Spampunk commented 4 years ago

Describe the bug I cannot trigger groups anymore. E.g. a toggle command results with Error: Philips Hue: 3, resource, /groups/192, not available

The light nodes however still work as before.

Flow to Reproduce

[
    {
        "id": "b98f04a8.011838",
        "type": "tab",
        "label": "Test",
        "disabled": false,
        "info": ""
    },
    {
        "id": "c03c5f03.c0fce",
        "type": "ccu-value",
        "z": "b98f04a8.011838",
        "name": "1 kurz",
        "iface": "HmIP-RF",
        "channel": "000198A9913C72:2 Taster Arbeitszimmer:2",
        "datapoint": "PRESS_SHORT",
        "mode": "",
        "start": true,
        "change": true,
        "cache": false,
        "queue": false,
        "on": 0,
        "onType": "undefined",
        "ramp": 0,
        "rampType": "undefined",
        "working": false,
        "ccuConfig": "ee924885.ee4ac8",
        "topic": "${CCU}/${Interface}/${channel}/${datapoint}",
        "x": 150,
        "y": 120,
        "wires": [
            [
                "1d1af0ca.36140f"
            ]
        ]
    },
    {
        "id": "1d1af0ca.36140f",
        "type": "function",
        "z": "b98f04a8.011838",
        "name": "Licht an/aus",
        "func": "msg.payload.toggle = true\n\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 1350,
        "y": 120,
        "wires": [
            [
                "101c4c2a.c95794"
            ]
        ]
    },
    {
        "id": "335bc3dd.c6a93c",
        "type": "ccu-value",
        "z": "b98f04a8.011838",
        "name": "2 kurz",
        "iface": "HmIP-RF",
        "channel": "000198A9913C72:1 Taster Arbeitszimmer:1",
        "datapoint": "PRESS_SHORT",
        "mode": "",
        "start": true,
        "change": false,
        "cache": false,
        "queue": true,
        "on": 0,
        "onType": "undefined",
        "ramp": 0,
        "rampType": "undefined",
        "working": false,
        "ccuConfig": "ee924885.ee4ac8",
        "topic": "${CCU}/${Interface}/${channel}/${datapoint}",
        "x": 150,
        "y": 181,
        "wires": [
            [
                "788dd8e2.b5a0c8"
            ]
        ]
    },
    {
        "id": "b1ad8740.279878",
        "type": "ccu-value",
        "z": "b98f04a8.011838",
        "name": "1 lang",
        "iface": "HmIP-RF",
        "channel": "000198A9913C72:2 Taster Arbeitszimmer:2",
        "datapoint": "PRESS_LONG",
        "mode": "",
        "start": true,
        "change": true,
        "cache": false,
        "queue": false,
        "on": 0,
        "onType": "undefined",
        "ramp": 0,
        "rampType": "undefined",
        "working": false,
        "ccuConfig": "ee924885.ee4ac8",
        "topic": "${CCU}/${Interface}/${channel}/${datapoint}",
        "x": 150,
        "y": 240,
        "wires": [
            [
                "b30fccfb.a08ef"
            ]
        ]
    },
    {
        "id": "606cb9c5.d50c28",
        "type": "function",
        "z": "b98f04a8.011838",
        "name": "Helligkeit +",
        "func": "var trigger = flow.get('T01_1l');\n\nif (trigger == 1) {\n    var br = msg.payload.brightness;\n\n    if (br == 100) {\n        msg = null;\n    } else if (br >= 92) {\n        br = 100;\n        msg.payload = {\n            \"brightness\": br\n        };\n    } else {\n       msg.payload = {\n            \"incrementBrightness\": 10\n        };\n    }\n    flow.set('T01_1l', 0);\n    return msg;\n}",
        "outputs": 1,
        "noerr": 0,
        "x": 1350,
        "y": 240,
        "wires": [
            [
                "101c4c2a.c95794"
            ]
        ]
    },
    {
        "id": "bc9b9eda.f8f61",
        "type": "ccu-value",
        "z": "b98f04a8.011838",
        "name": "2 lang",
        "iface": "HmIP-RF",
        "channel": "000198A9913C72:1 Taster Arbeitszimmer:1",
        "datapoint": "PRESS_LONG",
        "mode": "",
        "start": true,
        "change": true,
        "cache": false,
        "queue": false,
        "on": 0,
        "onType": "undefined",
        "ramp": 0,
        "rampType": "undefined",
        "working": false,
        "ccuConfig": "ee924885.ee4ac8",
        "topic": "${CCU}/${Interface}/${channel}/${datapoint}",
        "x": 150,
        "y": 300,
        "wires": [
            [
                "ba9507ae.8715d8"
            ]
        ]
    },
    {
        "id": "a0431cf9.c8684",
        "type": "function",
        "z": "b98f04a8.011838",
        "name": "Helligkeit -",
        "func": "var trigger = flow.get('T01_2l');\n\nif (trigger == 1) {\n    var br = msg.payload.brightness;\n\n    if (br == 1) {\n        msg = null;\n    } else if (br <= 6) {\n        br = 1;\n        msg.payload = {\n            \"brightness\": br\n        };\n    } else {\n       msg.payload = {\n            \"decrementBrightness\": 10\n        };\n    }\n    flow.set('T01_2l', 0);\n    return msg;\n}",
        "outputs": 1,
        "noerr": 0,
        "x": 1350,
        "y": 300,
        "wires": [
            [
                "101c4c2a.c95794"
            ]
        ]
    },
    {
        "id": "a4b3eb71.321a38",
        "type": "function",
        "z": "b98f04a8.011838",
        "name": "Lichtfarbe",
        "func": "var trigger = flow.get('T01_2k');\n\nif (trigger == 1) {\n    var ct = msg.payload;\n\n    if (ct.colorTemp > 480) {\n        msg.payload = {\n            \"colorTemp\": 153\n        };\n    } else {\n        msg.payload = {\n            \"incrementColorTemp\": 60\n        };\n    }\n    flow.set('T01_2k', 0)\n    return msg;\n}",
        "outputs": 1,
        "noerr": 0,
        "x": 1340,
        "y": 181,
        "wires": [
            [
                "101c4c2a.c95794"
            ]
        ]
    },
    {
        "id": "101c4c2a.c95794",
        "type": "hue-group",
        "z": "b98f04a8.011838",
        "name": "Arbeitszimmer",
        "bridge": "1132a929.428347",
        "groupid": "3",
        "colornamer": true,
        "skipevents": false,
        "x": 1720,
        "y": 221,
        "wires": [
            []
        ]
    },
    {
        "id": "b30fccfb.a08ef",
        "type": "function",
        "z": "b98f04a8.011838",
        "name": "Trigger",
        "func": "flow.set('T01_1l',1);\nmsg.payload = {\n            \"status\": true\n        };\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 480,
        "y": 240,
        "wires": [
            [
                "b0bed0e5.9c1ea"
            ]
        ]
    },
    {
        "id": "ba9507ae.8715d8",
        "type": "function",
        "z": "b98f04a8.011838",
        "name": "Trigger",
        "func": "flow.set('T01_2l',1);\nmsg.payload = {\n            \"status\": true\n        };\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 480,
        "y": 300,
        "wires": [
            [
                "b0bed0e5.9c1ea"
            ]
        ]
    },
    {
        "id": "788dd8e2.b5a0c8",
        "type": "function",
        "z": "b98f04a8.011838",
        "name": "Trigger",
        "func": "flow.set('T01_2k',1);\nmsg.payload = {\n            \"status\": true\n        };\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 480,
        "y": 180,
        "wires": [
            [
                "b0bed0e5.9c1ea"
            ]
        ]
    },
    {
        "id": "b0bed0e5.9c1ea",
        "type": "hue-group",
        "z": "b98f04a8.011838",
        "name": "Arbeitszimmer",
        "bridge": "1132a929.428347",
        "groupid": "3",
        "colornamer": true,
        "skipevents": false,
        "x": 820,
        "y": 240,
        "wires": [
            [
                "a4b3eb71.321a38",
                "606cb9c5.d50c28",
                "a0431cf9.c8684"
            ]
        ]
    },
    {
        "id": "ee924885.ee4ac8",
        "type": "ccu-connection",
        "z": "",
        "name": "CCU3",
        "host": "192.168.37.2",
        "regaEnabled": true,
        "bcrfEnabled": true,
        "iprfEnabled": true,
        "virtEnabled": true,
        "bcwiEnabled": false,
        "cuxdEnabled": true,
        "regaPoll": true,
        "regaInterval": "30",
        "rpcPingTimeout": "60",
        "rpcInitAddress": "192.168.37.1",
        "rpcServerHost": "0.0.0.0",
        "rpcBinPort": "2069",
        "rpcXmlPort": "2070",
        "queueTimeout": "5000",
        "queuePause": "250",
        "contextStore": ""
    },
    {
        "id": "1132a929.428347",
        "type": "hue-bridge",
        "z": "",
        "name": "Hue Bridge",
        "bridge": "192.168.37.3",
        "key": "something here",
        "interval": "3000",
        "disableupdates": false
    }
]

Expected behavior The groups should be able to be triggered again like in former versions < v. 2.7.1

Please complete the following information:

FreeTimeCoder82 commented 4 years ago

Hi, I have the same problem. And if I try to switch a group, some other lights will turn on. Yesterday evening after the update, I tried to switch on a group of lights in the living room, the lights in the bedroom turned on. Unfortunately my wife was still in bed. :-(

stieler-it commented 4 years ago

Same here, messages to groups seem to control other lights after the update.

Phalynx commented 4 years ago

Same here, controlling lights on groups are affecting all lights.

Edit: Reverted back to working v2.7.0

aav7fl commented 4 years ago

It might be related to this change? https://github.com/Foddy/node-red-contrib-huemagic/commit/77db69fd0df47dde049af475cf27e25a5ba23a58#diff-06dfc8188f358fc40c7a56cb8874e79bR86-R87

Foddy commented 4 years ago

Sorry. This was a pretty weird error… However, the problem no longer seems to occur with the latest version (2.7.2)

aav7fl commented 4 years ago

Thanks for the quick fix!

jnbht commented 4 years ago

Wow! That's a awesome quick response-time! Enjoy your coffee/beer/kebap/whatever. You`ve earned it!! Thanks!

hurenkam commented 2 years ago

I'm up to date with huemagic 4.2.2, however still see this problem on one of my bridges. The second bridge is reporting groups just fine. Can this issue be re-opened? Or do i need to submit a new issue for this?