Closed uzlonewolf closed 1 year ago
Is there a global way to set that? It looks like it is "per device" setting:
Not that I've found, which is annoying since my list of device types is rather long.
Here is what I'm thinking about for documentation - It could stay in this issue we reference or in a Discussion. What do you think? Feel free to edit.
This how-to will show you how to activate “DP Instruction” mode for your Tuya devices when using Tuya Cloud to pull data. This will result in getting the full list of DPS values and their properties for your devices.
There doesn't appear to be a way to globally set "DP Instruction" for all device types. You will need to select each device type and repeat the above step.
After 12-24 hours, you should now be able to poll the Tuya Cloud using TinyTuya to get the full list of DPS properties and values.
import tinytuya
# Connect to Tuya Cloud
c = tinytuya.Cloud(
apiRegion="us",
apiKey="xxxxxxxxxxxxxxxxxxxx",
apiSecret="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
apiDeviceID="xxxxxxxxxxxxxxxxxxID")
# Display list of devices
devices = c.getdevices()
print("Device List: %r" % devices)
# Select a Device ID to Test
id = "xxxxxxxxxxxxxxxxxxID"
# Display Properties of Device
result = c.getproperties(id)
print("Properties of device:\n", result)
# Display Status of Device
result = c.getstatus(id)
print("Status of device:\n", result)
Updated Step 2. to include -> "Development"
and changed "a few hours" to "12-24 hours" (I really should time this). Otherwise that looks great!
Not sure why I didn't make this a Discussion to begin with, I'm going to blame it on being really tired. Edit: I see Gihub has a "Convert to discussion" option, but I don't know what "close and lock" is going to do (I assume it just means the issue and not the new discussion, but you never know).
Thanks @uzlonewolf - and please, don't get sick... get some rest!! 🤗
I see Gihub has a "Convert to discussion" option
No rush, but go ahead and try it. We can always recreate this if needed.
While looking into #278 I found a post in another project talking about how they needed to make sure the devices in the cloud project were configured for "Standard Instruction" instead of "DP Instruction" under "Control Instruction Mode." https://github.com/Xenomes/Domoticz-TinyTUYA-Plugin/issues/15#issuecomment-1419739027 I thought, you know, for our needs we might actually want to switch to that (much more raw) "DP Instruction." The attribute map at the bottom of the setting page looked promising as well with the missing DPs clearly not mapped to any "Standard Instruction" but every last one had a mapping when set to "DP Instruction." After switching to "DP Instruction" and waiting a few hours, guess what? The cloud calls now return every single DP for my thermostats and have accurate types, values, and states to boot!
So, if you want the Cloud calls to return *every* DP, change your Control Instruction Mode!