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

[Bug]: Thermostat is not detected automaticaly #319

Closed
3 tasks
salos1982 opened this issue Aug 3, 2024 · 18 comments
Closed
3 tasks

[Bug]: Thermostat is not detected automaticaly #319

salos1982 opened this issue Aug 3, 2024 · 18 comments
Labels
bug Something isn't working stale

Comments

@salos1982
Copy link

LocalTuya Version

2024.7.0

Home Assistant Version

2024.7.3

Environment

  • Does the device work using the Home Assistant Tuya Cloud component?
  • Is this device connected to another local integration, including Home Assistant and any other tools?
  • The devices are within the same HA subnet, and they get discovered automatically when I add them

What happened?

I bought 2 new thermostats and added them to Tuya account. But when I'm trying to add these devices I see only some strange device IDs that I haven't added.
image

There are no my devices in suggested devices. I made a screenshot from tuya developer
image

Steps to reproduce.

Open Local Tuya Integration
Click Setup
Choose setup new device

Relevant log output

No response

Diagnostics information.

No response

@salos1982 salos1982 added the bug Something isn't working label Aug 3, 2024
@xZetsubou
Copy link
Owner

I can see that it detected device but not sure, Post the entry diagnostics.

  • Have you tried to reload the integration?
  • Check the logs if there's an error message "search for localtuya in logs"

@salos1982
Copy link
Author

salos1982 commented Aug 5, 2024

home-assistant_localtuya_2024-08-05T08-52-35.607Z.log
After updating Home Assistant to 2024.7.4 and reloading the wrong entities disappeared but local tuya still does not see my thermostats.
There are no errors in logs

@xZetsubou
Copy link
Owner

Post the entry diagnostics

@salos1982
Copy link
Author

@xZetsubou
Copy link
Owner

Have you tried to add the device manually? From the discovered devices list select add device manually
then insert this bf4cd8b340a31d2fdfk8ww into device id field now in the name, ip, and localkey just instead any incorrect value for example xxxxxxxxx then click submit an error will shows up but the incorrect fields will be re-written with correct data. now in protocol version select "auto" then try to connect..

@salos1982
Copy link
Author

image
I found this thermostat ip in my router but I still have the same error
An unknown error occurred. [Errno 111] Connect call failed ('192.168.1.28', 6668).
Official Tuya addon see the thermostats.
The one thing that is quite interesting. When I try to check the connection to the thermostat from Tuya App it also could not reach the device but I can change temperature from the app.

@xZetsubou
Copy link
Owner

That is weird so basically the device doesn't expose it self locally? can you try to check if "6668" port is open on the device?

Using Powershell on windows: change 192.168.1.102 to your device ip

Test-NetConnection -ComputerName 192.168.1.102 -Port 6668

success results:

PS C:\WINDOWS\system32> Test-NetConnection -ComputerName 192.168.1.103 -Port 6668


ComputerName     : 192.168.1.103
RemoteAddress    : 192.168.1.103
RemotePort       : 6668
InterfaceAlias   : Ethernet
SourceAddress    : 192.168.1.18
TcpTestSucceeded : True

Also do you have the link product of your device?

@salos1982
Copy link
Author

WARNING : TCP connect to (192.168.1.28 : 6668) failed                                                             

ComputerName           : 192.168.1.28
RemoteAddress          : 192.168.1.28
RemotePort             : 6668
InterfaceAlias         : Ethernet
SourceAddress          : 192.168.1.20
PingSucceeded          : True
PingReplyDetails (RTT) : 943 ms
TcpTestSucceeded       : False

Link to Product

@xZetsubou
Copy link
Owner

If the device runs on batteries then it may be a low-power device so let's test if this is low-power device or not.

  1. Add the device with the correct inputs.
  2. in manual DPS add 0
  3. in Sleep time specify a number of average sleep device for the device to test use 86400 which is 1 day.
  4. Add the device.

It will probably goes to the next steps however if the status didn't shows up wait for the device to wake up and reports the status.
If it takes long time without updating the status on Home Assistant then something is off, however if the device running on batteries then it most likely low-power device.

@salos1982
Copy link
Author

image
I've set parameters like in the screenshot. However the same error

@xZetsubou
Copy link
Owner

I've set parameters like in the screenshot. However the same error

Try 3.4 protocol version instead of auto.

@salos1982
Copy link
Author

Changing protocol helps me to add the device but I have no data from it. Every sensor is disabled.
home-assistant_localtuya_2024-08-09T05-39-27.121Z.log

@xZetsubou
Copy link
Owner

If the sensors hasn't been updated for the whole day I no longer think this is a low-power device.

How did you set-up the device? Wifi-Direct or the device connected to Router? or Are you using Gateway?
Can you control the device using Cellular network away from the device?

@salos1982
Copy link
Author

I connected it with wifi. Nothing special, I switched to connection mode then in the Tuya app found the device and added it.
I have no hubs or gateways.
I probably need to switch to connection mode on the device.
I already added the devices using the official Tuya integration. Thanks for you work.

@Leo83-hash
Copy link

Leo83-hash commented Aug 10, 2024

I have the exact same issue. Did you manage to make your thermostat work?

I think it is just like PIR sensor, it must be added the exact same moment it connects to wifi, reporting its state. But in the case of this temperature/humidity sensor, I am not sure how to trigger the connection to add it in the right time.

In my case, both PIR and temp sensor are generic ones, bought from Aliexpress. They work with batteries.


I was mistaken, it is possible to connect to the device right away when putting batteries on it, but no data as salos1982 wrote before.

@salos1982
Copy link
Author

I have the exact same issue. Did you manage to make your thermostat work?

I think it is just like PIR sensor, it must be added the exact same moment it connects to wifi, reporting its state. But in the case of this temperature/humidity sensor, I am not sure how to trigger the connection to add it in the right time.

In my case, both PIR and temp sensor are generic ones, bought from Aliexpress. They work with batteries.

I was mistaken, it is possible to connect to the device right away when putting batteries on it, but no data as salos1982 wrote before.

No, I didn't manage. For me is ok to use a thermostat with online Tuya integration. I spent a lot of time trying to make it work.

@xZetsubou
Copy link
Owner

The issue is that the device it self reports that the port is closed #319 (comment) so I assumed that it low-power device, Also closed port can be happen if another connection is active with the device e.g. "smart life or any other Local integration"

I was mistaken, it is possible to connect to the device right away when putting batteries on it, but no data as salos1982 wrote before.

I have low-power device (Temperature & Humidity Sensor) I can connect to it when it wakes up however I don't do this always because If I know the IP of that device I can just add it and specify sleep time with 0 in manual DPS #319 (comment) now if the device wakes up later localtuya will update the entities,

Note: The low-power devices shows in discovered devices "even if it not connectable because it maybe is sleep" but salos1982 seems it devices not showing up at all this could happen only if the device is not connected directly to the router e.g. Wifi Direct or Bluetooth, or the port is closed because it busy.

To be honest I'm more confused why the device didn't get discovered instead of not connectable ^^ it should at least shows in discovered devices even after some hours.

Copy link

This issue is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 5 days.

@github-actions github-actions bot added the stale label Aug 27, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Sep 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working stale
Projects
None yet
Development

No branches or pull requests

3 participants