deconz-community / node-red-contrib-deconz

Node-Red Nodes for deCONZ connectivity.
GNU General Public License v3.0
84 stars 16 forks source link

Commands are not passing output to groups #201

Closed androwis closed 2 years ago

androwis commented 2 years ago

Current Behavior

Configure deconz command for a group of bulbs

Expected Behavior

all bulbs assigned to group respond to command

Steps To Reproduce

create a single node to control a group of lights (not change power status), and pass in data

Example flow

[
    {
        "id":"7755f472c3a920f4",
        "type":"inject",
        "z":"616f24e5.4e6e5c",
        "g":"6fa26029.4e302",
        "name":"Inject : 30 Yellow",
        "props":[
            {
                "p":"payload"
            }
        ],
        "repeat":"",
        "crontab":"",
        "once":false,
        "onceDelay":0.1,
        "topic":"",
        "payload":"{\"On\":true,\"Brightness\":30,\"Hue\":60,\"Saturation\":100}",
        "payloadType":"json",
        "x":935,
        "y":900,
        "wires":[
            [
                "8f5aeaa7edd51ef0"
            ]
        ],
        "info":"// Hue  Lights\n// {\n//      \"On\":false,\n//      \"Brightness\":0,\n//      \"BrightnessChange\":0,\n//      \"ColorTemperature\":2200, \n//      \"Hue\":0,\n//      \"Saturation\":0,\n//      \"ColorLoop\",\n//      ColorLoopSpeed,\n//      CharacteristicValueTransitionControl\n//}\n"
    },
    {
        "id":"d1ce26f45d785107",
        "type":"inject",
        "z":"616f24e5.4e6e5c",
        "g":"6fa26029.4e302",
        "name":"Inject : 1 Yellow",
        "props":[
            {
                "p":"payload"
            }
        ],
        "repeat":"",
        "crontab":"",
        "once":false,
        "onceDelay":0.1,
        "topic":"",
        "payload":"{\"On\":true,\"Brightness\":1,\"Hue\":15300,\"Saturation\":25500}",
        "payloadType":"json",
        "x":950,
        "y":870,
        "wires":[
            [
                "8f5aeaa7edd51ef0"
            ]
        ],
        "info":"// Hue  Lights\n// {\n//      \"On\":false,\n//      \"Brightness\":0,\n//      \"BrightnessChange\":0,\n//      \"ColorTemperature\":2200, \n//      \"Hue\":0,\n//      \"Saturation\":0,\n//      \"ColorLoop\",\n//      ColorLoopSpeed,\n//      CharacteristicValueTransitionControl\n//}\n"
    },
    {
        "id":"46cc8054822e2aba",
        "type":"inject",
        "z":"616f24e5.4e6e5c",
        "g":"6fa26029.4e302",
        "name":"",
        "props":[
            {
                "p":"payload.On",
                "v":"true",
                "vt":"bool"
            }
        ],
        "repeat":"",
        "crontab":"",
        "once":false,
        "onceDelay":0.1,
        "topic":"",
        "x":920,
        "y":840,
        "wires":[
            [
                "8f5aeaa7edd51ef0"
            ]
        ]
    },
    {
        "id":"9e1deb6ca787159d",
        "type":"inject",
        "z":"616f24e5.4e6e5c",
        "g":"6fa26029.4e302",
        "name":"Turn off",
        "props":[
            {
                "p":"payload.On",
                "v":"false",
                "vt":"bool"
            }
        ],
        "repeat":"",
        "crontab":"",
        "once":false,
        "onceDelay":0.1,
        "topic":"",
        "x":920,
        "y":810,
        "wires":[
            [
                "8f5aeaa7edd51ef0"
            ]
        ]
    },
    {
        "id":"8f5aeaa7edd51ef0",
        "type":"deconz-output",
        "z":"616f24e5.4e6e5c",
        "g":"6fa26029.4e302",
        "name":"Change Lights",
        "config_version":2,
        "server":"bf5020a0.12753",
        "statustext":"",
        "statustext_type":"auto",
        "search_type":"device",
        "device_list":[
            "lights/uniqueid/f0:d1:b8:00:00:02:0a:99-01",
            "lights/uniqueid/f0:d1:b8:00:00:02:24:fe-01"
        ],
        "device_name":"",
        "query":"",
        "commands":[
            {
                "arg":{
                    "on":{
                        "type":"keep",
                        "value":""
                    },
                    "alert":{
                        "type":"str",
                        "value":""
                    },
                    "effect":{
                        "type":"str",
                        "value":""
                    },
                    "colorloopspeed":{
                        "type":"num",
                        "value":""
                    },
                    "transitiontime":{
                        "type":"num",
                        "value":""
                    },
                    "retryonerror":{
                        "type":"num",
                        "value":"0"
                    },
                    "aftererror":{
                        "type":"continue",
                        "value":""
                    },
                    "bri":{
                        "direction":"set",
                        "type":"msg",
                        "value":"payload.Brightness"
                    },
                    "sat":{
                        "direction":"set",
                        "type":"msg",
                        "value":"payload.Saturation"
                    },
                    "hue":{
                        "direction":"set",
                        "type":"msg",
                        "value":"payload.Hue"
                    },
                    "ct":{
                        "direction":"set",
                        "type":"num",
                        "value":""
                    },
                    "xy":{
                        "direction":"set",
                        "type":"json",
                        "value":"[]"
                    }
                },
                "type":"deconz_state",
                "domain":"lights",
                "uniqueId":"ui-id-9"
            }
        ],
        "specific":{
            "delay":{
                "type":"num",
                "value":"50"
            },
            "result":{
                "type":"at_end",
                "value":""
            }
        },
        "x":1180,
        "y":870,
        "wires":[
            [
                "ebb0c59073775161"
            ]
        ]
    },
    {
        "id":"ebb0c59073775161",
        "type":"debug",
        "z":"616f24e5.4e6e5c",
        "g":"6fa26029.4e302",
        "name":"",
        "active":true,
        "tosidebar":true,
        "console":true,
        "tostatus":true,
        "complete":"payload",
        "targetType":"msg",
        "statusVal":"payload",
        "statusType":"auto",
        "x":1610,
        "y":870,
        "wires":[

        ]
    },
    {
        "id":"bf5020a0.12753",
        "type":"deconz-server",
        "name":"4711-Zigbee",
        "config_version":1,
        "ip":"192.168.1.59",
        "port":"4530",
        "ws_port":"4531",
        "secure":false,
        "polling":"15"
    }
]

Environment

Zehir commented 2 years ago

What type of light bulb you have in your group ?

Nama commented 2 years ago

I have the same issue. My bulbs are tradfri e14 470lm.

Zehir commented 2 years ago

I have the same issue. My bulbs are tradfri e14 470lm.

Did you use hue and Saturation values too ?

Nama commented 2 years ago

I did now, no reaction but "OK" is displayed in node-red above.

Zehir commented 2 years ago

I did now, no reaction but "OK" is displayed in node-red above.

Tradfri bulb support only xy values

Nama commented 2 years ago

I really don't know what you mean with "xy values", but I just noticed that I need to change the type to "Groups"... Then it works. Color hue and saturation don't have any effect (I have ct bulbs) but Mired color temperature and brightness works.

So everythings fine on my end I guess. I just couldn't figure out the range of Mired color temperature.

Zehir commented 2 years ago

I really don't know what you mean with "xy values", but I just noticed that I need to change the type to "Groups"... Then it works. Color hue and saturation don't have any effect (I have ct bulbs) but Mired color temperature and brightness works.

So everythings fine on my end I guess. I just couldn't figure out the range of Mired color temperature.

You should check this page to undestand what the values are : https://dresden-elektronik.github.io/deconz-rest-doc/endpoints/lights/#set-light-state

Zehir commented 2 years ago

@androwis I don't really undestand the issue, the 2 lights you setup in deconz-output are part of a group ? On the deconz-output node you select 2 lights. You don't get any output from the output node ?

Zehir commented 2 years ago

@Mimiix is there an issue with the websocket ? 3 issues like this in a small delay can't be a conincidence

Mimiix commented 2 years ago

@Zehir ask in the dev chat, I'm not aware of this.

androwis commented 2 years ago

@Zehir I figured out the problem: If Device selection (individual lights selected) then a Command for group is sent, nothing happens. If Device selection (group selected) then a Command for lights is sent, nothing happens.

Everything works if both device + groups are matching. I think if the commands - Types field gets set automatically based on device selection, it may be less confusing.

Otherwise, your plugin works, it just was not intuitive to make the Devices + Commands section match.

Thank you so much!

Zehir commented 2 years ago

Yes I think about that but this could be a breaking change. Maybe I could add a new option "Light/Groups" by default and mark the other as deprecated

Mimiix commented 2 years ago

@Zehir So nothing to report to deconz?

Zehir commented 2 years ago

@Zehir So nothing to report to deconz?

No thanks