LocalTuya - Using Tuya IoT Platform to obtain not only Local Keys, but also DP (data point) IDs

struggling here

i get

trying to see my DP ID’s so i can setup in HA

Hi,

When I input my device id of my Tuya wifi water heater switch and click search, I get a message that says ‘no permission’. Is there any setting that is required that I might be missing?

Thanks.

i have the same problem with my Klarstein Kraftwerk Smart.
All other calls are working, but this one not.

OMG thank you!!! I was having an issue getting everything to work as well as it should, it felt like I was just randomly guessing which DPs to use when installing devices, particularly, as you said, RGB lights. Now I know the correct DPs to use, I’m getting full functionality out of them. I was also having an issue getting LocalTuya to add temp and humidity sensors. It could see them on the network but wasn’t installing them. Turns out LT wasn’t getting the DPs automatically from the sensors. As soon as I had the correct DPs it started installing them. I had searched for so long trying to find DP lists (stupidly thought that something so essential would be released by the manufacturer. Silly me :man_facepalming: lol) without any luck until I came across your post. Honestly can’t thank you enough for posting :+1:

3 Likes

@tomcoleman @moseslsy
Not sure if you solved your issue as your post was a couple of months ago but if not…
Did/do you still have access to the Tuya IoT Core API? When you sign up to the Tuya IoT website (for me at least) you only get a 14 day trial so you wouldn’t be able to get the DP data if that trial has expired. However you can request that Tuya extends your trial period. I requested and got a 6 month extension from Tuya. Just make sure you make it clear you are an individual setting up their HA smart home and you should get the extension and then you should be able to pull the DP IDs.

1 Like

i ditched it for something allot more simple which i got working in 30mins

If anyone is still struggling to get the DPS values for your Tuya devices, here is the link to the Tuya IOT page (Get Device Specification Attribute) which gives you all the DPS valus for a given device_id:

https://eu.iot.tuya.com/cloud/explorer?id=p1638267961021eedpq9&interfaceId=1455796956101095400

Thanks. I managed to stumble upon the correct link to obtain the list of DP IDs

1 Like

This doesn’t seem to work anymore. On both, the DP_ID is missing

It is still working for me today, Adam.

It is possible they made a change to their website, then reverted to previous website.

Check that you are accessing the correct Data Centre - I got a “device not exist” response before i remembered to change to central Europe (in my case, yours may be different).
Also that you are using the “Get Device Specification Attribute” menu entry with capital “D” and capital “S”.

1 Like

So some of the DPs I see on the tuya iot console aren’t available to be mapped in TuyaLocal. Does that mean the device itself is not (yet) supported.

In such a scenario, can I run TuyaLocal and Tuya’s native integration on the same HA instance?

Hello friends. Nice topic!
So, there is my story:
Bought a used IP camera and a really cheap (don’t blame me for that) tuya-based RF-433 alarm system.
Found out about HA and how awesome it is, so now I’m trying to integrate all these stuff in it.
Installed local-tuya via HACS.
Discovered how to query local-key via tuya iot cloud and started to setup things in local-tuya.
Several DPs were found and after testing I could setup all of them accordingly (arm mode, siren volume, SOS switch, and so on)
But something was missing and that was the most important thing: something that tells when the alarm fires! None of the entities were changing values on that case. So, after going back to tuya iot, like you guys did, I also found out how to query the DP list, the current values and the descriptions (some of them in Chinese but that’s fine). And there were 5 extra DP that were not listed by local-tuya: 110, 115,116,120,121.
121, that’s our guy. the “history”! Could check that this is the one that changes when alarm is fired!
So, I manually added this guy and the other missing ones in localtuya setup (it took a while for me to find out that if you manually add DPs after a first setup it won’t work! You have to erase your device, start the config from scratch and add your extra DPs from the very first time!)
Now that those guys are there, especially 121, and there is another challenge: They are strings! (maybe that’s why localtuya ignored them).
How do I interpret them? I Added them as numbers but that’s not what they are.
Moreover, even if I now how to interpret those strings and what they mean, how do I make it readable by local-tuya?

image

@AxeBro we may be facing similar scenarios (see my post above). Have you tried to manually add missing DP in the device config step?

they are base64 encoded strings that will decode to json if you’re lucky or to a hex string if you’re not

I’ve been having a similar, albeit slightly different, issue setting up sensors within HA and LocalTuya. The LocalTuya docs say they don’t support sensors atm (and I’ve noticed a sensors pyscript isn’t included in the integration folder), although some device sensors do show up automatically, if not always enabled, when you add a device that has other more easily readable DP’s.

If you are code proficient, you can always add an edited sensors pyscript file to the integration (you can find the template for this within the Tuya IoT SDK which you can download here…tuya-iot-py-sdk · PyPI (or you can download it with python command… pip3 install tuya-iot-py-sdk) (p.s. if you go down this route I’d definitely be interested in acquiring your work, if you’re happy to share it?)). If you’re not proficient enough at coding (I’m not proficient enough to start messing around with an otherwise working integration and potentially cause unintended conflicts etc), I believe (I’m having a slightly different DP sensor issue so haven’t tested this myself), you can use the ‘developers tools’ section to get HA to use the DP string data to fire an event, for example a notification or activating another device (such as setting an indoor camera to start recording or setting off an alarm). As I said, I haven’t needed to do this so I don’t have first-hand experience of using this successfully or otherwise, but I do believe that it’s possible if you’ve been able to add the DP to Home Assistant.

I’ve got both running on my HA, although the Tuya integration doesn’t seem to actually do anything, but my LocalTuya only works properly with Tuya installed too :man_shrugging:t3: no idea why, it’s been confusing me for a while lol

Hi, thanks for this. However, the DP’s for my lights at least, are slightly different. DP21 chooses which mode the light is in white/colour/scene etc. DP22, as you’ve said, is for brightness 1-1000. DP23 is the White colour temperature in 2700-8000k and DP24 is the colour shown when the light is in colour mode, displayed in Hex decimal code (you can Google to find the hex code to get the perfect colour settings or you can use the device colour wheel once you’ve added it to HA)

As others have said, LocalTuya doesn’t make things easy for you when you’re just starting out on your Home Assistant journey lol.

I’ve switch over from Local Tuya to Tuya Local, there are already so many device integrations, best of all if your device is not yet supported, just send a request to add. All devices use a YAML file which can be tinkered with if you really want, or send feedback with improvement suggestion.
Already, TUYA LOCAL supports devices that LOCAL TUYA can not support and will not be supporting.

Key point, need to delete local tuya device to config in TUYA LOCAL.

1 Like

Thanks adding it in didn’t seem to help… in the sense that I didn’t see it available as an option in the dropdown when selecting dp’s after adding manually.

Yes, the DP’s in the localtuya integration are a pain. I’ve stopped using it now too. I thought it would give me more control but it’s bizarrely more effort for less functionality. The Tuya integration is MUCH more user friendly, with none of device set up issues. Even sensors work perfectly in it.