rospogrigio / localtuya

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

Proper device attributes tutorial #1179

Open Bluscream opened 1 year ago

Bluscream commented 1 year ago

The device setup screen is very confusing. What should i select where? The only thing i can guess is the "color mode" being "color" and the ID probably is the long hex string

donburch888 commented 1 year ago

Yes it is rather confusing, because it is not intended for new users ;-( Almost as confusing as your message...

Bluscream commented 1 year ago
  • What device are you trying to setup ? smart light

  • Which setup screen ? edit/add device

  • which tutorial ? none

  • Have you followed any of the tutorials on how to get dp_id's from Tuya website ? yes i found that i needed dpid 25 for light

Screenshot_2022-12-20-13-52-54-548.jpeg

donburch888 commented 1 year ago

That is more helpful, thanks ... but no answer jumps out at me from that screen image :-(

Hopefully the values for "code" in the Tuya websites “Get Device Specific…” (note the capital letters) menu option should match up with the LocalTuya field names (such as the "brightness" in your image above). Seeing only dp_id numbers and current values in LocalTuya is not very helpful.

From Tuya website you should be able to summarise the info for your device similar to:

code            dp_id   type       values
switch_led,       20,   Boolean,
work_mode,        21,   Enum,      "white”,“colour”,“scene”,“music”
bright_value_v2,  22,   Integer,   10-1000
countdown_1,      26,   Integer,   0-86400

which I find so much more useful.

I used this YouTube video to get local key and dp_id info from Tuya website; then discussion at https://community.home-assistant.io/t/localtuya-using-tuya-iot-platform-to-obtain-not-only-local-keys-but-also-dp-data-point-ids/423236. Also be aware that on Tuya's website in “Device Control” menu there are options “Get device specific…” and “Get Device Specific…” (note the capital letters) !!! use the one with capital letters to get the dp_ids.