tuya-local: Devices going into "unavailable" state
I noticed that my Tuya devices go into “unavailable” state. After reloading, integration is restored for some period.
Diagnostic for device that goes to unavailable state most often:
{
"home_assistant": {
"installation_type": "Home Assistant OS",
"version": "2023.4.6",
"dev": false,
"hassio": true,
"virtualenv": false,
"python_version": "3.10.10",
"docker": true,
"arch": "x86_64",
"timezone": "Europe/Vienna",
"os_name": "Linux",
"os_version": "6.1.24",
"supervisor": "2023.04.1",
"host_os": "Home Assistant OS 10.0",
"docker_version": "23.0.3",
"chassis": "vm",
"run_as_root": true
},
"custom_components": {
"alarmo": {
"version": "v1.9.9",
"requirements": []
},
"hacs": {
"version": "1.32.1",
"requirements": [
"aiogithubapi>=22.10.1"
]
},
"multiscrape": {
"version": "6.5.0",
"requirements": [
"lxml==4.9.1",
"beautifulsoup4==4.11.1"
]
},
"panasonic_cc": {
"version": "1.0.32",
"requirements": []
},
"powercalc": {
"version": "v1.5.1",
"requirements": [
"numpy>=1.21.1"
]
},
"tuya_local": {
"version": "2022.4.1",
"requirements": [
"pycryptodome~=3.17",
"tinytuya==1.12.4"
]
},
"webrtc": {
"version": "v3.1.0",
"requirements": []
},
"roborock": {
"version": "0.1.2",
"requirements": [
"python-roborock==0.1.7"
]
},
"browser_mod": {
"version": "2.2.1",
"requirements": []
},
"scheduler": {
"version": "v0.0.0",
"requirements": []
},
"watchman": {
"version": "0.5.1",
"requirements": [
"prettytable==3.0.0"
]
}
},
"integration_manifest": {
"domain": "tuya_local",
"name": "Tuya Local",
"codeowners": [
"@make-all"
],
"config_flow": true,
"dependencies": [],
"documentation": "https://github.com/make-all/tuya-local",
"integration_type": "device",
"iot_class": "local_push",
"issue_tracker": "https://github.com/make-all/tuya-local/issues",
"requirements": [
"pycryptodome~=3.17",
"tinytuya==1.12.4"
],
"version": "2022.4.1",
"is_built_in": false
},
"data": {
"name": "Beok TOL47 Main thermostat",
"type": "beok_tol47_thermostat",
"device_id": "**REDACTED**",
"local_key": "**REDACTED**",
"host": "**REDACTED**",
"protocol_version": "auto",
"api_version_set": 3.3,
"api_version_used": 3.3,
"api_working": true,
"status": {},
"cached_state": {
"updated_at": 1682549760.0076742,
"1": false,
"2": 150,
"3": 217,
"4": "cold",
"5": "0",
"8": false,
"13": true,
"16": 0,
"20": -18,
"21": 30,
"25": "1",
"26": false,
"31": false,
"41": "1",
"42": "1",
"101": false,
"105": 5,
"107": 5
},
"pending_state": {},
"connected": true,
"force_dps": [],
"home_assistant": {
"name": "Beok TOL47 Main thermostat",
"name_by_user": "Main Thermostat",
"disabled": false,
"disabled_by": null,
"entities": [
{
"disabled": false,
"disabled_by": null,
"entity_category": null,
"device_class": null,
"original_device_class": null,
"icon": null,
"unit_of_measurement": null,
"state": {
"entity_id": "climate.main_thermostat",
"state": "off",
"attributes": {
"hvac_modes": [
"auto",
"off",
"heat"
],
"min_temp": 5.0,
"max_temp": 95.0,
"target_temp_step": 0.5,
"preset_modes": [
"Program",
"Temporary",
"Manual"
],
"current_temperature": 21.7,
"temperature": 15.0,
"hvac_action": "off",
"preset_mode": "Manual",
"fault_code": 0,
"icon": "mdi:radiator-off",
"friendly_name": "Main Thermostat",
"supported_features": 17
},
"last_changed": "2023-04-26T09:56:54.371840+00:00",
"last_updated": "2023-04-26T09:56:54.371840+00:00"
}
},
{
"disabled": false,
"disabled_by": null,
"entity_category": "config",
"device_class": null,
"original_device_class": "switch",
"icon": null,
"unit_of_measurement": null,
"state": {
"entity_id": "switch.main_thermostat_anti_frost",
"state": "off",
"attributes": {
"device_class": "switch",
"icon": "mdi:snowflake-melt",
"friendly_name": "Main Thermostat Anti-frost"
},
"last_changed": "2023-04-26T09:56:54.370657+00:00",
"last_updated": "2023-04-26T09:56:54.370657+00:00"
}
},
{
"disabled": false,
"disabled_by": null,
"entity_category": "config",
"device_class": null,
"original_device_class": null,
"icon": null,
"unit_of_measurement": null,
"state": {
"entity_id": "select.main_thermostat_backlight_brightness",
"state": "Low",
"attributes": {
"options": [
"High",
"Low",
"None",
"Middle"
],
"icon": "mdi:lightbulb-on-40",
"friendly_name": "Main Thermostat Backlight brightness"
},
"last_changed": "2023-04-26T09:56:54.372413+00:00",
"last_updated": "2023-04-26T09:56:54.372413+00:00"
}
},
{
"disabled": false,
"disabled_by": null,
"entity_category": "config",
"device_class": null,
"original_device_class": null,
"icon": null,
"unit_of_measurement": "\u00b0C",
"state": {
"entity_id": "number.main_thermostat_calibration_offset",
"state": "-1.8",
"attributes": {
"min": -9.0,
"max": 9.0,
"step": 0.1,
"mode": "auto",
"unit_of_measurement": "\u00b0C",
"icon": "mdi:arrow-collapse-up",
"friendly_name": "Main Thermostat Calibration offset"
},
"last_changed": "2023-04-26T09:56:54.372816+00:00",
"last_updated": "2023-04-26T09:56:54.372816+00:00"
}
},
{
"disabled": false,
"disabled_by": null,
"entity_category": "config",
"device_class": null,
"original_device_class": null,
"icon": null,
"unit_of_measurement": null,
"state": {
"entity_id": "lock.main_thermostat_child_lock",
"state": "unlocked",
"attributes": {
"icon": "mdi:hand-back-right",
"friendly_name": "Main Thermostat Child lock",
"supported_features": 0
},
"last_changed": "2023-04-26T09:56:54.371102+00:00",
"last_updated": "2023-04-26T09:56:54.371102+00:00"
}
},
{
"disabled": false,
"disabled_by": null,
"entity_category": "config",
"device_class": null,
"original_device_class": "temperature",
"icon": null,
"unit_of_measurement": "\u00b0C",
"state": {
"entity_id": "number.main_thermostat_external_sensor_temperature_limit",
"state": "5",
"attributes": {
"min": 5,
"max": 60,
"step": 1.0,
"mode": "auto",
"unit_of_measurement": "\u00b0C",
"device_class": "temperature",
"icon": "mdi:arrow-collapse-up",
"friendly_name": "Main Thermostat External sensor temperature limit"
},
"last_changed": "2023-04-26T09:56:54.373413+00:00",
"last_updated": "2023-04-26T09:56:54.373413+00:00"
}
},
{
"disabled": false,
"disabled_by": null,
"entity_category": "diagnostic",
"device_class": null,
"original_device_class": "problem",
"icon": null,
"unit_of_measurement": null,
"state": {
"entity_id": "binary_sensor.main_thermostat_fault_alarm",
"state": "off",
"attributes": {
"device_class": "problem",
"friendly_name": "Main Thermostat Fault alarm"
},
"last_changed": "2023-04-26T09:56:54.370950+00:00",
"last_updated": "2023-04-26T09:56:54.370950+00:00"
}
},
{
"disabled": false,
"disabled_by": null,
"entity_category": "config",
"device_class": null,
"original_device_class": "temperature",
"icon": null,
"unit_of_measurement": "\u00b0C",
"state": {
"entity_id": "number.main_thermostat_high_temperature_limit",
"state": "30",
"attributes": {
"min": 15,
"max": 95,
"step": 1.0,
"mode": "auto",
"unit_of_measurement": "\u00b0C",
"device_class": "temperature",
"icon": "mdi:thermometer-chevron-up",
"friendly_name": "Main Thermostat High temperature limit"
},
"last_changed": "2023-04-26T09:56:54.373007+00:00",
"last_updated": "2023-04-26T09:56:54.373007+00:00"
}
},
{
"disabled": false,
"disabled_by": null,
"entity_category": "config",
"device_class": null,
"original_device_class": "switch",
"icon": null,
"unit_of_measurement": null,
"state": {
"entity_id": "switch.main_thermostat_output_main_reverse",
"state": "off",
"attributes": {
"device_class": "switch",
"icon": "mdi:swap-horizontal",
"friendly_name": "Main Thermostat Output main reverse"
},
"last_changed": "2023-04-26T09:56:54.370792+00:00",
"last_updated": "2023-04-26T09:56:54.370792+00:00"
}
},
{
"disabled": false,
"disabled_by": null,
"entity_category": "config",
"device_class": null,
"original_device_class": null,
"icon": null,
"unit_of_measurement": null,
"state": {
"entity_id": "select.main_thermostat_schedule",
"state": "Weekday+Weekend",
"attributes": {
"options": [
"Weekday+Weekend",
"Mon-Sat+Sun",
"Daily"
],
"icon": "mdi:calendar-clock",
"friendly_name": "Main Thermostat Schedule"
},
"last_changed": "2023-04-26T09:56:54.372593+00:00",
"last_updated": "2023-04-26T09:56:54.372593+00:00"
}
},
{
"disabled": false,
"disabled_by": null,
"entity_category": "config",
"device_class": null,
"original_device_class": null,
"icon": null,
"unit_of_measurement": null,
"state": {
"entity_id": "select.main_thermostat_sensor_selection",
"state": "Internal",
"attributes": {
"options": [
"Both",
"External",
"Internal"
],
"icon": "mdi:home-thermometer",
"friendly_name": "Main Thermostat Sensor selection"
},
"last_changed": "2023-04-26T09:56:54.372069+00:00",
"last_updated": "2023-04-26T09:56:54.372069+00:00"
}
},
{
"disabled": false,
"disabled_by": null,
"entity_category": "config",
"device_class": null,
"original_device_class": "switch",
"icon": null,
"unit_of_measurement": null,
"state": {
"entity_id": "switch.main_thermostat_sound",
"state": "on",
"attributes": {
"device_class": "switch",
"icon": "mdi:music-note",
"friendly_name": "Main Thermostat Sound"
},
"last_changed": "2023-04-26T09:56:54.370347+00:00",
"last_updated": "2023-04-26T09:56:54.370347+00:00"
}
},
{
"disabled": false,
"disabled_by": null,
"entity_category": "config",
"device_class": null,
"original_device_class": null,
"icon": null,
"unit_of_measurement": "\u00b0C",
"state": {
"entity_id": "number.main_thermostat_temperature_control_switch_difference",
"state": "0.5",
"attributes": {
"min": 0.5,
"max": 9.5,
"step": 0.1,
"mode": "auto",
"unit_of_measurement": "\u00b0C",
"icon": "mdi:thermometer-plus",
"friendly_name": "Main Thermostat Temperature control switch difference"
},
"last_changed": "2023-04-26T09:56:54.373224+00:00",
"last_updated": "2023-04-26T09:56:54.373224+00:00"
}
}
]
}
}
}
About this issue
- Original URL
- State: closed
- Created a year ago
- Reactions: 3
- Comments: 26 (4 by maintainers)
Commits related to this issue
- Bump tinytuya to 1.12.7 - Fix bug in detect_available_dps() to resolve issue where status() call for smartbulbs would randomly cause devices to turn off by @xgustavoh Should fix issue #688 Possibly ... — committed to make-all/tuya-local by make-all a year ago
- device.py: resist rotating api versions again When a device has been working using a protocol version, then any communication failures are unlikely to be due to a protocol version change. Such chang... — committed to make-all/tuya-local by make-all a year ago
I also have the same issue
i also have the same issue, the device randomly changes status to unknown and then to unavailable, restarting temporally fix the issue
The logger documentation is here: https://www.home-assistant.io/integrations/logger/ Tuya local is under
custom_components.tuya_local, for communication issues, probably just enabling debug oncustom_components.tuya_local.deviceis enough. The low level communication is handled bytinytuya, and you should be able to enable debug logging for that also if you cannot spot anything at the tuya-local level.I have the same issue with just one pool heat pump. @adamkoch which version you have used before (which was stable for you)? I have switched from local tuya to tuya local due to the device is supported out of the box but if it is not working reliable it will not be that useful. Is there any idea what we can try to log? I’m experiencing this behavior just after a while. The wifi connection to the pump is not the best so my guess is, that it has something to do with a reconnect of the pump. Perhaps the loss of connection is bringing the integration somehow to the limit?
I see this as well, it only started happening recently (last few days), likely related to upgrading tuya-local to latest.
I only have a single pool heater connected and HA shows it as offline - using the Tuya app (Cloud) to change the pool heater state makes the entity in HA come online again but then shortly after it will go offline again.