Skip to content
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

Problem adding Sub-Devices #61

Open
leofuscaldi opened this issue Apr 21, 2023 · 9 comments
Open

Problem adding Sub-Devices #61

leofuscaldi opened this issue Apr 21, 2023 · 9 comments

Comments

@leofuscaldi
Copy link

leofuscaldi commented Apr 21, 2023

Hi,

i came across following the trails left for the problem "Localtuya with Zigbee devices". My gateway is v3.4 so I had to go with your beta versions of 3.7 to add it and try to add sub-devices. I installed 3.7beta2 and managed to add my Zigbee Gateway. That was as far as I could get. Then I went for the last version available at moment, beta10, moved back to beta9... and in all I got the same problem when adding the sub-devices:
1 - I add a localtuya
2 - choose (sub-device)
3 - It shows a screen with the Parent Gateway selected. I put a name and the device ID. Didn't figure out yet what is this hw_version or where to get it. Even tried writing 3.3 and 3.4 but the outcome is the same: on the next screen, goes to Add Data Point saying that the detection failed and asking for a number. I found a post which tells me to go here https://us.iot.tuya.com/device/log, put the Device ID on the first field, select the correct datacenter and click on search. Then, when we click on Please input function point ID it lists the Datapoints. I manually added them to the settings but they don't pull any value from the modules.

How should I proceed now?

Have a large number of devices such as Light Switches (modules), Thermostat valves, Sensors (Temp/Hum, Water leak, door), and also some bluetooth devices, which I'd like to make their way to the localtuya platform and to my HA.

Thanks in advance

@alexualbu
Copy link

@leofuscaldi , you should use at least beta9 - then the only thing you need to add the sub-device is the cid: in the developer console (the site you used) go to Cloud/api explorer and use the Device information api where you enter your device id. From here grab the node_id
image

@leofuscaldi
Copy link
Author

Dear @alexualbu, indeed, it worked as you instructed, I could add all my zigbee devices. But some didn't work,

For the light switch modules modules, I have the ID's 1, 7 and 14 only and none of them Switches the light on/off, they just get the status of the light.

The water leak sensor, according what I found on tuya site, should have 3 entries, but only the one for the battery is being recognized.

The same with the Bluetooth Fingerbot, only have the value for the battery level.

All other worked.

Can I help anyhow with logs to have those working...?

@Anycubic
Copy link

@leofuscaldi please be aware that if you try to add a device right after you switched it on not all of the IDs are recognised, I guess it is due to how zigbee protocol works, same thing like yours happened to me with my TRV valves. I guess each ID value needs to be updated at least once before it can be recognised when adding a device, hope this helps.

@leofuscaldi
Copy link
Author

leofuscaldi commented Apr 23, 2023

@leofuscaldi please be aware that if you try to add a device right after you switched it on not all of the IDs are recognised, I guess it is due to how zigbee protocol works, same thing like yours happened to me with my TRV valves. I guess each ID value needs to be updated at least once before it can be recognised when adding a device, hope this helps.

Hi @Anycubic, i don't think it's my case. My devices are working for months already, but I've been using Smart life so far.... But thanks anyway for the suggestion!

@alexualbu
Copy link

@leofuscaldi , i can confirm what @Anycubic says - some devices to not advertise the status for DPs if they have not been touched in a while (i have TRVs same as him, and after a while if the value doesn't change they simply to dot appear in the payload when queried). You can have them appear after you touch them from smartlife or some other way. But don't forget that the DPs are detected when the device is first added in localtuya and saved in HA. You can validate what DPs are advertised by using a third party tool like tuyaapi-cli.
The lights might be a different story - there's a conversation in another issue with the same problem: light switch cannot be controlled. #39 (comment)

@leofuscaldi
Copy link
Author

For what I could test, I can Read status of almost everything I have on my Zigbee/Bluetooth Gateway, what I can't is control anything. Tried light (Zigbee) and a fingerbot (Bluetooth) and controling these devices wasn't possible. But for reading all devices, basically I just changed their values (Opened the door for door sensor, tampered the sensor for the Water Leak, forced changing the temperature on the T/H sensors and so on).

Hopefully soon we'll be able to also control lights and other devices.

@alexualbu
Copy link

@leofuscaldi - so you have tried tuya-cli?

@caco3
Copy link

caco3 commented Jun 21, 2023

** Deleted **
I had an old version installed, after updating to beta10 it goes one step further.
Now I hang at the data point issue (like #64)

@Gyosa3
Copy link

Gyosa3 commented Jul 6, 2023

Hi I got the data point issue when I was trying to register the sub device with the device ID in the config field "deviceID".

Here is what worked for me:

  • deleted the subdevice.
  • set the gateway correctly, with the right protocol (if it was changed for testing)
  • action all functions of the subdevice in the Tuya interface, to make sure all possible data points are updated recently.
  • REBOOT HA, not just reload Localtuya
  • add again the subdevice, using the node_id in the "device_id" configuration field in the UI. That's probably the mistake that most people do with this integration, as the node_id was not used before in any "legacy" LocalTuya as far as I know.

for me it worked, and it found all DPs and even more than advertised by the tuya dev portal !

All entities are created correctly and update well when device is manipulated in the Tuya app, however as reported in another issue my device cannot be controlled at this stage by HA directly for still obscure reasons.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants