make-all / tuya-local

Local support for Tuya devices in Home Assistant
MIT License
1.42k stars 544 forks source link

Request support for Longlife LED 2.4GHz Wifi RGB + CCT, 230V Slider Smart 4917 #2486

Closed BetaBucket closed 2 weeks ago

BetaBucket commented 2 weeks ago

Log message

Dieser Fehler stammt von einer benutzerdefinierten Integration

Logger: custom_components.tuya_local.config_flow
Quelle: custom_components/tuya_local/config_flow.py:295
Integration: tuya_local (Dokumentation, Probleme)
Erstmals aufgetreten: 21:23:37 (1 Vorkommnisse)
Zuletzt protokolliert: 21:23:37

Could not find device: bf150233bb93a26c9cxmtr

-------------

Dieser Fehler stammt von einer benutzerdefinierten Integration

Logger: custom_components.tuya_local.device
Quelle: custom_components/tuya_local/device.py:464
Integration: tuya_local (Dokumentation, Probleme)
Erstmals aufgetreten: 21:23:46 (1 Vorkommnisse)
Zuletzt protokolliert: 21:23:46

Test protocol error 904: Unexpected Payload from Device

Product ID

2mum0xruvfx0ayzp

Product Name

LED Stufenbeleuchtung Unterteil mit 2.4G RGB + CCT, 230V Slider Smart 4917

DPS information

curl  --request GET "https://openapi.tuyaeu.com/v2.0/cloud/thing/bf150233bb93a26c9cxmtr/model" --header "sign_method: HMAC-SHA256" --header "client_id: x9pg47gefjmugfnx9ap9" --header "t: 1731187974903" --header "mode: cors" --header "Content-Type: application/json" --header "sign: 1D3F8B3BAB3838B6470C69776ABD6E0918ED3BCC361D0044CE572C45412718BE" --header "access_token: fb16997fe10914e3d9017f9670a43877" 

------

{
  "result": {
    "model": "{\"modelId\":\"000004lcje\",\"services\":[{\"actions\":[],\"code\":\"\",\"description\":\"\",\"events\":[],\"name\":\"默认服务\",\"properties\":[{\"abilityId\":20,\"accessMode\":\"rw\",\"code\":\"switch_led\",\"description\":\"\",\"extensions\":{\"iconName\":\"icon-dp_power\",\"attribute\":\"641\"},\"name\":\"开关\",\"typeSpec\":{\"type\":\"bool\"}},{\"abilityId\":21,\"accessMode\":\"rw\",\"code\":\"work_mode\",\"description\":\"\",\"extensions\":{\"iconName\":\"icon-dp_mode\",\"attribute\":\"640\"},\"name\":\"模式\",\"typeSpec\":{\"type\":\"enum\",\"range\":[\"white\",\"colour\",\"scene\",\"music\"]}},{\"abilityId\":22,\"accessMode\":\"rw\",\"code\":\"bright_value\",\"description\":\"\",\"extensions\":{\"iconName\":\"icon-liangdu1\",\"attribute\":\"640\"},\"name\":\"亮度值\",\"typeSpec\":{\"type\":\"value\",\"max\":1000,\"min\":10,\"scale\":0,\"step\":1}},{\"abilityId\":23,\"accessMode\":\"rw\",\"code\":\"temp_value\",\"description\":\"\",\"extensions\":{\"iconName\":\"icon-dp_half\",\"attribute\":\"640\"},\"name\":\"冷暖值\",\"typeSpec\":{\"type\":\"value\",\"max\":1000,\"min\":0,\"scale\":0,\"step\":1}},{\"abilityId\":24,\"accessMode\":\"rw\",\"code\":\"colour_data\",\"description\":\"彩光颜色、亮度、饱和度调节\",\"extensions\":{\"iconName\":\"icon-dp_mode\",\"attribute\":\"512\"},\"name\":\"彩光\",\"typeSpec\":{\"type\":\"string\",\"maxlen\":255}},{\"abilityId\":25,\"accessMode\":\"rw\",\"code\":\"scene_data\",\"description\":\"灯光情景\",\"extensions\":{\"iconName\":\"icon-dp_mode\",\"attribute\":\"512\"},\"name\":\"场景\",\"typeSpec\":{\"type\":\"string\",\"maxlen\":255}},{\"abilityId\":26,\"accessMode\":\"rw\",\"code\":\"countdown\",\"description\":\"\",\"extensions\":{\"iconName\":\"icon-a_nav_timer\",\"attribute\":\"640\"},\"name\":\"倒计时剩余时间\",\"typeSpec\":{\"type\":\"value\",\"max\":86400,\"min\":0,\"scale\":0,\"step\":1,\"unit\":\"s\"}},{\"abilityId\":27,\"accessMode\":\"wr\",\"code\":\"music_data\",\"description\":\"通过APP内置律动算法实现灯光律动\",\"extensions\":{\"iconName\":\"icon-dp_mic\",\"attribute\":\"128\"},\"name\":\"音乐灯\",\"typeSpec\":{\"type\":\"string\",\"maxlen\":255}},{\"abilityId\":28,\"accessMode\":\"wr\",\"code\":\"control_data\",\"description\":\"用于实时下发数据实现实时预览效果\",\"extensions\":{\"iconName\":\"icon-dp_box2\",\"attribute\":\"640\"},\"name\":\"调节\",\"typeSpec\":{\"type\":\"string\",\"maxlen\":255}},{\"abilityId\":29,\"accessMode\":\"rw\",\"code\":\"debug_data\",\"description\":\"用于gamma调试,需配合支持gamma调试的面板使用\",\"extensions\":{\"iconName\":\"icon-dp_tool\",\"attribute\":\"128\"},\"name\":\"调试\",\"typeSpec\":{\"type\":\"string\",\"maxlen\":255}},{\"abilityId\":30,\"accessMode\":\"rw\",\"code\":\"rhythm_mode\",\"description\":\"不同时间段的色温、亮度根据人体节律自动调整\",\"extensions\":{\"iconName\":\"icon-dp_time3\",\"attribute\":\"640\"},\"name\":\"生物节律\",\"typeSpec\":{\"type\":\"raw\",\"maxlen\":255}},{\"abilityId\":31,\"accessMode\":\"rw\",\"code\":\"sleep_mode\",\"description\":\"温馨的灯光渐灭陪您进入甜美的梦乡\",\"extensions\":{\"iconName\":\"icon-dp_sleep\",\"attribute\":\"640\"},\"name\":\"入睡\",\"typeSpec\":{\"type\":\"raw\",\"maxlen\":255}},{\"abilityId\":32,\"accessMode\":\"rw\",\"code\":\"wakeup_mode\",\"description\":\"柔和的灯光渐亮伴您迎接新的一天\",\"extensions\":{\"iconName\":\"icon-dp_sun\",\"attribute\":\"640\"},\"name\":\"唤醒\",\"typeSpec\":{\"type\":\"raw\",\"maxlen\":255}},{\"abilityId\":33,\"accessMode\":\"rw\",\"code\":\"power_memory\",\"description\":\"用于设置断电再上电灯亮起的状态(不记忆APP关灯动作)\",\"extensions\":{\"iconName\":\"icon-dp_lightning\",\"attribute\":\"640\"},\"name\":\"断电记忆\",\"typeSpec\":{\"type\":\"raw\",\"maxlen\":255}},{\"abilityId\":34,\"accessMode\":\"rw\",\"code\":\"do_not_disturb\",\"description\":\"适用于经常停电的区域,避免停电再来电时亮灯打扰用户。开启通电勿扰,APP上关灯后需要连续两次上电才会亮灯\",\"extensions\":{\"iconName\":\"icon-dp_sleep\",\"attribute\":\"640\"},\"name\":\"勿扰模式\",\"typeSpec\":{\"type\":\"bool\"}},{\"abilityId\":35,\"accessMode\":\"rw\",\"code\":\"switch_gradient\",\"description\":\"开灯渐亮关灯渐暗\",\"extensions\":{\"iconName\":\"icon-dp_mode\"},\"name\":\"开关渐变\",\"typeSpec\":{\"type\":\"raw\",\"maxlen\":128}},{\"abilityId\":82,\"accessMode\":\"rw\",\"code\":\"candle_mode_data\",\"description\":\"模拟烛光情景效果,需要配合照明情景库高级能力使用\",\"extensions\":{\"iconName\":\"icon-huoyan\"},\"name\":\"模拟烛光\",\"typeSpec\":{\"type\":\"raw\",\"maxlen\":128}},{\"abilityId\":209,\"accessMode\":\"rw\",\"code\":\"cycle_timing\",\"description\":\"灯光循环亮灭满足植物照明等场景\",\"extensions\":{\"iconName\":\"icon-dp_time\",\"attribute\":\"128\"},\"name\":\"循环定时\",\"typeSpec\":{\"type\":\"raw\",\"maxlen\":255}},{\"abilityId\":210,\"accessMode\":\"rw\",\"code\":\"random_timing\",\"description\":\"灯光随机亮灭模拟有人在家的场景\",\"extensions\":{\"iconName\":\"icon-dp_time3\",\"attribute\":\"128\"},\"name\":\"随机定时\",\"typeSpec\":{\"type\":\"raw\",\"maxlen\":255}}]}]}"
  },
  "success": true,
  "t": 1731187974822,
  "tid": "2e43c3d29ee211efacb2ded37fff273c"
}

Information about how the device functions

www.longlife-led.de https://www.longlife-led.de/LED-Treppenleuchte-IP44-eckig-weiss-Lichtfarbe-Smart-Tuya-RGB-CCT-3W-Lichtaustritt-Orbis/404130

Not able to add the device. Free translated from german when trying to add the device: "Cannot establish connection with the provided details. Either provided details are wrong or it's an intermitting problem."

BetaBucket commented 2 weeks ago

Connection and Light with cloud tuya HA extension full functioning.

BetaBucket commented 2 weeks ago

Not sure it helps; diagnose data from tuya cloud extension for the device:


   "documentation": "https://www.home-assistant.io/integrations/tuya",
    "integration_type": "hub",
    "iot_class": "cloud_push",
    "loggers": [
      "tuya_iot"
    ],
    "requirements": [
      "tuya-device-sharing-sdk==0.1.9"
    ],
    "is_built_in": true,
    "overwrites_built_in": false
  },
  "setup_times": {},
  "data": {
    "endpoint": "https://apigw.tuyaeu.com",
    "terminal_id": "1731177771619tYJELs",
    "mqtt_connected": true,
    "disabled_by": null,
    "disabled_polling": false,
    "id": "bf150233bb93a26c9cxmtr",
    "name": "EG-Treppe-2",
    "category": "dj",
    "product_id": "2mum0xruvfx0ayzp",
    "product_name": "M-QJ3A",
    "online": true,
    "sub": false,
    "time_zone": "+01:00",
    "active_time": "2024-11-09T13:48:55+00:00",
    "create_time": "2024-11-09T13:48:55+00:00",
    "update_time": "2024-11-09T13:48:55+00:00",
    "function": {
      "switch_led": {
        "type": "Boolean",
        "value": {}
      },
      "work_mode": {
        "type": "Enum",
        "value": {
          "range": [
            "white",
            "colour",
            "scene",
            "music"
          ]
        }
      },
      "bright_value_v2": {
        "type": "Integer",
        "value": {
          "min": 10,
          "max": 1000,
          "scale": 0,
          "step": 1
        }
      },
      "temp_value_v2": {
        "type": "Integer",
        "value": {
          "min": 0,
          "max": 1000,
          "scale": 0,
          "step": 1
        }
      },
      "colour_data_v2": {
        "type": "Json",
        "value": {
          "h": {
            "min": 0,
            "scale": 0,
            "unit": "",
            "max": 360,
            "step": 1
          },
          "s": {
            "min": 0,
            "scale": 0,
            "unit": "",
            "max": 1000,
            "step": 1
          },
          "v": {
            "min": 0,
            "scale": 0,
            "unit": "",
            "max": 1000,
            "step": 1
          }
        }
      },
      "scene_data_v2": {
        "type": "Json",
        "value": {
          "scene_num": {
            "min": 1,
            "scale": 0,
            "max": 8,
            "step": 1
          },
          "scene_units": {
            "unit_change_mode": {
              "range": [
                "static",
                "jump",
                "gradient"
              ]
            },
            "unit_switch_duration": {
              "min": 0,
              "scale": 0,
              "max": 100,
              "step": 1
            },
            "unit_gradient_duration": {
              "min": 0,
              "scale": 0,
              "max": 100,
              "step": 1
            },
            "bright": {
              "min": 0,
              "scale": 0,
              "max": 1000,
              "step": 1
            },
            "temperature": {
              "min": 0,
              "scale": 0,
              "max": 1000,
              "step": 1
            },
            "h": {
              "min": 0,
              "scale": 0,
              "unit": "",
              "max": 360,
              "step": 1
            },
            "s": {
              "min": 0,
              "scale": 0,
              "unit": "",
              "max": 1000,
              "step": 1
            },
            "v": {
              "min": 0,
              "scale": 0,
              "unit": "",
              "max": 1000,
              "step": 1
            }
          }
        }
      },
      "countdown_1": {
        "type": "Integer",
        "value": {
          "unit": "s",
          "min": 0,
          "max": 86400,
          "scale": 0,
          "step": 1
        }
      },
      "music_data": {
        "type": "Json",
        "value": {
          "change_mode": {
            "range": [
              "direct",
              "gradient"
            ]
          },
          "bright": {
            "min": 0,
            "scale": 0,
            "unit": "",
            "max": 1000,
            "step": 1
          },
          "temperature": {
            "min": 0,
            "scale": 0,
            "unit": "",
            "max": 1000,
            "step": 1
          },
          "h": {
            "min": 0,
            "scale": 0,
            "unit": "",
            "max": 360,
            "step": 1
          },
          "s": {
            "min": 0,
            "scale": 0,
            "unit": "",
            "max": 255,
            "step": 1
          },
          "v": {
            "min": 0,
            "scale": 0,
            "unit": "",
            "max": 255,
            "step": 1
          }
        }
      },
      "control_data": {
        "type": "Json",
        "value": {
          "change_mode": {
            "range": [
              "direct",
              "gradient"
            ]
          },
          "bright": {
            "min": 0,
            "scale": 0,
            "unit": "",
            "max": 1000,
            "step": 1
          },
          "temperature": {
            "min": 0,
            "scale": 0,
            "unit": "",
            "max": 1000,
            "step": 1
          },
          "h": {
            "min": 0,
            "scale": 0,
            "unit": "",
            "max": 360,
            "step": 1
          },
          "s": {
            "min": 0,
            "scale": 0,
            "unit": "",
            "max": 255,
            "step": 1
          },
          "v": {
            "min": 0,
            "scale": 0,
            "unit": "",
            "max": 255,
            "step": 1
          }
        }
      },
      "rhythm_mode": {
        "type": "Raw",
        "value": {
          "maxlen": 255
        }
      },
      "sleep_mode": {
        "type": "Raw",
        "value": {
          "maxlen": 255
        }
      },
      "wakeup_mode": {
        "type": "Raw",
        "value": {
          "maxlen": 255
        }
      },
      "power_memory": {
        "type": "Raw",
        "value": {}
      },
      "do_not_disturb": {
        "type": "Boolean",
        "value": {}
      },
      "cycle_timing": {
        "type": "Raw",
        "value": {}
      },
      "random_timing": {
        "type": "Raw",
        "value": {}
      }
    },
    "status_range": {
      "switch_led": {
        "type": "Boolean",
        "value": {}
      },
      "work_mode": {
        "type": "Enum",
        "value": {
          "range": [
            "white",
            "colour",
            "scene",
            "music"
          ]
        }
      },
      "bright_value_v2": {
        "type": "Integer",
        "value": {
          "min": 10,
          "max": 1000,
          "scale": 0,
          "step": 1
        }
      },
      "temp_value_v2": {
        "type": "Integer",
        "value": {
          "min": 0,
          "max": 1000,
          "scale": 0,
          "step": 1
        }
      },
      "colour_data_v2": {
        "type": "Json",
        "value": {
          "h": {
            "min": 0,
            "scale": 0,
            "unit": "",
            "max": 360,
            "step": 1
          },
          "s": {
            "min": 0,
            "scale": 0,
            "unit": "",
            "max": 1000,
            "step": 1
          },
          "v": {
            "min": 0,
            "scale": 0,
            "unit": "",
            "max": 1000,
            "step": 1
          }
        }
      },
      "scene_data_v2": {
        "type": "Json",
        "value": {
          "scene_num": {
            "min": 1,
            "scale": 0,
            "max": 8,
            "step": 1
          },
          "scene_units": {
            "unit_change_mode": {
              "range": [
                "static",
                "jump",
                "gradient"
              ]
            },
            "unit_switch_duration": {
              "min": 0,
              "scale": 0,
              "max": 100,
              "step": 1
            },
            "unit_gradient_duration": {
              "min": 0,
              "scale": 0,
              "max": 100,
              "step": 1
            },
            "bright": {
              "min": 0,
              "scale": 0,
              "max": 1000,
              "step": 1
            },
            "temperature": {
              "min": 0,
              "scale": 0,
              "max": 1000,
              "step": 1
            },
            "h": {
              "min": 0,
              "scale": 0,
              "unit": "",
              "max": 360,
              "step": 1
            },
            "s": {
              "min": 0,
              "scale": 0,
              "unit": "",
              "max": 1000,
              "step": 1
            },
            "v": {
              "min": 0,
              "scale": 0,
              "unit": "",
              "max": 1000,
              "step": 1
            }
          }
        }
      },
      "countdown_1": {
        "type": "Integer",
        "value": {
          "unit": "s",
          "min": 0,
          "max": 86400,
          "scale": 0,
          "step": 1
        }
      },
      "music_data": {
        "type": "Json",
        "value": {
          "change_mode": {
            "range": [
              "direct",
              "gradient"
            ]
          },
          "bright": {
            "min": 0,
            "scale": 0,
            "unit": "",
            "max": 1000,
            "step": 1
          },
          "temperature": {
            "min": 0,
            "scale": 0,
            "unit": "",
            "max": 1000,
            "step": 1
          },
          "h": {
            "min": 0,
            "scale": 0,
            "unit": "",
            "max": 360,
            "step": 1
          },
          "s": {
            "min": 0,
            "scale": 0,
            "unit": "",
            "max": 255,
            "step": 1
          },
          "v": {
            "min": 0,
            "scale": 0,
            "unit": "",
            "max": 255,
            "step": 1
          }
        }
      },
      "control_data": {
        "type": "Json",
        "value": {
          "change_mode": {
            "range": [
              "direct",
              "gradient"
            ]
          },
          "bright": {
            "min": 0,
            "scale": 0,
            "unit": "",
            "max": 1000,
            "step": 1
          },
          "temperature": {
            "min": 0,
            "scale": 0,
            "unit": "",
            "max": 1000,
            "step": 1
          },
          "h": {
            "min": 0,
            "scale": 0,
            "unit": "",
            "max": 360,
            "step": 1
          },
          "s": {
            "min": 0,
            "scale": 0,
            "unit": "",
            "max": 255,
            "step": 1
          },
          "v": {
            "min": 0,
            "scale": 0,
            "unit": "",
            "max": 255,
            "step": 1
          }
        }
      },
      "rhythm_mode": {
        "type": "Raw",
        "value": {
          "maxlen": "255"
        }
      },
      "sleep_mode": {
        "type": "Raw",
        "value": {
          "maxlen": "255"
        }
      },
      "wakeup_mode": {
        "type": "Raw",
        "value": {
          "maxlen": "255"
        }
      },
      "power_memory": {
        "type": "Raw",
        "value": {}
      },
      "do_not_disturb": {
        "type": "Boolean",
        "value": {}
      },
      "cycle_timing": {
        "type": "Raw",
        "value": {}
      },
      "random_timing": {
        "type": "Raw",
        "value": {}
      }
    },
    "status": {
      "switch_led": true,
      "work_mode": "white",
      "bright_value_v2": 227,
      "temp_value_v2": 0,
      "colour_data_v2": {
        "h": 194,
        "s": 453,
        "v": 1000
      },
      "scene_data_v2": {
        "scene_num": 34,
        "scene_units": [
          {
            "bright": 0,
            "h": 350,
            "s": 500,
            "temperature": 0,
            "unit_change_mode": "gradient",
            "unit_gradient_duration": 50,
            "unit_switch_duration": 50,
            "v": 1000
          },
          {
            "bright": 0,
            "h": 275,
            "s": 1000,
            "temperature": 0,
            "unit_change_mode": "gradient",
            "unit_gradient_duration": 50,
            "unit_switch_duration": 50,
            "v": 1000
          }
        ]
      },
      "countdown_1": 0,
      "music_data": "",
      "control_data": "",
      "rhythm_mode": "AAAAAAA=",
      "sleep_mode": "AAA=",
      "wakeup_mode": "AAA=",
      "power_memory": "AAEAwgHFA+gA6AAA",
      "do_not_disturb": false,
      "cycle_timing": "AAAA",
      "random_timing": "AAAA"
    },
    "home_assistant": {
      "name": "EG-Treppe-2",
      "name_by_user": null,
      "disabled": false,
      "disabled_by": null,
      "entities": [
        {
          "disabled": false,
          "disabled_by": null,
          "entity_category": null,
          "device_class": null,
          "original_device_class": null,
          "icon": "mdi:stairs",
          "original_icon": null,
          "unit_of_measurement": null,
          "state": {
            "entity_id": "light.eg_treppe_2",
            "state": "on",
            "attributes": {
              "min_color_temp_kelvin": 2000,
              "max_color_temp_kelvin": 6535,
              "min_mireds": 153,
              "max_mireds": 500,
              "supported_color_modes": [
                "color_temp",
                "hs"
              ],
              "color_mode": "color_temp",
              "brightness": 56,
              "color_temp_kelvin": 2000,
              "color_temp": 500,
              "hs_color": [
                30.601,
                94.547
              ],
              "rgb_color": [
                255,
                136,
                13
              ],
              "xy_color": [
                0.599,
                0.382
              ],
              "icon": "mdi:stairs",
              "friendly_name": "EG-Treppe-2",
              "supported_features": 0
            },
            "last_changed": "2024-11-09T21:41:27.075131+00:00",
            "last_reported": "2024-11-09T21:41:27.075131+00:00",
            "last_updated": "2024-11-09T21:41:27.075131+00:00"
          }
        }
      ]
    },
    "set_up": true,
    "support_local": true
  }
}
make-all commented 2 weeks ago

Se #522

BetaBucket commented 2 weeks ago

@make-all Hi and thanks for pointing me to #522. I basically tried everything described there, without success. The issue you are referring to is that my device has ID22 an not an dp id 1? i.e. there is currently no solution and no developments planed?

make-all commented 2 weeks ago

dp 20 is included in the dp scan for "device22" devices, as it is common for lightbulbs to start at 20.

make-all commented 2 weeks ago

904 is a decoding error, so most likely one of the parameters is wrong (Local key, Version or Device ID).

BetaBucket commented 1 week ago

Solution: My tuya devices are in a separate IOT Vlan. UDP Broadcast was blocked. Installing udp broadcast relay allowing ports 6666 and 6667, +firewall rule for my homeassistant vlan to allow IOT vlan broadcast protocoll access solved the connection issue. This thread helped: https://github.com/rospogrigio/localtuya/issues/1507