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

msg.payload=toggle doesn´t toggle lights #255

Closed max-stockhausen closed 2 years ago

max-stockhausen commented 2 years ago

Describe the bug msg.payload = toggle doesn´t toggle any lights or groups. The type of "toggle" was string.

Flow to Reproduce

[{"id":"e545fa18.1c042","type":"hue-light","z":"249157be.b497d","name":"Außenlampe","bridge":"ee846f71.e72e78","lightid":"16","colornamer":true,"skipevents":false,"universalevents":false,"x":510,"y":2820,"wires":[["e621d63a.5c14f"]]},{"id":"4362f65c.d66208","type":"change","z":"249157be.b497d","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"toggle","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":490,"y":2700,"wires":[["e545fa18.1c042"]]},{"id":"ee846f71.e72e78","type":"hue-bridge","name":"hue-bridge","bridge":"192.168.1.8","key":"G9sLljK-WSaGcYoD8ZSgSj3fAABjRd2aPYSYDKJD","interval":"3000"}]

Expected behavior I expect any lights that are off to turn on and lights that are already turned on to turn off

Please complete the following information:

Foddy commented 2 years ago

Fixed in v4

djiwondee commented 12 months ago

Hello @Foddy tooglestill seems not to work. Neither with the example above nor with my flow

[
    {
        "id": "f5f439bdc11e1edf",
        "type": "inject",
        "z": "40a49702e079d21e",
        "name": "Toogle",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "{\"toogle\":true}",
        "payloadType": "json",
        "x": 330,
        "y": 2420,
        "wires": [
            [
                "98c787b84aa3d6f4"
            ]
        ]
    },
    {
        "id": "4362f65c.d66208",
        "type": "change",
        "z": "40a49702e079d21e",
        "name": "",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "toggle",
                "tot": "str"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 560,
        "y": 2320,
        "wires": [
            [
                "98c787b84aa3d6f4"
            ]
        ]
    },
    {
        "id": "7c1a857f46a57470",
        "type": "inject",
        "z": "40a49702e079d21e",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "x": 320,
        "y": 2320,
        "wires": [
            [
                "4362f65c.d66208"
            ]
        ]
    },
    {
        "id": "98c787b84aa3d6f4",
        "type": "hue-light",
        "z": "40a49702e079d21e",
        "name": "Deckenlampe 1",
        "bridge": "a74cfa2982ec8420",
        "lightid": "a99fd550-71d3-4fac-aa08-676a3a9942a3",
        "colornamer": true,
        "skipevents": false,
        "initevents": false,
        "x": 780,
        "y": 2420,
        "wires": [
            []
        ]
    },
    {
        "id": "36f54dbd4bfa03fc",
        "type": "inject",
        "z": "40a49702e079d21e",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": "11",
        "topic": "",
        "payload": "true",
        "payloadType": "bool",
        "x": 330,
        "y": 2520,
        "wires": [
            [
                "98c787b84aa3d6f4"
            ]
        ]
    },
    {
        "id": "e3f35755949f6677",
        "type": "inject",
        "z": "40a49702e079d21e",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": "11",
        "topic": "",
        "payload": "false",
        "payloadType": "bool",
        "x": 330,
        "y": 2480,
        "wires": [
            [
                "98c787b84aa3d6f4"
            ]
        ]
    },
    {
        "id": "a74cfa2982ec8420",
        "type": "hue-bridge",
        "name": "Philips hue II",
        "bridge": "IP-OF-THE-BRIDGE",
        "key": "ENTER-KEY-HERE",
        "worker": "10",
        "disableupdates": false
    }
]