rospogrigio / localtuya

local handling for Tuya devices
GNU General Public License v3.0
2.87k stars 552 forks source link

How to properly find values #1676

Open Bluscream opened 7 months ago

Bluscream commented 7 months ago

how the heck are we supposed to find these out?

Even with all the help i can get (looking at tuya cloud docs/device logs, trying to compare in-app values to these) there's no way i can even remotely understand which is what

it doesnt even auto update in the modal so i could compare the changes

lmdc45 commented 7 months ago

totally agree... For a Rinnai heat pump I have I used the tuya cloud api explorer device control > query properties, can gives something like: { "result": { "properties": [ { "code": "switch", "custom_name": "", "dp_id": 1, "time": 1708657219657, "value": true }, { "code": "mode", "custom_name": "", "dp_id": 2, "time": 1708844070632, "value": "Stand" }, { "code": "temp_set", "custom_name": "", "dp_id": 4, "time": 1708832808866, "value": 60 }, { "code": "defrost", "custom_name": "", "dp_id": 7, "time": 1708657219844, "value": false }, { "code": "water_set", "custom_name": "", "dp_id": 10, "time": 1708657219844, "value": 0 } which helps associate the data point Id with a meaning. However some are wrongs so use with caution not sure why it is not displayed here

Can get the cloud api explorer device control > query things data model as well, gives a bit extra details for instance for the select type it will list options.

I find it easier to back up and edit in the .storage/core.config_entries file directly as well (then restart ha) to make the config and sensors rather than using this UI

Also found that the device local key would change on each power off/power on of the device... so easier to update directly there as well

Bluscream commented 6 months ago

Any input on this, i think this is unacceptable, especially for non-savvy users

SpectrumTech commented 5 months ago

The comment above is the best way. The issue is that tuya devices all have different DP ids. Some devices, such as lights can be similar in nature, but still have different DP ids. You need to learn how to use the API explorer. With it and either the tuya or smart life app, you can reverse engineer what your device expects to see as far as DP ids and control values. If you can grab your local key, you can just as easily figure out how to make your device work with this integration. It's a lot of work, but Tuya has a lot of devices on their platform and it's kind of a mad house. How this integration works as well as it does is beyond me. You have to be a certain kind of crazy to want to drill down into something like this. Welcome to home automation!