iRayanKhan / homebridge-tuya

A Homebridge plugin to control Tuya devices locally.
MIT License
400 stars 165 forks source link

2 gang dimmer switch only one working. #292

Open jellevanderhave opened 3 years ago

jellevanderhave commented 3 years ago

The bug I have a Tuya 2 gang dimmer switch. In the Tuya app both lights can be independently controlled. In the Homebridge-Tuya plugin there is no out of the box support for a 2 gang dimmer switch but I have managed to get one of the lights working using the TWLight accessory. I set up another TWLight using the same id and key and used different dp values to control the other light. However this did not result in being able to control the light. It seems that the light that appears first in the configuration is the one that is controllable, the other light does not show up in HomeKit, I tested this by switching the ordering.

{
        "name": "Dimmer Light One",
        "type": "TWLight",
        "id": "xx",
        "key": "xx",
        "dpPower": 7,
        "dpBrightness": 8,
        "dpColorTemperature": 12,
        "scaleBrightness": 1000
    },
    {
        "name": "Dimmer Light Two",
        "type": "TWLight",
        "id": "xx",
        "key": "xx",
        "dpPower": 1,
        "dpBrightness": 2,
        "dpColorTemperature": 6,
        "scaleBrightness": 1000
    }

Expected behavior I expected two seperate controllable lights to appear in the accessories tab and in HomeKit. This is suggested from similar issues raised in the past. See #4 and #6

Environment (please complete the following information):

albilia commented 3 years ago

@iRayanKhan @jellevanderhave I have something similar to your description. Currently can control the Gangs only in the following configuration.

I have a Tuya smart light switch with two gang that connected to two different lamps. One lamp without dimming option, second lamp with dimming option. I am interested in controlling through the plugin each of the ports/gang's according to the installed lamps. The only configuration I was able to get it to work at the ON / OFF level only looks like that:

{

        "name": "Saloon + Mirror",

        "type": "CustomMultiOutlet",

        "manufacturer": "GeekBee",

        "model": "Tuch Switch",

        "id": "xxxxxxxxxxxxxx",

        "key": "xxxxxxxxxxxxx",

        "outlets": [

            {

                "name": "Outlet 1",

                "dp": 1

            },

            {

                "name": "Outlet 2",

                "dp": 2

            }

        ]

    }

I want one port to control the lamp without dimming [ON / OFF only], and the other port to be with programming for dimmer control [Slider].

yellowsnowagency commented 2 years ago

Anyone got an update on this?

2 way dimmer switch with Tuya and Homebridge did anyone made a config or a workaround? that would be great

VannaDii commented 2 years ago

I keep meaning to, I Need one that works. I used to have one working but something changed at some point when the repo was transitioned, and it hasn’t worked since. If you figure it out, please make a PR to add it to the docs.

techno-beast commented 2 years ago

Anyone got an update on this?

2 way dimmer switch with Tuya and Homebridge did anyone made a config or a workaround? that would be great

I got round this by adding a second bridge in HOOBS, then add the plugin again. Create a second cloud project on Tuya and add the device with parameters:

{
    "type": "SimpleDimmer",
    "name": "Side Lights",
    "id": "xxxxx",
    "key": "xxxxxx",
    "manufacturer": "xxxxxxx",
    "model": "DualDimmer-2",
    "dpPower": 7,
    "dpBrightness": 8
}

This will then allow you to add the second gang as a new device.