Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unhiding hidden Cloud DPs #280

Closed
uzlonewolf opened this issue Feb 9, 2023 · 5 comments
Closed

Unhiding hidden Cloud DPs #280

uzlonewolf opened this issue Feb 9, 2023 · 5 comments
Labels
documentation Improvements or additions to documentation tuya_iot_cloud Support questions for getting local key and Tuya Cloud APIs.

Comments

@uzlonewolf
Copy link
Collaborator

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." Xenomes/Domoticz-TinyTUYA-Plugin#15 (comment) 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!

@uzlonewolf uzlonewolf added documentation Improvements or additions to documentation tuya_iot_cloud Support questions for getting local key and Tuya Cloud APIs. labels Feb 9, 2023
@jasonacox
Copy link
Owner

jasonacox commented Feb 13, 2023

Is there a global way to set that? It looks like it is "per device" setting:

@uzlonewolf
Copy link
Collaborator Author

Not that I've found, which is annoying since my list of device types is rather long.

@jasonacox
Copy link
Owner

jasonacox commented Feb 13, 2023

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.

Tuya Cloud - DP Instruction Mode

How to get the full set up DPS values from Tuya Cloud.

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.

Step 1 - Log in to your account on iot.tuya.com

Step 2 - Navigate to "Cloud" -> "Development" then select your project.

Step 3 - Select "Devices" tab.

image

Step 4- Select the device types and click the the "pencil icon" to edit.

image

Step 5 - Select the "DP Instruction" box and "Save Configuration"

image

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.

Step 6 - Use TinyTuya to access the full set of DPS

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)

@uzlonewolf
Copy link
Collaborator Author

uzlonewolf commented Feb 13, 2023

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).

@jasonacox
Copy link
Owner

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.

Repository owner locked and limited conversation to collaborators Feb 13, 2023
@uzlonewolf uzlonewolf converted this issue into discussion #284 Feb 13, 2023

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
documentation Improvements or additions to documentation tuya_iot_cloud Support questions for getting local key and Tuya Cloud APIs.
Projects
None yet
Development

No branches or pull requests

2 participants