AMoo-Miki / homebridge-tuya-lan

Homebridge plugin for IoT devices that use Tuya Smart's platform
MIT License
200 stars 51 forks source link

Ceiling Lamp and RGB LED Strip aren't responding #109

Open Sisimoski opened 4 years ago

Sisimoski commented 4 years ago

Hi! I recently bought cheap smart things from LSC Smart Connect brand in Action (it's a Dutch shop) and I saw that I can make them connect to HomeKit by setting Homebridge with plugins. I'm trying to connect Smart Ceiling Light and Smart RGB LED Strip with Homebridge via this plugin. I have LSC Smart Connect app (which is Tuya-powered app) and Tuya app on my iPhone. I paired these things with Tuya app, since there is more probability to work with Tuya than LSC. I configured config.json and it these Light and Strip showed in my Home app on iPhone but plugin said that failed to discover ... in time but will keep looking. In Common Problems page I found that I need to add ip to my config, so I did that, but since then it says: Failed to discover ... in time but will connect via the IP that I written and then immediately connects and closes connection.

I can't make them to connect properly, nothing in Home app works really. Tuya app works with no problems, turns on and off my devices.

Here's my config.json:

{
    "bridge": {
      "name": "Homebridge",
      "username": "CC:22:3D:E3:CE:31",
      "port": 51826,
      "pin": "031-45-154"
    },

    "description": "This is an example configuration file with one fake accessory and one fake platform. You can use this as a template for creating your own configuration file containing devices you actually own.",
    "ports": {
      "start": 52100,
      "end": 52150,
      "comment": "This section is used to control the range of ports that separate accessory (like camera or television) should be bind to."
    },
    "accessories": [

    ],
    "platforms": [{
        "platform": "TuyaLan",
        "devices": [
            {
                "name": "Ceiling Lamp",
                "type": "TWLight",
                "manufacturer": "LSC Smart Connect",
                "model": "Smart Ceiling Lamp",
                "id": "bf66388420daa5e8dapgth",
                "key": "fe670efd2f7fec7c",
                "ip": "xxx.xxx.xx.xx"
            },
            {
                "name": "LED Strip",
                "type": "RGBTWLight",
                "manufacturer": "LSC Smart Connect",
                "model": "Smart RGB LED strip",
                "id": "35163674ecfabc47fbf3",
                "key": "03e1514e75ca36ae",
                "ip": "xxx.xxx.xx.xx"
            }
        ]
    }]
  }

I pasted IP - if it is necessary, I can send it to you.

Here's schema:

Intercepted config from Tuya

Found 2 devices:
[
  {
    name: 'Smart RGB LED strip',
    id: '35163674ecfabc47fbf3',
    key: '03e1514e75ca36ae',
    def: {
      schema: '[{"mode":"rw","code":"switch_led","name":"\\u5f00\\u5173","property":{"type":"bool"},"id":20,"type":"obj","desc":""},{"mode":"rw","code":"work_mode","name":"\\u6a21\\u5f0f","property":{"range":["white","colour","scene","music"],"type":"enum"},"id":21,"type":"obj","desc":""},{"mode":"rw","code":"bright_value","name":"\\u4eae\\u5ea6\\u503c","property":{"unit":"","min":10,"max":1000,"scale":0,"step":1,"type":"value"},"id":22,"type":"obj","desc":""},{"mode":"rw","code":"colour_data","name":"\\u5f69\\u5149","property":{"type":"string","maxlen":255},"id":24,"type":"obj","desc":""},{"mode":"rw","code":"scene_data","name":"\\u573a\\u666f","property":{"type":"string","maxlen":255},"id":25,"type":"obj","desc":""},{"mode":"rw","code":"countdown","name":"\\u5012\\u8ba1\\u65f6\\u5269\\u4f59\\u65f6\\u95f4","property":{"unit":"","min":0,"max":86400,"scale":0,"step":1,"type":"value"},"id":26,"type":"obj","desc":""},{"mode":"wr","code":"control_data","name":"\\u8c03\\u8282","property":{"type":"string","maxlen":255},"id":28,"type":"obj","desc":""}]',
      extras: '[{"id":20,"inputStyle":"","inputType":""},{"id":21,"inputStyle":"","inputType":""},{"id":22,"inputStyle":"","inputType":""},{"id":26,"inputStyle":"","inputType":""}]',
    },
  },
  {
    name: 'Smart Ceiling Lamp',
    id: 'bf66388420daa5e8dapgth',
    key: 'fe670efd2f7fec7c',
    def: {
      schema: '[{"mode":"rw","code":"switch_led","name":"\\u5f00\\u5173","property":{"type":"bool"},"id":20,"type":"obj","desc":""},{"mode":"rw","code":"work_mode","name":"\\u6a21\\u5f0f","property":{"range":["white","colour","scene","music"],"type":"enum"},"id":21,"type":"obj","desc":""},{"mode":"rw","code":"bright_value","name":"\\u4eae\\u5ea6\\u503c","property":{"unit":"","min":10,"max":1000,"scale":0,"step":1,"type":"value"},"id":22,"type":"obj","desc":""},{"mode":"rw","code":"temp_value","name":"\\u51b7\\u6696\\u503c","property":{"unit":"","min":0,"max":1000,"scale":0,"step":1,"type":"value"},"id":23,"type":"obj","desc":""},{"mode":"rw","code":"scene_data","name":"\\u573a\\u666f","property":{"type":"string","maxlen":255},"id":25,"type":"obj","desc":""},{"mode":"rw","code":"countdown","name":"\\u5012\\u8ba1\\u65f6\\u5269\\u4f59\\u65f6\\u95f4","property":{"unit":"","min":0,"max":86400,"scale":0,"step":1,"type":"value"},"id":26,"type":"obj","desc":""},{"mode":"wr","code":"control_data","name":"\\u8c03\\u8282","property":{"type":"string","maxlen":255},"id":28,"type":"obj","desc":""},{"mode":"rw","code":"remote_switch","name":"\\u5f00\\u5173","property":{"type":"bool"},"id":101,"type":"obj","desc":"\\u7528\\u5728\\u63a7\\u5236wifi\\u9065\\u63a7\\u5668"}]',
      extras: '[{"id":20,"inputStyle":"","inputType":""},{"id":21,"inputStyle":"","inputType":""},{"id":22,"inputStyle":"","inputType":"percent1"},{"id":23,"inputStyle":"","inputType":"percent"},{"id":26,"inputStyle":"","inputType":""}]',
    },
  },
]

Here's recent Homebridge log I guess:

[sisimoski@MacBook-Pro-Marcin ~ % homebridge
[2019-10-25 13:10:41] Loaded config.json with 0 accessories and 1 platforms.
[2019-10-25 13:10:41] ---
[2019-10-25 13:10:42] Loaded plugin: homebridge-tuya-lan
[2019-10-25 13:10:42] Registering platform 'homebridge-tuya-lan.TuyaLan'
[2019-10-25 13:10:42] ---
[2019-10-25 13:10:42] Loaded plugin: homebridge-tuya-smartlamp
[2019-10-25 13:10:42] Registering accessory 'homebridge-tuya-smartdevice.TuyaSmartDevice'
[2019-10-25 13:10:42] ---
[2019-10-25 13:10:43] Loaded plugin: homebridge-tuya-web
[2019-10-25 13:10:43] Registering platform 'homebridge-tuya-web.TuyaWebPlatform'
[2019-10-25 13:10:43] ---
[2019-10-25 13:10:43] Loading 1 platforms...
[2019-10-25 13:10:43] [TuyaLan] Initializing TuyaLan platform...
[2019-10-25 13:10:43] Loading 0 accessories...
Load homebridge-tuya-web.TuyaWebPlatform
[2019-10-25 13:10:43] [homebridge-tuya-web.TuyaWebPlatform] No config found, disabling plugin.
[2019-10-25 13:10:43] [TuyaLan] Marked Pasek LED unreachable by faulting Service.Pasek LED.On
[2019-10-25 13:10:43] [TuyaLan] Marked Lampa sufitowa unreachable by faulting Service.Lampa sufitowa.On
Setup Payload:
X-HM://0023ISYWY14P8
Scan this code with your HomeKit app on your iOS device to pair with Homebridge:

Or enter this code with your HomeKit app on your iOS device to pair with Homebridge:

    ┌────────────┐     
    │ 031-45-154 │     
    └────────────┘     

[2019-10-25 13:10:43] [TuyaLan] Starting discovery...
[2019-10-25 13:10:43] Homebridge is running on port 51826.
[TuyaAccessory] Discovery started.
[2019-10-25 13:11:43] [TuyaLan] Failed to discover Lampa sufitowa (bf66388420daa5e8dapgth) in time but will connect via 192.168.0.21.
[2019-10-25 13:11:43] [TuyaLan] Failed to discover Pasek LED (35163674ecfabc47fbf3) in time but will connect via 192.168.0.13.
[2019-10-25 13:11:43] [TuyaLan] Connected to Lampa sufitowa
[2019-10-25 13:11:43] [TuyaLan] Connected to Pasek LED
[TuyaAccessory] Socket had a problem and will reconnect to Pasek LED (Error: ERR_PING_TIMED_OUT)
[TuyaAccessory] Closed connection with Pasek LED
[TuyaAccessory] Socket had a problem and will reconnect to Pasek LED (Error: ERR_PING_TIMED_OUT)
[TuyaAccessory] Closed connection with Pasek LED
[TuyaAccessory] Socket had a problem and will reconnect to Pasek LED (Error: ERR_PING_TIMED_OUT)
[TuyaAccessory] Closed connection with Pasek LED
[TuyaAccessory] Socket had a problem and will reconnect to Pasek LED (Error: ERR_PING_TIMED_OUT)
[TuyaAccessory] Closed connection with Pasek LED
[TuyaAccessory] Socket had a problem and will reconnect to Pasek LED (Error: ERR_PING_TIMED_OUT)
[TuyaAccessory] Closed connection with Pasek LED
[TuyaAccessory] Socket had a problem and will reconnect to Pasek LED (Error: ERR_PING_TIMED_OUT)
[TuyaAccessory] Closed connection with Pasek LED
[TuyaAccessory] Socket had a problem and will reconnect to Pasek LED (Error: ERR_PING_TIMED_OUT)
[TuyaAccessory] Closed connection with Pasek LED
[TuyaAccessory] Socket had a problem and will reconnect to Pasek LED (Error: ERR_PING_TIMED_OUT)
[TuyaAccessory] Closed connection with Pasek LED
[TuyaAccessory] Socket had a problem and will reconnect to Pasek LED (Error: ERR_PING_TIMED_OUT)
[TuyaAccessory] Closed connection with Pasek LED
[TuyaAccessory] Socket had a problem and will reconnect to Pasek LED (Error: ERR_PING_TIMED_OUT)
[TuyaAccessory] Closed connection with Pasek LED
^C[2019-10-25 13:17:38] Got SIGINT, shutting down Homebridge...
sisimoski@MacBook-Pro-Marcin ~ % 

Here's screen from Home app: image

I would be very grateful if you can help me with connecting these devices with Homebridge.

ibitas commented 4 years ago

I'm interested in that device-support too. I have a bunch of these LS- Devices, only the bulbs work partly.

Smart Ceiling Light throws that message. (3.3) didn't respond with its current state.

I could also post the schema of the bulbs and Ceiling Light, but i Think, that the ceiling light schema would be the same.

Support for this devices wourd be great!

Config: { "bridge": { "name": "Homebridge", "username": "CC:22:3D:E3:CE:30", "port": 51826, "pin": "###-##-###" }, "description": "Home Smart Home", "platforms": [ { "name": "Config", "port": 8081, "auth": "form", "theme": "red", "restart": "sudo -n systemctl restart homebridge", "temp": "/sys/class/thermal/thermal_zone0/temp", "tempUnits": "c", "sudo": true, "log": { "method": "custom", "command": "journalctl -o cat -n 500 -f -u homebridge" }, "platform": "config" }, { "platform": "TuyaLan", "devices": [ { "name": "test1", "type": "SimpleLight", "manufacturer": "Iotton", "model": "Smart White Bulb", "id": "###########", "key": "###########", "ip": "###.###.###.##" } ] }, { "name": "Alexa", "username": "#####", "password": "#####", "pin": "###-##-###", "routines": true, "platform": "Alexa" } ], "accessories": [ { "accessory": "RaspberryPi", "name": "Raspberry Pi", "interval": 60 }, { "accessory": "FakeBulb", "name": "-Wohnungstür", "bulb_name": "-wohnungstuer" }, { "accessory": "FakeBulb", "name": "-Küchentür", "bulb_name": "-kuechentuer" }, { "accessory": "FakeBulb", "name": "-Küchenschiebetür", "bulb_name": "-kuechenschiebetuer" } ] }

Log: `[10/28/2019, 2:51:03 PM] Loaded config.json with 4 accessories and 3 platforms. [10/28/2019, 2:51:03 PM] --- [10/28/2019, 2:51:12 PM] Loaded plugin: homebridge-alexa [10/28/2019, 2:51:12 PM] Registering platform 'homebridge-alexa.Alexa' [10/28/2019, 2:51:12 PM] --- [10/28/2019, 2:51:12 PM] Loaded plugin: homebridge-config-ui-x [10/28/2019, 2:51:12 PM] Registering platform 'homebridge-config-ui-x.config' [10/28/2019, 2:51:12 PM] --- [10/28/2019, 2:51:13 PM] Loaded plugin: homebridge-fakebulb [10/28/2019, 2:51:13 PM] Registering accessory 'homebridge-fakebulb.FakeBulb' [10/28/2019, 2:51:13 PM] --- [10/28/2019, 2:51:24 PM] Loaded plugin: homebridge-raspberrypi [10/28/2019, 2:51:24 PM] Registering accessory 'homebridge-raspberrypi.RaspberryPi' [10/28/2019, 2:51:24 PM] --- [10/28/2019, 2:51:24 PM] Loaded plugin: homebridge-tuya-lan [10/28/2019, 2:51:24 PM] Registering platform 'homebridge-tuya-lan.TuyaLan' [10/28/2019, 2:51:24 PM] --- [10/28/2019, 2:51:26 PM] Loaded plugin: homebridge-tuya-web [10/28/2019, 2:51:26 PM] Registering platform 'homebridge-tuya-web.TuyaWebPlatform' [10/28/2019, 2:51:26 PM] --- [10/28/2019, 2:51:26 PM] Loading 3 platforms... [10/28/2019, 2:51:26 PM] [Config] Initializing config platform... [10/28/2019, 2:51:26 PM] [Config] Spawning homebridge-config-ui-x with PID 11948 [10/28/2019, 2:51:26 PM] [TuyaLan] Initializing TuyaLan platform... [10/28/2019, 2:51:26 PM] [Alexa] Initializing Alexa platform... [10/28/2019, 2:51:26 PM] [Alexa] homebridge-alexa v0.4.39, node v10.16.3, homebridge v0.4.50 [10/28/2019, 2:51:26 PM] Loading 4 accessories... [10/28/2019, 2:51:26 PM] [Raspberry Pi] Initializing RaspberryPi accessory... [10/28/2019, 2:51:27 PM] [Raspberry Pi] Raspberry Pi temperature is: 47.1 C [10/28/2019, 2:51:27 PM] [Raspberry Pi] Raspberry Pi voltage is: 1.35 V [10/28/2019, 2:51:27 PM] [-Wohnungstür] Initializing FakeBulb accessory... [10/28/2019, 2:51:27 PM] [-Wohnungstür] Starting a fake bulb device with name '-wohnungstuer'... [10/28/2019, 2:51:27 PM] [-Küchentür] Initializing FakeBulb accessory... [10/28/2019, 2:51:27 PM] [-Küchentür] Starting a fake bulb device with name '-kuechentuer'... [10/28/2019, 2:51:27 PM] [-Küchenschiebetür] Initializing FakeBulb accessory... [10/28/2019, 2:51:27 PM] [-Küchenschiebetür] Starting a fake bulb device with name '-kuechenschiebetuer'... Load homebridge-tuya-web.TuyaWebPlatform [10/28/2019, 2:51:27 PM] [homebridge-tuya-web.TuyaWebPlatform] No config found, disabling plugin. [10/28/2019, 2:51:27 PM] [TuyaLan] Marked TEST unreachable by faulting Service.test1.On Setup Payload: X-HM://0023ISYWYFF9J Scan this code with your HomeKit app on your iOS device to pair with Homebridge:
Or enter this code with your HomeKit app on your iOS device to pair with Homebridge:

┌────────────┐
│ ###-##-###│
└────────────┘

[10/28/2019, 2:51:28 PM] [TuyaLan] Starting discovery... [10/28/2019, 2:51:30 PM] Homebridge is running on port 51826. [TuyaDiscovery] Discovery started on port 6666. [TuyaDiscovery] Discovery started on port 6667. [10/28/2019, 2:51:30 PM] [TuyaLan] Unregistering test [10/28/2019, 2:51:30 PM] [TuyaLan] Unregistering test2 [10/28/2019, 2:51:31 PM] [TuyaLan] Discovered a device that has not been configured yet (########@###.###.###.##). [10/28/2019, 2:51:32 PM] [TuyaLan] Discovered test1 (#########) identified as SimpleLight (3.3) [TuyaAccessory] Changing ping gap for test1 to 9s [10/28/2019, 2:51:33 PM] [TuyaLan] Discovered a device that has not been configured yet (########@###.###.###.##). [10/28/2019, 2:51:33 PM] [TuyaLan] Discovered a device that has not been configured yet (########@###.###.###.##). [10/28/2019, 2:51:33 PM] [TuyaLan] Connected to test1 [TuyaAccessory] Sending first query to test1 (3.3) [TuyaAccessory] test1 (3.3) didn't respond with its current state. [10/28/2019, 2:51:33 PM] [TuyaLan] Ready to handle test1 (SimpleLight:3.3) with signature {} [10/28/2019, 2:51:33 PM] [TuyaLan] Discovered a device that has not been configured yet (########@###.###.###.##). [10/28/2019, 2:51:34 PM] [TuyaLan] Discovered a device that has not been configured yet (########@###.###.###.##). [10/28/2019, 2:51:34 PM] [TuyaLan] Discovered a device that has not been configured yet (########@###.###.###.##). [10/28/2019, 2:51:49 PM] [Alexa] alexaDiscovery - returned 5 devices [10/28/2019, 2:51:51 PM] [Config] Homebridge Config UI X v4.6.2 is listening on :: port 8081`

ibitas commented 4 years ago

My Smart Ceiling Light is now working with following Config:

{ "name": "Badezimmer Licht", "type": "TWLight", "manufacturer": "Iotton", "model": "Smart White Bulb", "id": "###########", "key": "###########", "ip": "192.168.178.43", "dpPower": 20, "dpBrightness": 22, "dpColorTemperature": 23, "minWhiteColor": 140, "maxWhiteColor": 400, "scaleBrightness": 1000, "scaleWhiteColor": 1000 },

I use homebridge-tuya-lan v1.5.0-rc.12

The problem is, that the device does not respond with its current state. On/Off, brightness and colortemperature is working correctly

IS there any way to fix that?

Sisimoski commented 4 years ago

@ibitas I pasted your config into my config file and my Smart Ceiling Lamp finally works with Home app and it also responds with its current state. If I change some values (brightness, color temperature, on/off state) in Tuya App then it changes in Home app and vice versa. Big thank you for sending this snippet here.

I made similar changes in my config file to LED Strip. Unfortunately, only on/off is working. Changing colors in Home app doesn't change color on strip itself. Brightness isn't also working. Someone does know why is that and is there any way to make it work properly?

itavero commented 4 years ago

My configuration is as follows for the Smart Ceiling Light (so without the IP address, I did not need it):

        {
                 "name": "Ceilling Light C",
                 "type": "TWLight",
                 "manufacturer": "LSC",
                 "model": "Smart Ceiling Light",
                 "id": "xxxxxxxxxxxxxxxxxxxxxxx",
                 "key": "xxxxxxxxxxxxxxxx",
                 "dpPower": 20,
                 "dpBrightness": 22,
                 "dpColorTemperature": 23,
                 "minWhiteColor": 140,
                 "maxWhiteColor": 400,
                 "scaleBrightness": 1000,
                 "scaleWhiteColor": 1000
             }

Initially this was not working, but @codyc1515 mentioned in https://github.com/AMoo-Miki/homebridge-tuya-lan/issues/112#issuecomment-550496218 that it might be worth trying the latest RC version using: npm i -g homebridge-tuya-lan@rc In the release version (1.4.0) this configuration did not work: discovery failed and hardcoding the IP resulted in complaints about command 8. After the update (1.5.0-rc.12), discovery and control did work, but I still see messages about command 8 and an unknown state.

In the logs I see that it is not reporting the current state on start up:

0|homebridge  | [1/4/2020, 12:29:10 AM] [TuyaLan] Discovered Ceilling Light C (xxxxxxxxxxxxxxxxxxxxxxx) identified as TWLight (3.3)
0|homebridge  | [TuyaAccessory] Changing ping gap for Ceilling Light C to 9s
0|homebridge  | [1/4/2020, 12:29:10 AM] [TuyaLan] Connected to Ceilling Light C
0|homebridge  | [TuyaAccessory] Sending first query to Ceilling Light C (3.3)
0|homebridge  | [TuyaAccessory] Ceilling Light C (3.3) didn't respond with its current state.

In the logs I also see messages like this:

0|homebridge  | [TuyaAccessory] Sending Ceilling Light B {"20":true}
0|homebridge  | [TuyaAccessory] Sending Ceilling Light A {"20":true}
0|homebridge  | [TuyaAccessory] Sending Ceilling Light C {"20":true}
0|homebridge  | [TuyaAccessory] Heard back from Ceilling Light B with command 8
0|homebridge  | [TuyaAccessory] Heard back from Ceilling Light A with command 8
0|homebridge  | [TuyaAccessory] Heard back from Ceilling Light C with command 8
itavero commented 4 years ago

Currently looking in the decompiled sources of the APK to see if I can figure out the protocol for this message. Apparently command 8 is a Status message. The sources contain acom.tuya.sdk.hardware.enums.FrameTypeEnum which mentions the following types (amongst others):

public enum FrameTypeEnum {
    UDP(0),
    AP_CONFIG(1),
    ACTIVE(2),
    BIND(3),
    RENAME_GW(4),
    RENAME_DEVICE(5),
    UNBIND(6),
    CONTROL(7),
    STATUS(8),
    HEART_BEAT(9),
    DP_QUERY(10),
    QUERY_WIFI(11),
    TOKEN_BIND(12),
    CONTROL_NEW(13),
    ENABLE_WIFI(14),
    DP_QUERY_NEW(16),
    SCENE_EXECUTE(17),
    DP_QUERY_GENERAL(18),
    SCENE_EXECUTE_NEW(19),
    AP_CONFIG_NEW(20),
    AP_CONFIG_ACK(21),
    IPC_LAN_302(32),
    LAN_GW_ACTIVE(AVIOCTRLDEFs.AVIOCTRL_RECORD_PLAY_NEXT),
    LAN_SUB_DEV_REQUEST(241),
    LAN_DELETE_SUB_DEV(TuyaZigBeeLocalSceneModel.WHAT_ALLOC_SCENEID_FAILURE),
    LAN_REPORT_SUB_DEV(243),
    LAN_SCENE(MeshLogin.WHAT_LOGIN_FAILURE),
    LAN_PUBLISH_CLOUD_CONFIG(MeshLogin.WHAT_CONNECT_FAILURE),
    LAN_PUBLISH_APP_CONFIG(MeshLogin.WHAT_LOGIN_SUCCESS),
    LAN_EXPORT_APP_CONFIG(247),
    LAN_PUBLISH_SCENE_PANEL(MeshLogin.WHAT_SEARCH_CANCEL),
    LAN_REMOVE_GW(249),
    LAN_CHECK_GW_UPDATE(250),
    LAN_GW_UPDATE(251),
    LAN_SET_GW_CHANNEL(252),
    LAN_GET_GW_CHANNEL(253),
    LAN_REQUEST_GW_LOG(254),
    LAN_SUB_DEV_STAUS_REQUEST(224),
    LAN_SUB_DEV_STAUS(JfifUtil.MARKER_APP1),
    LAN_REQUEST_SCENE_RULES(226),
    LAN_GW_RESET(227),
    LAN_SUB_DEV_RESET(228),
    LAN_CHECK_SUB_DEV_UPDATE(229),
    LAN_REQUEST_DEV_UPDATE(230),
    LAN_DOWNLOAD_OTA_PACKAGE(231),
    LAN_OTA_PROGRESS_CHANGED(232),
    LAN_DEV_VERSION_REPORT(233);

    public int type;

    private FrameTypeEnum(int i) {
        this.type = i;
    }

    /* ... */
}
jensDL commented 4 years ago

There is an easy way to do it now just use the TuyaSmart app register your light and then use the tuya web api only think that doesn’t work correctly are the colors

itavero commented 4 years ago

@jensDL I was under the impression that that one always uses the cloud and never communicates directly with the device. I prefer direct communication so I can still control the device if my internet connection is down or who knows, the Tuya web service is down (or they decide to no longer support it).

Also I briefly tried the other one in the past and noticed weird behavior if I was controlling multiple lights at once (as a group within HomeKit). At random, one or two of the three lights I was controlling would actually switch off instead of changing brightness or color. So far I haven't seen this issue when using this integration.

jensDL commented 4 years ago

I prefer the lan version to but I can’t see to get that working

itavero commented 4 years ago

@jensDL For me it works well using the release candidate and the configuration mentioned above (see my first comment on this issue).

jensDL commented 4 years ago

@itavero I just cant control my light. I have "Odd message from test light with command 10". I used the config example from you.

homebridge.log

itavero commented 4 years ago

Your log mentions that it is an RGBTW light, not a TW light like the ceiling light I have. Do you have a log from the tuya-lan-find command? It might be that your device uses different identifiers.

Just to double check: you did install the 1.5.0-rc.12 version (so npm i -g homebridge-tuya-lan@rc)?

jensDL commented 4 years ago

i get this back and yes i installed the rc version.

Error: ERR_SSL_SSLV3_ALERT_CERTIFICATE_UNKNOWN [Error: 7920:error:14094416:SSL routines:ssl3_read_bytes:sslv3 alert certificate unknown:c:\ws\deps\openssl\openssl\ssl\record\rec_layer_s3.c:1544:SSL alert number 46 ] { library: 'SSL routines', function: 'ssl3_read_bytes', reason: 'sslv3 alert certificate unknown', code: 'ERR_SSL_SSLV3_ALERT_CERTIFICATE_UNKNOWN' }