codetheweb / tuyapi

🌧 An easy-to-use API for devices that use Tuya's cloud services. Documentation: https://codetheweb.github.io/tuyapi.
MIT License
2.1k stars 342 forks source link

List of functions and parameters #265

Closed aleqx closed 5 years ago

aleqx commented 5 years ago

I apologise if this is posted elsewhere (I couldnt' find it). Are there any docs to get the actual functions and parameters supported by a device? For example, I'd like to read the current power consumption of my smartplugs and code a wrapper around it to automatically turn it off if it falls under a certain level for more than N minutes (to automate some energy saving in the house).

I did get tuyapi up and running and I can switch them on/off using the example code, but for other functions I didn't make more progress.

EDIT: Figured out that dps[4] is current in mA, dps[5] is power in W/10, dps[6] is voltage in V/10; not sure what dps[2] is.

codetheweb commented 5 years ago

There's a few device schema dumps here.

You may also find the cloud documentation useful, as sometimes the local schema shares some details with the cloud one.