libretiny-eu / libretiny

PlatformIO development platform for IoT modules
http://docs.libretiny.eu/
MIT License
382 stars 55 forks source link

Expanding tuya config in docs #218

Open lmcd opened 7 months ago

lmcd commented 7 months ago

It turns out that Tuya device configuration, as seen in the Tuya Pinout Config page of the docs is documented more fully on the official Tuya website.

See here: https://developer.tuya.com/en/docs/iot/product-firmware-information-configuration-instructions?id=K9s9rhj59ov2z

By cross-referencing another dump here, and matching default values, we can discern what some of the undocumented fields are: https://www.elektroda.com/rtvforum/topic4000734.html

gmkr, gmkg, gmkb = Gamma gmwr, gmwg, gmwb = White balance

We could update the docs on your website with the more extensive descriptions from the Tuya website.

szupi-ipuzs commented 7 months ago

For lights there seem to be a detailed description of UPK keys here (it's for bluetooth but I don't think it matters).

lmcd commented 7 months ago

There is also source code that details exactly how these values are used: https://github.com/tuya/tuya-iotos-embeded-sdk-wifi-ble-bk7231n

For example, I was wondering what a gamma value of 1-100 represents, and found that the gamma correction algorithm is actually implemented here, based on the gmkr, gmkg, gmkb, gmwr, gmwg, gmwb config values

kuba2k2 commented 7 months ago

Oh WOW, I never realized that some of the keys are in the public SDK! That's great, I'll try to add more keys to the docs.

fonix232 commented 6 months ago

A few more definitions that seem to be missing, based on https://github.com/tuya-cloudcutter/tuya-cloudcutter.github.io/blob/master/devices/lsc-3008407-led-light-strip-1.0.18.json :