Open remlei opened 2 months ago
Possibly related to this upstream bug: https://github.com/jasonacox/tinytuya/issues/472
this happens to me every time when I turn off the power of the device (lights) and then turn it back on, and I will have to reload the entry for the device otherwise TL would not be able to reconnect to the device.
Have you set the IP address and protocol version?
yup, both are set manually and not auto. I will observe more to see if it’s specific to certain protocol version or device
For what it's worth. In my situation it happens when the device is known/configured and worked in tuya-local but becomes unreachable. When disabeling this device in tuya-local, everything seems to return to 'nomal'' and my GUI is responsive again.
hi, having the same issues with three of my heatpumps. will implement a reload fix automation, happy to test / debug a fix, thanks
I think I have a similar problem with Tongou TO-Q-SY1-JWT. As long as it has an active load it doesn't seem to have a problem but when I remove the load (sometimes) the device becomes unavailable. @remlei could you post your automation code to reload the integration? Thanks
I think I have a similar problem with Tongou TO-Q-SY1-JWT. As long as it has an active load it doesn't seem to have a problem but when I remove the load (sometimes) the device becomes unavailable. @remlei could you post your automation code to reload the integration? Thanks
just use the Call Service "Home Assistant Core Integration: Reload config entry" and choose for Device as a target and look for a tuya device that your having problem with.
as for trigger, you can use any part of that tuya device that goes unavailable, in this case I used the "child lock" entity of the device as a trigger, if the state goes unavailable or unknown, execute a reload config call service action.
Just to mention, when the device goes unavailable in Tuya Local:
tinytuya wizard
I am currently working around this issue by using an entity template and adding redundancy (use Tuya Local if it's available, or use Tuya Cloud otherwise):
cover:
- platform: template
covers:
terreiro:
unique_id: 2c82abec-5be3-40a2-b8aa-76cbe9b067f8
friendly_name: Terreiro
device_class: garage
value_template: "{{ (not is_state('cover.terreiro_tuya_local', 'unavailable') and not is_state('cover.terreiro_tuya_local', 'closed')) or (not is_state('cover.terreiro_tuya_cloud', 'unavailable') and not is_state('cover.terreiro_tuya_cloud', 'closed')) }}"
availability_template: "{{ not is_state('cover.terreiro_tuya_local', 'unavailable') or not is_state('cover.terreiro_tuya_cloud', 'unavailable') }}"
open_cover:
if:
- condition: template
value_template: "{{ not is_state('cover.terreiro_tuya_local', 'unavailable') }}"
then:
- service: cover.toggle
target:
entity_id: cover.terreiro_tuya_local
else:
- service: cover.toggle
target:
entity_id: cover.terreiro_tuya_cloud
close_cover:
if:
- condition: template
value_template: "{{ not is_state('cover.terreiro', 'closed') }}"
then:
- if:
- condition: template
value_template: "{{ not is_state('cover.terreiro_tuya_local', 'unavailable') }}"
then:
- service: cover.toggle
target:
entity_id: cover.terreiro_tuya_local
else:
- service: cover.toggle
target:
entity_id: cover.terreiro_tuya_cloud
Describe the bug When a device sensors and switches goes Unavailable, tuya local seems to re-connect to the device with weird reconnection issue. First the device seems to get reconnected but a few seconds later, it goes to Unavailable again, this thing happens several times per minute. Tried debugging it if its a networking related issue but no, the AP sees the device still connected and able to ping the device just fine.
The only way to fix this issue is "reload" the device by going to Settings > Device & Services > Tuya Local > Your Device, after that click the 3 dot thingy beside the problematic device and click reload. Take note, even power cycling the device doesnt fix the issue more like it actually gets worse since it no longer able to reconnect to the device, unlike before it was able to connect to the device albeit it only last for a few seconds.
Currently the device is disconnected to the internet, making the device unblocked to the internet make no difference. No other smartphone app that can directly control the device, the only way to control this device is through home assistant, I only run the tuya app if I want to add a new device to my tuya account but after that the smart app gets deleted.
To Reproduce Unknown, The issue happens randomly.
Expected behavior If the device gets disconnected, local tuya should be able to reconnect to device without any issue.
Additional context
Device Diagnostic
Home Assistant Log related to the issue
Workaround:
Create a new automation based on device state, if the device goes unavailable, do a call service integration reload on specific problematic device.