rospogrigio / localtuya

local handling for Tuya devices
GNU General Public License v3.0
3k stars 565 forks source link

Cheap RGB Leds, not offering dp's for color, brightness or scenes, but ... #1349

Open cpolzer opened 1 year ago

cpolzer commented 1 year ago

... the scenes are usable and updateable by the tuya smart app.

And with these scenes I am able to access all the parmeters i would like to control.

So I am thinking of trying to extend localtuya to use scene en/decoding when a device is somehow custom setup and to map all brightness/rgb colors to scenes and just send them to the device.

But first off all i am wondering, why would someone build a tuya device which not publishes its full potential, and how is it done that the smart app finds preset scenes which are not communicated by tuya ?

Its this led strip: https://amzn.eu/d/cBuxHux

Available datapoints according to the iot.tuya hub: GET "https://openapi.tuyaeu.com/v1.0/devices/.../specifications"

"functions": [
      {
        "code": "switch_led",
        "type": "Boolean",
        "values": "{}"
      },
      {
        "code": "countdown",
        "type": "Integer",
        "values": "{\"unit\":\"s\",\"min\":0,\"max\":86400,\"scale\":0,\"step\":1}"
      }
    ],
    "status": [
      {
        "code": "switch_led",
        "type": "Boolean",
        "values": "{}"
      },
      {
        "code": "countdown",
        "type": "Integer",
        "values": "{\"unit\":\"s\",\"min\":0,\"max\":86400,\"scale\":0,\"step\":1}"
      }
    ]

GET "https://openapi.tuyaeu.com/v1.0/devices/.../functions"

{
  "result": {
    "category": "dd",
    "functions": [
      {
        "code": "switch_led",
        "desc": "switch led",
        "name": "switch led",
        "type": "Boolean",
        "values": "{}"
      },
      {
        "code": "countdown",
        "desc": "countdown",
        "name": "countdown",
        "type": "Integer",
        "values": "{\"unit\":\"s\",\"min\":0,\"max\":86400,\"scale\":0,\"step\":1}"
      }
    ]
  },
  "success": true,
  "t": ...,
  "tid": "..."
}

P.s: I bought the cheap strip for testing local tuye device recognition, becuase i wanted to look into something else, and now this. :)

mscodemonkey commented 1 year ago

I'm seeing the same thing, but with all Tuya devices on Tuya IOT platform, even ones that I'd previously seen DPs for. For example, this cheap and nasty Kogan lightbulb, the type of which I've already got setup in LocalTuya, now says it can't find any datapoints when I try to add a new one.

"result": {
    "category": "dj",
    "functions": [
      {
        "code": "switch_led",
        "desc": "{}",
        "name": "开关",
        "type": "Boolean",
        "values": "{}"
      },
      {
        "code": "work_mode",
        "desc": "{\"range\":[\"white\",\"colour\",\"scene\",\"music\"]}",
        "name": "工作模式",
        "type": "Enum",
        "values": "{\"range\":[\"white\",\"colour\",\"scene\",\"music\"]}"
      },
      {
        "code": "bright_value_v2",
        "desc": "{\"min\":10,\"max\":1000,\"scale\":0,\"step\":1}",
        "name": "亮度",
        "type": "Integer",
        "values": "{\"min\":10,\"max\":1000,\"scale\":0,\"step\":1}"
      },
...
cpolzer commented 1 year ago

I think tuya should just not be bought anymore to be honest. what a bullshit in engineering. Its a major concern on network security and just not needed in todays homeautomations.

UltraHQ commented 1 year ago

I'm seeing the same thing, but with all Tuya devices on Tuya IOT platform, even ones that I'd previously seen DPs for. For example, this cheap and nasty Kogan lightbulb, the type of which I've already got setup in LocalTuya, now says it can't find any datapoints when I try to add a new one.

"result": {
    "category": "dj",
    "functions": [
      {
        "code": "switch_led",
        "desc": "{}",
        "name": "开关",
        "type": "Boolean",
        "values": "{}"
      },
      {
        "code": "work_mode",
        "desc": "{\"range\":[\"white\",\"colour\",\"scene\",\"music\"]}",
        "name": "工作模式",
        "type": "Enum",
        "values": "{\"range\":[\"white\",\"colour\",\"scene\",\"music\"]}"
      },
      {
        "code": "bright_value_v2",
        "desc": "{\"min\":10,\"max\":1000,\"scale\":0,\"step\":1}",
        "name": "亮度",
        "type": "Integer",
        "values": "{\"min\":10,\"max\":1000,\"scale\":0,\"step\":1}"
      },
...

After switching to Raw mode I'm getting the same issue

igorsantos07 commented 1 year ago

I have a similar LED strip with the same nonsense, besides a ceiling fan wall-mounted panel which works great, but through the API you cannot change the fan speed 🙃 🙃 🙃

Then, while I completely agree that Tuya devices are 💩 because the API is all over the place, I cannot agree with the "not buying": 1 there's no other manufacturer yet with such a variety of devices, such as these wall-mounted fan controllers, or water pumps for dripping, and 2 that's the easiest to get in a lot of places. (e.g. Brazil), because that's what's most sold in AliExpress 🤷🏼‍♂️

It would be WONDERS if we could uncover the differences between what's offered in their API and in their apps.