Closed 9myzwb4eh closed 3 years ago
According to the error, the length of your local_key
is wrong. Verify that the key is correct.
@9myzwb4eh Did you manage to solve this?
Hi, I had bit of success where i didnt do anything (the initial error message for wrong deice id went away automatically) and it start showing up in entities (YAML entry), but the moment IP address changes ot becomes useless as i have to change ip on configuraiton. So i tried this mornign by setting it up from integration and it did show up but i think i am cofused about adding entities. The only entitity i add it as is switch and the values tha ti see in drop down are 0 or 11 (Screensshot attached here). I dont understand what DP means really in this context. Alos when i try to turn it on and off from entity nothing happens and the switch goes back to off position after few seconds. Please suggest.
Looks like it worked 👍 A DP is a short for "datapoint" and a Tuya device is basically a set of datapoints (DPS). Each datapoint (which is just a number) has a value assigned to it, e.g. a boolean like true or false, an integer like 500 or a string like "open". What each DP actually means/does depends on the hardware and can also be manufacturer specific. But there are standard sets with datapoints and what they are used for which is helpful.
In your case your device has two datapoints: 1 and 11. The first datapoint, 1, is normally the general state of the device. Since it's a plug in your case, it would signal if it's on or off (which indeed seems likely because it has a boolean value: False). What the other datapoint is for I don't know (but it's not related to power, they usually use 18-20).
So I think you have just configured your entity wrong and you can unfortunately not change the main ID of an entity. So I suggest that you remove your device, add it again, when you have picked to add a switch entity just fill in a friendly name and pick 1 as "ID". Leave the other fields empty. You don't have to add any more entities after that. Hopefully your switch should work now.
Oh, yeah. Forgot to talk about the IP problem. I have another PR open that will detect IP changes and solve that problem, have a look at #86. But you can also reserve an IP in your router.
Thanks for your response and explaination. I have tried setting both 1 or 11 on entitiy and none seems to turn switch off or on. Even if i am able to turn the netitiy sign on in lovelace nothing really happens. The log entires shows this.
2020-10-20 13:02:08 ERROR (SyncWorker_42) [custom_components.localtuya.common] Failed to set status of device 192.168.1.34 2020-10-20 13:09:41 ERROR (SyncWorker_42) [custom_components.localtuya.common] Failed to set status of device 192.168.1.34 2020-10-20 13:09:47 ERROR (SyncWorker_28) [custom_components.localtuya.common] Failed to set status of device 192.168.1.34 2020-10-20 13:09:54 ERROR (SyncWorker_8) [custom_components.localtuya.common] Failed to update status of device 192.168.1.34 2020-10-20 13:10:05 ERROR (SyncWorker_58) [custom_components.localtuya.common] Failed to set status of device 192.168.1.34 2020-10-20 13:12:40 ERROR (SyncWorker_60) [custom_components.localtuya.common] Failed to set status of device 192.168.1.34
Ignore my comment above..i deleted and re did the config (i think the entitiy id was set it to 11) and this time i set it to 1 and it works now. Thanks a lot for your help and time here....much appreciated.
I am seeing the below error in log after adding config in yaml file.
My config is as follows. I am using the ip address of the smart plug..not sur eif this should be the ip of home assistant host?