LocalTuya says Lights are a Switch

Still Hoping someone can Help me get my Tuya Lights working… So far No Go

LocalTuya, picks up all my devices fine, but miss interprets them.
Examples:

  1. Lights: Shown as a Switch Not a Light
  2. ONLY Supports ON/OFF…
  3. No COLOR Options
  4. No Dimming.

So Where do I begin to troubleshoot …??

Tried to change to “LIGHT” in the GUI in Integrations, but just defaults back to “Switch”
As Always Thanks in Advance…

I had the opposite a switch saying it was a light, in your configuration yaml put

zha:
  device_config:
    00:12:4b:00:25:7e:0e:4f-1:
      type: 'light'

where that number is the mac address with a -1 on the end.

Worth a try?

There is also a Helper ‘Switch as X’

Hey thanks for the suggestion, but I’m thinking it’s more complex than that.
What about color and dimming of the light?

Was Color and Dimming resolved by changing “Switch” to ‘light’ in your yaml config?

Will it then find these other more complex settings that are found in the actual Smart Life App?

I’ll try it when I get back home today. But again I think something is missing here.

Also I’ve not been able to get a Tuya thermometer to read it’s data either.

But I’ll definitely try this first before I post anything more.

Thanks but what is a "Helper ‘Switch as X’. " Not a clue what or where that is to be found. :thinking:

Hey Thanks for the Suggestion:
Please explain what your example is and where is it located ?

This is where I’m looking at for the Tuya Setups.
/config/custom_components/localtuya
Only see one yaml file called services.yaml in that folder.
What’s the exact name of that file.?

Settings > Devices

OK - I’ve just switched to Local Tuya, and - during the Setup and adding a device I was asked which type of device it should be.
There, I could select between switch, light, power-plug, and so on.

So, I just had a look - and it seems that you can easily edit the devices within the Local Tuya Integration:

Open your Integrations page and select “Configure” for the localtuya integration
grafik

select “edit a device”
grafik

select the device you want to edit
grafik

Now, a Configuration Dialog will be shown.
Here, I don’t know, if you need to remove the entity in order to change the type - or if it is ok by just submitting this dialog (Probably, you need to remove it and then, it can be added with the correct device type)

Yes I’ve been there several times and this is where the settings are. However Where you left off a is where things get complicated and that is the actual DP settings. There seems to be very little information on this. The values that need to be entered are very sketchy.
Example: color value. Low or high?
I’m just now starting to look at the Tuya development site to find the values, but at least for me a crap shot and I’m guessing with no clear directions.

yes, the DP settings are a bit hard to understand - I had the same the first time…
But it appears to be easier as I thought it could be…

If you provide a Screenshot, I might be able to give some examples - but since I didn’t want to set up my light again, I did not continue with the “edit” options here… (sorry for that)

Ok thanks I’ll post a screen shot for you later today as I’m not yet home.
Like everything it gets better when one gets their feet wet. :sunglasses:
Sure would be nice to have full documentation on doing this.

Would be really nice if there was a clear way to easily extract this DP data from the Tuya developer website.

I’m confused by this screen, selecting DP’s (see screenshot). Where can I discover what values I should select for a ‘light’?

Note, when i leave ID as the default on/off, I can turn it on/off, but no brightness change or color. When I attempt to select some other DP, it won’t work.

Use the links from my post below and you can query the DP values from the Tuya IOT website:

1 Like

I had missed the mention ‘DP’ in that comment… Thanks!

When I run the query, it’s showing my device as a ‘switch’ (DP as 20) not a ‘light’, therefor, no ‘Brightness’ option. I don’t understand as it is a light and I can control brightness from the Tuya app, remote, and in HA as a light.

{
  "result": {
    "properties": [
      {
        "code": "switch_led",
        "custom_name": "",
        "dp_id": 20,
        "time": 1696255605317,
        "value": false
      },
      {
        "code": "work_mode",
        "custom_name": "",
        "dp_id": 21,
        "time": 1696215963102,
        "value": "colour"
      },
      {
        "code": "colour_data",
        "custom_name": "",
        "dp_id": 24,
        "time": 1696215974574,
        "value": "015e03e803e8"
      },
      {
        "code": "scene_data",
        "custom_name": "",
        "dp_id": 25,
        "time": 1694027447799,
        "value": "0B646402000003e803e800000000646402007803e803e80000000064640200f003e803e800000000646402003c03e803e80000000064640200b403e803e800000000646402011802f303e8000000006464020000000003e800000000"
      },
      {
        "code": "countdown",
        "custom_name": "",
        "dp_id": 26,
        "time": 1694912187821,
        "value": 0
      },
      {
        "code": "music_data",
        "custom_name": "",
        "dp_id": 27,
        "time": 1693519958245,
        "value": ""
      },
      {
        "code": "control_data",
        "custom_name": "",
        "dp_id": 28,
        "time": 1693519958245,
        "value": ""
      }
    ]
  },
  "success": true,
  "t": 1696256935292,
  "tid": "04399ae3613011ee9efe72cf9e0843d7"
}

It shows DP 20 as a switch as that is the control to switch the LED on and off. You just have to make sure when you first configure the device that you select that you want to setup a Light and not a Switch. I noticed your bulb is in color mode. Try changing it to white mode and then run the Tuya IOT query again and see if you get a Brightness DP value as its for white only. Otherwise just try using DP 22 for Brightness and see how it goes.

Here is the result for one of my LED bulbs:

{
  "result": {
    "properties": [
      {
        "code": "switch_led",
        "custom_name": "",
        "dp_id": 20,
        "time": 1696237921666,
        "value": false
      },
      {
        "code": "work_mode",
        "custom_name": "",
        "dp_id": 21,
        "time": 1696185993707,
        "value": "white"
      },
      {
        "code": "bright_value",
        "custom_name": "",
        "dp_id": 22,
        "time": 1696185993707,
        "value": 440
      },
      {
        "code": "colour_data",
        "custom_name": "",
        "dp_id": 24,
        "time": 1696185993707,
        "value": "003c03e801b8"
      },
      {
        "code": "scene_data",
        "custom_name": "",
        "dp_id": 25,
        "time": 1696185993707,
        "value": "000e0d0000000000000000c80000"
      },
      {
        "code": "countdown",
        "custom_name": "",
        "dp_id": 26,
        "time": 1696185993707,
        "value": 0
      },
      {
        "code": "control_data",
        "custom_name": "",
        "dp_id": 28,
        "time": 1616039799151,
        "value": ""
      }
    ]
  },
  "success": true,
  "t": 1696305706923,
  "tid": "9260ea5161a111eebdf0a64fb2ede3b1"
}

And this is what I setup in LocalTuya and its working for me:

Brightness (only for white color): 22
Color Mode: 21
Color: 24
Scene: 25

1 Like

Okay, thanks. I’ll rerun it.