iklein99 / homebridge-smartthings

This is a plugin to Homebridge to connect your Smartthings network into Apple Home Kit.
Apache License 2.0
158 stars 53 forks source link

Light switch doesn't show up #70

Closed kliu99 closed 1 year ago

kliu99 commented 1 year ago

I have a light switch: Inovelli Dimmer Red Series LZW31-SN. It doesn't show up in the list of accessaries. (It is in the Smartthings app).

GET https://api.smartthings.com/v1/devices does returned the switch in the response (see below). Briefly looking into the code, the "main" component is a switch, it should get registered.


The abridged API response:

{
    "components": [
        {
            "id": "LEDColorConfiguration",
            "label": "LED Bar",
            "capabilities": [
                {
                    "id": "colorControl",
                    "version": 1
                },
                {
                    "id": "actuator",
                    "version": 1
                }
            ],
            "categories": [
                {
                    "name": "Other",
                    "categoryType": "manufacturer"
                }
            ]
        },
        {
            "id": "button1",
            "label": "Up button",
            "capabilities": [
                {
                    "id": "button",
                    "version": 1
                },
                {
                    "id": "sensor",
                    "version": 1
                },
                {
                    "id": "holdableButton",
                    "version": 1
                }
            ],
            "categories": [
                {
                    "name": "Other",
                    "categoryType": "manufacturer"
                }
            ]
        },
        {
            "id": "button2",
            "label": "Down button",
            "capabilities": [
                {
                    "id": "button",
                    "version": 1
                },
                {
                    "id": "sensor",
                    "version": 1
                },
                {
                    "id": "holdableButton",
                    "version": 1
                }
            ],
            "categories": [
                {
                    "name": "Other",
                    "categoryType": "manufacturer"
                }
            ]
        },
        {
            "id": "button3",
            "label": "Configuration button",
            "capabilities": [
                {
                    "id": "button",
                    "version": 1
                },
                {
                    "id": "sensor",
                    "version": 1
                },
                {
                    "id": "holdableButton",
                    "version": 1
                }
            ],
            "categories": [
                {
                    "name": "Other",
                    "categoryType": "manufacturer"
                }
            ]
        },
        {
            "id": "main",
            "label": "Celling lights",
            "capabilities": [
                {
                    "id": "switch",
                    "version": 1
                },
                {
                    "id": "configuration",
                    "version": 1
                },
                {
                    "id": "switchLevel",
                    "version": 1
                },
                {
                    "id": "refresh",
                    "version": 1
                },
                {
                    "id": "energyMeter",
                    "version": 1
                },
                {
                    "id": "powerMeter",
                    "version": 1
                },
                {
                    "id": "button",
                    "version": 1
                },
                {
                    "id": "sensor",
                    "version": 1
                },
                {
                    "id": "actuator",
                    "version": 1
                },
                {
                    "id": "holdableButton",
                    "version": 1
                }
            ],
            "categories": [
                {
                    "name": "Switch",
                    "categoryType": "manufacturer"
                }
            ]
        }
    ],
}
kliu99 commented 1 year ago

ah, I see, the code is only checking the first component from the device.

iklein99 commented 1 year ago

Right now, only looks at first component. All of the devices that I've come across, until now, have all of their capabilities on the first component. I'll put multi-component devices on the roadmap.

kliu99 commented 1 year ago

I have a fix the light now. I can send a PR for you to take a look at. It might be more complicated than I thought tho.

iklein99 commented 1 year ago

Send it and I’ll have a look.

On Oct 30, 2022, at 6:13 PM, Kai Liu @.***> wrote:

I have a fix the light now. I can send a PR for you to take a look at. It might be more complicated than I thought tho.

— Reply to this email directly, view it on GitHub https://github.com/iklein99/homebridge-smartthings/issues/70#issuecomment-1296362467, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABG55ERM6UJX6XM6CEQUZU3WF3XH5ANCNFSM6AAAAAARSNIQWA. You are receiving this because you commented.

iklein99 commented 1 year ago

I'm reviewing it. I'll let you know.