iRayanKhan / homebridge-tuya

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

Smart Tuya Outlet throwing: "Error: ERR_PING_TIMED_OUT" #453

Closed FGarridoV closed 7 months ago

FGarridoV commented 7 months ago

Checklist

Before to read First of all, thank you for maintaining this repo. It is very useful and easy to set up. I was using it for some years, without issues. I have many lightbulbs that use Tuya and everything works perfect with this plugin. Now, for the first time I am experiencing an issue. After hours of trying, I couldn't solve. I tried with the latest plugin version and the beta version.

Describe the bug I bought a new smart plug/outlet that also use Tuya but I cannot interact with it. I installed this device as usual and I set a fixed IP for this device using its MAC address (Static DHCP in my router). The homebridge logs shows: "Error: ERR_PING_TIMED_OUT". The logs shown (related to this device) are:

[25/02/2024, 11:18:04] [TuyaLan] Discovery - Discovery started on port 6666.
[25/02/2024, 11:18:04] [TuyaLan] Discovery - Discovery started on port 6667.
[25/02/2024, 11:18:08] [TuyaLan] Discovered Outlet1 (bf5b97e7286e**********) identified as Outlet (3.4)
[25/02/2024, 11:18:08] [TuyaLan] Accessory IP changed from undefined to 192.168.1.30
[25/02/2024, 11:18:08] [TuyaLan] Discovery ended.
[25/02/2024, 11:18:08] [TuyaLan] Connected to Outlet1
[25/02/2024, 11:18:08] [TuyaLan] Disconnected from Outlet1
[25/02/2024, 11:18:44] [TuyaLan] Socket had a problem and will reconnect to Outlet1 (Error: ERR_PING_TIMED_OUT)
[25/02/2024, 11:18:49] [TuyaLan] Disconnected from Outlet1

To Reproduce I set up this device in the same way I set up my lights using the following json:

{
    "name": "Outlet1",
    "type": "Outlet",
    "manufacturer": "EZH",
    "model": "Wifi Mini Smart Life Outlet",
    "id": "bf5b97e7286e**********",
    "key": "yt}C.S**********",
    "ip": "192.168.1.30",
    "voltsId": 9,
    "ampsId": 8,
    "wattsId": 7,
    "voltsDivisor": 10,
    "ampsDivisor": 1000,
    "wattsDivisor": 10,
    "dpPower": 1
}

The output I got from the iot.tuya API was:

{
  "result": {
    "active_time": 1708175200,
    "bind_space_id": "5121****”,
    "category": "cz",
    "create_time": 1708175200,
    "custom_name": "Outlet1",
    "icon": "smart/icon/ay1541056239985fDGjj/9c8600f63f144d075b461f01b0e93873.png",
    "id": "bf5b97e7286ec5bd5dshsb",
    "ip": “***.***.***.***”,
    "is_online": true,
    "lat": "52.0000",
    "local_key": "yt}C.S**********”,
    "lon": "4.3500",
    "model": "5225000200",
    "name": "LSC Smart Power Plug",
    "product_id": "jrsr2b**********”,
    "product_name": "LSC Power Plug w/ Power Meter EU",
    "sub": false,
    "time_zone": "+01:00",
    "update_time": 1708852756,
    "uuid": "49f633**********”
  }

Expected behavior I would like to turn on and off the plug using homebridge. I cannot do it from neither from homebridge and home app. I CAN control it using Tuya Smart App.

Screenshots

Environment (please complete the following information):

Additional context Here is the link of the product I am using: https://www.action.com/nl-nl/p/3202087/lsc-smart-connect-slimme-stekker/

FGarridoV commented 7 months ago

Closed because it was duplicated on issue #443