Open jlavazquez opened 3 years ago
I have the same problem
I have the same problem
Please, ¿can you attach Device info and Device specifications? It could help to resolve the issue faster.
https://github.com/tuya/tuya-home-assistant/wiki/How-to-get-the-log
I am also having this issue - in part. Mine always shows cleaning, however it will respond to commands issued through Home Assistant. I am using a Coredy R750 Vacuum.
2021-08-02 23:09:22 DEBUG (SyncWorker_10) [tuya iot] Response: {
"result": [
{
"active_time": 1627959991,
"biz_type": 0,
"category": "sd",
"create_time": 1596232156,
"icon": "smart/icon/ay1525342233337A874A/0872006bdc8ae539a320676a0346d79e.png",
"id": "eb3ea2300477a41c52zoeo",
"ip": "XX.XX.XX.XX",
"lat": "29.xxxxxxx",
"local_key": "XXXXXXXXXXXXXXXXX",
"lon": "-98.xxxxxx",
"model": "R750升级款",
"name": "Coredy R750",
"online": true,
"owner_id": "2922880",
"product_id": "eg0tdmbmozbtlzyg",
"product_name": "Coredy R750",
"status": [
{
"code": "power",
"value": true
},
{
"code": "mode",
"value": "chargego"
},
{
"code": "power_go",
"value": "false"
},
{
"code": "seek",
"value": false
}
],
"sub": false,
"time_zone": "-05:00",
"uid": "az1534286397934d3ZtS",
"update_time": 1627959994,
"uuid": "2d648902db762de9"
},
2021-08-02 23:09:22 DEBUG (SyncWorker_10) [tuya iot] Request: method = GET, url = https://openapi.tuyaus.com/v1.0/devices/eb3ea2300477a41c52zoeo/specifications, params = None, body = None, headers = {'client_id': 'XXXXXXXXXXX', 'sign': 'XXXXXXXXXXXXXXX', 'sign_method': 'HMAC-SHA256', 'access_token': 'XXXXXXXXXXXXXXXX', 't': '1627963762692', 'lang': 'en'}
2021-08-02 23:09:22 DEBUG (Thread-13) [tuya iot] _on_log: Sending CONNECT (u1, p1, wr0, wq0, wf0, c1, k60) client_id=b'cloud_adbf8101d06d757ab03e94da40534e54'
2021-08-02 23:09:22 DEBUG (Thread-14) [tuya iot] _on_log: Received CONNACK (0, 0)
2021-08-02 23:09:22 DEBUG (Thread-14) [tuya iot] connect flags->{'session present': 0}, rc->0
2021-08-02 23:09:22 DEBUG (Thread-14) [tuya iot] _on_log: Sending SUBSCRIBE (d0, m1) [(b'cloud/token/in/9fc59d699a803cb126d143e2befd581c', 0)]
2021-08-02 23:09:22 DEBUG (SyncWorker_10) [tuya iot] Response: {
"result": {
"category": "sd",
"functions": [
{
"code": "power",
"type": "Boolean",
"values": "{}"
},
{
"code": "mode",
"type": "Enum",
"values": "{\"range\":[\"random\",\"smart\",\"wall_follow\",\"chargego\"]}"
},
{
"code": "power_go",
"type": "Boolean",
"values": "{}"
},
{
"code": "seek",
"type": "Boolean",
"values": "{}"
}
],
"status": [
{
"code": "power",
"type": "Boolean",
"values": "{}"
},
{
"code": "mode",
"type": "Enum",
"values": "{\"range\":[\"random\",\"smart\",\"wall_follow\",\"chargego\"]}"
},
{
"code": "power_go",
"type": "Boolean",
"values": "{}"
},
{
"code": "seek",
"type": "Boolean",
"values": "{}"
}
]
},
"success": true,
"t": 1627963762786
}
Same problem
I am also having this issue - in part. Mine always shows cleaning, however it will respond to commands issued through Home Assistant. I am using a Coredy R750 Vacuum.
2021-08-02 23:09:22 DEBUG (SyncWorker_10) [tuya iot] Response: { "result": [ { "active_time": 1627959991, "biz_type": 0, "category": "sd", "create_time": 1596232156, "icon": "smart/icon/ay1525342233337A874A/0872006bdc8ae539a320676a0346d79e.png", "id": "eb3ea2300477a41c52zoeo", "ip": "XX.XX.XX.XX", "lat": "29.xxxxxxx", "local_key": "XXXXXXXXXXXXXXXXX", "lon": "-98.xxxxxx", "model": "R750升级款", "name": "Coredy R750", "online": true, "owner_id": "2922880", "product_id": "eg0tdmbmozbtlzyg", "product_name": "Coredy R750", "status": [ { "code": "power", "value": true }, { "code": "mode", "value": "chargego" }, { "code": "power_go", "value": "false" }, { "code": "seek", "value": false } ], "sub": false, "time_zone": "-05:00", "uid": "az1534286397934d3ZtS", "update_time": 1627959994, "uuid": "2d648902db762de9" },
2021-08-02 23:09:22 DEBUG (SyncWorker_10) [tuya iot] Request: method = GET, url = https://openapi.tuyaus.com/v1.0/devices/eb3ea2300477a41c52zoeo/specifications, params = None, body = None, headers = {'client_id': 'XXXXXXXXXXX', 'sign': 'XXXXXXXXXXXXXXX', 'sign_method': 'HMAC-SHA256', 'access_token': 'XXXXXXXXXXXXXXXX', 't': '1627963762692', 'lang': 'en'} 2021-08-02 23:09:22 DEBUG (Thread-13) [tuya iot] _on_log: Sending CONNECT (u1, p1, wr0, wq0, wf0, c1, k60) client_id=b'cloud_adbf8101d06d757ab03e94da40534e54' 2021-08-02 23:09:22 DEBUG (Thread-14) [tuya iot] _on_log: Received CONNACK (0, 0) 2021-08-02 23:09:22 DEBUG (Thread-14) [tuya iot] connect flags->{'session present': 0}, rc->0 2021-08-02 23:09:22 DEBUG (Thread-14) [tuya iot] _on_log: Sending SUBSCRIBE (d0, m1) [(b'cloud/token/in/9fc59d699a803cb126d143e2befd581c', 0)] 2021-08-02 23:09:22 DEBUG (SyncWorker_10) [tuya iot] Response: { "result": { "category": "sd", "functions": [ { "code": "power", "type": "Boolean", "values": "{}" }, { "code": "mode", "type": "Enum", "values": "{\"range\":[\"random\",\"smart\",\"wall_follow\",\"chargego\"]}" }, { "code": "power_go", "type": "Boolean", "values": "{}" }, { "code": "seek", "type": "Boolean", "values": "{}" } ], "status": [ { "code": "power", "type": "Boolean", "values": "{}" }, { "code": "mode", "type": "Enum", "values": "{\"range\":[\"random\",\"smart\",\"wall_follow\",\"chargego\"]}" }, { "code": "power_go", "type": "Boolean", "values": "{}" }, { "code": "seek", "type": "Boolean", "values": "{}" } ] }, "success": true, "t": 1627963762786 }
I also use the same vacuum and experiencing exactly same issues
Describe the bug Smart Life Tuya Vacuum always shows cleaning state. It doesn't update the device real state and doesn't work. The buttons are clickable but the vacuum don't do nothing. The vacuum works well trough Smart Life app.
@jlavazquez @iotinkognito @atomicpapa @DiGiSoUL84 This problem fixed in #427, can you try branch master again?
@dougiteixeira I sure will try. I'm assuming just delete the integration from Home Assistant and readd it?
I just tried the new code and it still doesn't work for me. Same behavior. The buttons can be clicked, but the vacuum cleaner does nothing.
The only difference I have seen are two "attributes" that did not appear before.
Tell me if you need more information.
I just tried the new code and it still doesn't work for me. Same behavior. The buttons can be clicked, but the vacuum cleaner does nothing.
The only difference I have seen are two "attributes" that did not appear before.
Tell me if you need more information.
This solves the problem of robot vacuum cleaning while at the dock. Button error depends on your robot's analysis.
@dougiteixeira I sure will try. I'm assuming just delete the integration from Home Assistant and readd it?
You must replace the config/custom_components/tuya_v2/
files with the master branch files.
@dougiteixeira I sure will try. I'm assuming just delete the integration from Home Assistant and readd it?
You must replace the
config/custom_components/tuya_v2/
files with the master branch files.
Finally got some time to do the changes as you instructed and I am stil experiencing the same problem. The vacuum works through the buttons and from automations but the status always shows "Cleaning". I replaced the tuya_v2 folder with the updated folder from v1.5.0, restarted HA, same status.
I even deleted the Integration, deleted the HACS integration, deleted the cloud project and started over just so that I had a clean slate. New project, new API client/secret, linked my Tuya app to the project, installed HACS integration, installed Tuya v2 Integration, added devices, and finally checked status of vacuum...still "Cleaning". Any suggestion??
I replaced the tuya_v2 folder with the updated folder from v1.5.0
You must replace the config/custom_components/tuya_v2/
files with the master branch files from this repository, not from version v1.5.0.
Replace replace the content of file config/custom_components/tuya_v2/vacuum.py
with this content.
I replaced the tuya_v2 folder with the updated folder from v1.5.0
You must replace the
config/custom_components/tuya_v2/
files with the master branch files from this repository, not from version v1.5.0.Replace replace the content of file
config/custom_components/tuya_v2/vacuum.py
with this content.
@dougiteixeira do I only replace the vacuum.py file? or others as well like manifest or any of the others? thank you for your help by the way!
I replaced the tuya_v2 folder with the updated folder from v1.5.0
You must replace the
config/custom_components/tuya_v2/
files with the master branch files from this repository, not from version v1.5.0.Replace replace the content of file
config/custom_components/tuya_v2/vacuum.py
with this content.
@dougiteixeira didnt work :( HELP~!
@DiGiSoUL84
do I only replace the vacuum.py file?
Yes, just the vacuum.py file would do it.
didnt work
Can you send your robot vacuum Standard Status Set in the debug device API IoT?
For example:
Code | Type | Values -- | -- | -- power | Boolean | "{true,false}" fault | Bitmap | { "label": [ "edge_sweep", "middle_sweep", "left_wheel", "right_wheel", "garbage_box", "land_check", "collision" ] } electricity_left | Integer | { "unit": "%", "min": 0, "max": 100, "scale": 0, "step": 1 } power_go | Boolean | "{true,false}" direction_control | Enum | { "range": [ "backward", "turn_left", "turn_right", "stop" ] } mode | Enum | { "range": [ "standby", "smart", "spiral", "single", "wall_follow", "chargego" ] } status | Enum | { "range": [ "standby", "sleep", "charging" ] } suction | Enum | { "range": [ "normal" ] } voice_switch | Boolean | "{true,false}" clean_area | Integer | { "unit": "", "min": 0, "max": 1000, "scale": 0, "step": 1 } clean_time | Integer | { "unit": "", "min": 0, "max": 300, "scale": 0, "step": 1 } clean_record | String | { "maxlen": 255 }I believe your vacuum does not have the status code implemented.
power | Boolean | "{true,false}" |
---|---|---|
mode | Enum | { "range": [ "random", "smart", "wall_follow", "chargego" ] } |
power_go | Boolean | "{true,false}" |
seek | Boolean | "{true,false}" |
power Boolean "{true,false}" mode Enum { "range": [ "random", "smart", "wall_follow", "chargego" ] } power_go Boolean "{true,false}" seek Boolean "{true,false}"
Without the status code it won't work in this integration, you can even create a custom code for you to replace manually, but it won't have all the features. :(
power Boolean "{true,false}" mode Enum { "range": [ "random", "smart", "wall_follow", "chargego" ] } power_go Boolean "{true,false}" seek Boolean "{true,false}"
Without the status code it won't work in this integration, you can even create a custom code for you to replace manually, but it won't have all the features. :(
@dougiteixeira well that sucks thank you for trying to help. So if custom code is made would have that status code?
I have the K2 vacuum and I have the same issue, that the vacuum always shows cleaning. But the commands (start, stop, return to base) work fine.
My workaround is adding a template vacuum:
vacuum:
- platform: template
vacuums:
arbeitszimmer_vacuum:
friendly_name: Staubsauger Arbeitszimmer
value_template: '{{ { "standby" : "docked", "smart" : "cleaning", "chargego" : "returning", "random" : "cleaning", "wall_follow" : "cleaning", "spiral" : "cleaning" }[states("select.tybf1b0c2ea9a9ec6a39b")] }}'
battery_level_template: '{{ state_attr("vacuum.tybf1b0c2ea9a9ec6a39b", "battery_level") }}'
start:
- service: vacuum.start
target:
entity_id: vacuum.tybf1b0c2ea9a9ec6a39b
stop:
- service: vacuum.stop
target:
entity_id: vacuum.tybf1b0c2ea9a9ec6a39b
return_to_base:
- service: vacuum.return_to_base
target:
entity_id: vacuum.tybf1b0c2ea9a9ec6a39b
Code | Type | Values |
---|---|---|
power | Boolean | "{true,false}" |
power_go | Boolean | "{true,false}" |
mode | Enum | { "range": [ "standby", "smart", "chargego", "random", "wall_follow", "spiral" ] } |
direction_control | Enum | { "range": [ "forward", "backward", "turn_left", "turn_right", "stop" ] } |
electricity_left | Integer | { "unit": "%", "min": 0, "max": 100, "scale": 0, "step": 1 } |
seek | Boolean | "{true,false}" |
clean_record | String | { "maxlen": 255 } |
clean_area | Integer | { "unit": "㎡", "min": 0, "max": 9999, "scale": 0, "step": 1 } |
clean_time | Integer | { "unit": "min", "min": 0, "max": 9999, "scale": 0, "step": 1 } |
fault | Bitmap | { "label": [ "edge_sweep", "middle_sweep", "left_wheel", "right_wheel", "garbage_box", "land_check", "collision" ] } |
@maweki nice I'm gonna try this!
@dougiteixeira I kept digging through the API device logs my vacuum reports dp ID's electricity, work status, time, brush material, and a few more. Work status reports docked, charging, ect. How can I get these reported values into the integration?
Yesterday, Home Assistant 2022.2 was released. Could you try upgrading to that version and see if the issue has been resolved?
If not, Home Assistant 2022.2 contains a new diagnostic tool. There is now a "Download Diagnostics" button on each Tuya device on the device page. Clicking that button will download diagnostics information for that specific device. Drag the downloaded file into this issue. It will help with finding out what the problem is.
@frenck vacuum status still show unknown. here is the diagnostics as requested
{
"home_assistant": {
"installation_type": "Home Assistant Supervised",
"version": "2022.2.0",
"dev": false,
"hassio": true,
"virtualenv": false,
"python_version": "3.9.7",
"docker": true,
"arch": "x86_64",
"timezone": "America/New_York",
"os_name": "Linux",
"os_version": "5.16.0-rc5-amd64",
"supervisor": "2022.01.1",
"host_os": "Debian GNU/Linux 11 (bullseye)",
"docker_version": "20.10.12",
"chassis": "laptop",
"run_as_root": true
},
"custom_components": {
"google_home": {
"version": "1.9.4",
"requirements": [
"glocaltokens==0.5.2"
]
},
"composite": {
"version": "2.2.0",
"requirements": []
},
"breaking_changes": {
"version": "21.12.0",
"requirements": [
"pyhaversion>=21.3.0",
"integrationhelper>=0.2.2",
"awesomeversion"
]
},
"netgear_enhanced": {
"version": "1.0.0",
"requirements": [
"pynetgear-enhanced==0.2.2"
]
},
"spotcast": {
"version": "v3.6.24",
"requirements": [
"spotify_token==1.0.0"
]
},
"hacs": {
"version": "1.21.0",
"requirements": [
"aiogithubapi>=21.11.0"
]
},
"remote_homeassistant": {
"version": "3.6",
"requirements": []
},
"pirateweather": {
"version": "0.1.0",
"requirements": [
"python-forecastio==1.4.0"
]
},
"adaptive_lighting": {
"version": "1.0.14",
"requirements": []
},
"shopping_list": {
"version": "0.5",
"requirements": []
},
"pyscript": {
"version": "1.3.2",
"requirements": [
"croniter==1.0.2",
"watchdog==2.0.3"
]
},
"anniversaries": {
"version": "4.5.0",
"requirements": [
"python-dateutil>=2.8.1",
"integrationhelper>=0.2.2",
"voluptuous>=0.12.1"
]
},
"schedule_state": {
"version": "0.12.0",
"requirements": [
"portion"
]
},
"fontawesome": {
"version": "2.1.5",
"requirements": []
},
"nodered": {
"version": "1.0.6",
"requirements": []
},
"sleep_as_android": {
"version": "1.7.0",
"requirements": []
},
"variable": {
"version": "2.2.1",
"requirements": []
},
"timer": {
"version": "2021.3.2",
"requirements": []
}
},
"integration_manifest": {
"domain": "tuya",
"name": "Tuya",
"documentation": "https://www.home-assistant.io/integrations/tuya",
"requirements": [
"tuya-iot-py-sdk==0.6.6"
],
"dependencies": [
"ffmpeg"
],
"codeowners": [
"@Tuya",
"@zlinoliver",
"@METISU",
"@frenck"
],
"config_flow": true,
"iot_class": "cloud_push",
"dhcp": [
{
"macaddress": "105A17*"
},
{
"macaddress": "10D561*"
},
{
"macaddress": "1869D8*"
},
{
"macaddress": "381F8D*"
},
{
"macaddress": "508A06*"
},
{
"macaddress": "68572D*"
},
{
"macaddress": "708976*"
},
{
"macaddress": "7CF666*"
},
{
"macaddress": "84E342*"
},
{
"macaddress": "D4A651*"
},
{
"macaddress": "D81F12*"
}
],
"is_built_in": true
},
"data": {
"endpoint": "https://openapi.tuyaus.com",
"auth_type": 0,
"country_code": "1",
"app_type": "tuyaSmart",
"mqtt_connected": true,
"disabled_by": null,
"disabled_polling": false,
"name": "Vacuum Thing",
"model": null,
"category": "sd",
"product_id": "eg0tdmbmozbtlzyg",
"product_name": "Coredy R750",
"online": true,
"sub": false,
"time_zone": "-05:00",
"active_time": "2022-01-27T06:19:27+00:00",
"create_time": "2021-03-22T17:24:18+00:00",
"update_time": "2022-01-27T06:19:32+00:00",
"function": {
"power": {
"type": "Boolean",
"value": {}
},
"mode": {
"type": "Enum",
"value": {
"range": [
"random",
"smart",
"wall_follow",
"chargego"
]
}
},
"power_go": {
"type": "Boolean",
"value": {}
},
"seek": {
"type": "Boolean",
"value": {}
}
},
"status_range": {
"power": {
"type": "Boolean",
"value": {}
},
"mode": {
"type": "Enum",
"value": {
"range": [
"random",
"smart",
"wall_follow",
"chargego"
]
}
},
"power_go": {
"type": "Boolean",
"value": {}
},
"seek": {
"type": "Boolean",
"value": {}
}
},
"status": {
"power": true,
"mode": "chargego",
"power_go": false,
"seek": false
},
"home_assistant": {
"name": "Vacuum Thing",
"name_by_user": null,
"disabled": false,
"disabled_by": null,
"entities": [
{
"disabled": false,
"disabled_by": null,
"entity_category": "config",
"device_class": null,
"original_device_class": "tuya__vacuum_mode",
"icon": null,
"original_icon": "mdi:layers-outline",
"unit_of_measurement": null,
"state": {
"entity_id": "select.vacuum_thing_mode",
"state": "chargego",
"attributes": {
"options": [
"random",
"smart",
"wall_follow",
"chargego"
],
"device_class": "tuya__vacuum_mode",
"icon": "mdi:layers-outline",
"friendly_name": "Vacuum Thing Mode"
},
"last_changed": "2022-02-03T07:21:53.383547+00:00",
"last_updated": "2022-02-03T07:21:53.383547+00:00"
}
},
{
"disabled": false,
"disabled_by": null,
"entity_category": null,
"device_class": null,
"original_device_class": null,
"icon": null,
"original_icon": null,
"unit_of_measurement": null,
"state": {
"entity_id": "vacuum.vacuum_thing",
"state": "unknown",
"attributes": {
"friendly_name": "Vacuum Thing",
"supported_features": 8987
},
"last_changed": "2022-02-03T07:21:53.384351+00:00",
"last_updated": "2022-02-03T07:21:53.384351+00:00"
}
}
]
}
}
}
@DiGiSoUL84 What would you describe the state of your vacuum cleaner, at the very moment you took that diagnostics? Was it charging at the dock? Or was it returning to the dock?
@DiGiSoUL84 What would you describe the state of your vacuum cleaner, at the very moment you took that diagnostics? Was it charging at the dock? Or was it returning to the dock?
It was docked.
I have never been able to get a true status in HA. If I pull the device logs in the tuya iot API the dp's show charging, docked, ect all the correct info but it's like it's not exposing that info to HA.
I can send screenshots of these if needed
So lets say, you send it out to vacuum, could you provide diagnostics while it's vacuuming?
{
"home_assistant": {
"installation_type": "Home Assistant Supervised",
"version": "2022.2.0",
"dev": false,
"hassio": true,
"virtualenv": false,
"python_version": "3.9.7",
"docker": true,
"arch": "x86_64",
"timezone": "America/New_York",
"os_name": "Linux",
"os_version": "5.16.0-rc5-amd64",
"supervisor": "2022.01.1",
"host_os": "Debian GNU/Linux 11 (bullseye)",
"docker_version": "20.10.12",
"chassis": "laptop",
"run_as_root": true
},
"custom_components": {
"google_home": {
"version": "1.9.4",
"requirements": [
"glocaltokens==0.5.2"
]
},
"composite": {
"version": "2.2.0",
"requirements": []
},
"breaking_changes": {
"version": "21.12.0",
"requirements": [
"pyhaversion>=21.3.0",
"integrationhelper>=0.2.2",
"awesomeversion"
]
},
"netgear_enhanced": {
"version": "1.0.0",
"requirements": [
"pynetgear-enhanced==0.2.2"
]
},
"spotcast": {
"version": "v3.6.24",
"requirements": [
"spotify_token==1.0.0"
]
},
"hacs": {
"version": "1.21.0",
"requirements": [
"aiogithubapi>=21.11.0"
]
},
"remote_homeassistant": {
"version": "3.6",
"requirements": []
},
"pirateweather": {
"version": "0.1.0",
"requirements": [
"python-forecastio==1.4.0"
]
},
"adaptive_lighting": {
"version": "1.0.14",
"requirements": []
},
"shopping_list": {
"version": "0.5",
"requirements": []
},
"pyscript": {
"version": "1.3.2",
"requirements": [
"croniter==1.0.2",
"watchdog==2.0.3"
]
},
"anniversaries": {
"version": "4.5.0",
"requirements": [
"python-dateutil>=2.8.1",
"integrationhelper>=0.2.2",
"voluptuous>=0.12.1"
]
},
"schedule_state": {
"version": "0.12.0",
"requirements": [
"portion"
]
},
"fontawesome": {
"version": "2.1.5",
"requirements": []
},
"nodered": {
"version": "1.0.6",
"requirements": []
},
"sleep_as_android": {
"version": "1.7.0",
"requirements": []
},
"variable": {
"version": "2.2.1",
"requirements": []
},
"timer": {
"version": "2021.3.2",
"requirements": []
}
},
"integration_manifest": {
"domain": "tuya",
"name": "Tuya",
"documentation": "https://www.home-assistant.io/integrations/tuya",
"requirements": [
"tuya-iot-py-sdk==0.6.6"
],
"dependencies": [
"ffmpeg"
],
"codeowners": [
"@Tuya",
"@zlinoliver",
"@METISU",
"@frenck"
],
"config_flow": true,
"iot_class": "cloud_push",
"dhcp": [
{
"macaddress": "105A17*"
},
{
"macaddress": "10D561*"
},
{
"macaddress": "1869D8*"
},
{
"macaddress": "381F8D*"
},
{
"macaddress": "508A06*"
},
{
"macaddress": "68572D*"
},
{
"macaddress": "708976*"
},
{
"macaddress": "7CF666*"
},
{
"macaddress": "84E342*"
},
{
"macaddress": "D4A651*"
},
{
"macaddress": "D81F12*"
}
],
"is_built_in": true
},
"data": {
"endpoint": "https://openapi.tuyaus.com",
"auth_type": 0,
"country_code": "1",
"app_type": "tuyaSmart",
"mqtt_connected": true,
"disabled_by": null,
"disabled_polling": false,
"name": "Vacuum Thing",
"model": null,
"category": "sd",
"product_id": "eg0tdmbmozbtlzyg",
"product_name": "Coredy R750",
"online": true,
"sub": false,
"time_zone": "-05:00",
"active_time": "2022-01-27T06:19:27+00:00",
"create_time": "2021-03-22T17:24:18+00:00",
"update_time": "2022-01-27T06:19:32+00:00",
"function": {
"power": {
"type": "Boolean",
"value": {}
},
"mode": {
"type": "Enum",
"value": {
"range": [
"random",
"smart",
"wall_follow",
"chargego"
]
}
},
"power_go": {
"type": "Boolean",
"value": {}
},
"seek": {
"type": "Boolean",
"value": {}
}
},
"status_range": {
"power": {
"type": "Boolean",
"value": {}
},
"mode": {
"type": "Enum",
"value": {
"range": [
"random",
"smart",
"wall_follow",
"chargego"
]
}
},
"power_go": {
"type": "Boolean",
"value": {}
},
"seek": {
"type": "Boolean",
"value": {}
}
},
"status": {
"power": true,
"mode": "smart",
"power_go": true,
"seek": false
},
"home_assistant": {
"name": "Vacuum Thing",
"name_by_user": null,
"disabled": false,
"disabled_by": null,
"entities": [
{
"disabled": false,
"disabled_by": null,
"entity_category": "config",
"device_class": null,
"original_device_class": "tuya__vacuum_mode",
"icon": null,
"original_icon": "mdi:layers-outline",
"unit_of_measurement": null,
"state": {
"entity_id": "select.vacuum_thing_mode",
"state": "smart",
"attributes": {
"options": [
"random",
"smart",
"wall_follow",
"chargego"
],
"device_class": "tuya__vacuum_mode",
"icon": "mdi:layers-outline",
"friendly_name": "Vacuum Thing Mode"
},
"last_changed": "2022-02-03T16:08:12.688814+00:00",
"last_updated": "2022-02-03T16:08:12.688814+00:00"
}
},
{
"disabled": false,
"disabled_by": null,
"entity_category": null,
"device_class": null,
"original_device_class": null,
"icon": null,
"original_icon": null,
"unit_of_measurement": null,
"state": {
"entity_id": "vacuum.vacuum_thing",
"state": "unknown",
"attributes": {
"friendly_name": "Vacuum Thing",
"supported_features": 8987
},
"last_changed": "2022-02-03T07:21:53.384351+00:00",
"last_updated": "2022-02-03T07:21:53.384351+00:00"
}
}
]
}
}
}
and this is when its returning to dock
{
"home_assistant": {
"installation_type": "Home Assistant Supervised",
"version": "2022.2.0",
"dev": false,
"hassio": true,
"virtualenv": false,
"python_version": "3.9.7",
"docker": true,
"arch": "x86_64",
"timezone": "America/New_York",
"os_name": "Linux",
"os_version": "5.16.0-rc5-amd64",
"supervisor": "2022.01.1",
"host_os": "Debian GNU/Linux 11 (bullseye)",
"docker_version": "20.10.12",
"chassis": "laptop",
"run_as_root": true
},
"custom_components": {
"google_home": {
"version": "1.9.4",
"requirements": [
"glocaltokens==0.5.2"
]
},
"composite": {
"version": "2.2.0",
"requirements": []
},
"breaking_changes": {
"version": "21.12.0",
"requirements": [
"pyhaversion>=21.3.0",
"integrationhelper>=0.2.2",
"awesomeversion"
]
},
"netgear_enhanced": {
"version": "1.0.0",
"requirements": [
"pynetgear-enhanced==0.2.2"
]
},
"spotcast": {
"version": "v3.6.24",
"requirements": [
"spotify_token==1.0.0"
]
},
"hacs": {
"version": "1.21.0",
"requirements": [
"aiogithubapi>=21.11.0"
]
},
"remote_homeassistant": {
"version": "3.6",
"requirements": []
},
"pirateweather": {
"version": "0.1.0",
"requirements": [
"python-forecastio==1.4.0"
]
},
"adaptive_lighting": {
"version": "1.0.14",
"requirements": []
},
"shopping_list": {
"version": "0.5",
"requirements": []
},
"pyscript": {
"version": "1.3.2",
"requirements": [
"croniter==1.0.2",
"watchdog==2.0.3"
]
},
"anniversaries": {
"version": "4.5.0",
"requirements": [
"python-dateutil>=2.8.1",
"integrationhelper>=0.2.2",
"voluptuous>=0.12.1"
]
},
"schedule_state": {
"version": "0.12.0",
"requirements": [
"portion"
]
},
"fontawesome": {
"version": "2.1.5",
"requirements": []
},
"nodered": {
"version": "1.0.6",
"requirements": []
},
"sleep_as_android": {
"version": "1.7.0",
"requirements": []
},
"variable": {
"version": "2.2.1",
"requirements": []
},
"timer": {
"version": "2021.3.2",
"requirements": []
}
},
"integration_manifest": {
"domain": "tuya",
"name": "Tuya",
"documentation": "https://www.home-assistant.io/integrations/tuya",
"requirements": [
"tuya-iot-py-sdk==0.6.6"
],
"dependencies": [
"ffmpeg"
],
"codeowners": [
"@Tuya",
"@zlinoliver",
"@METISU",
"@frenck"
],
"config_flow": true,
"iot_class": "cloud_push",
"dhcp": [
{
"macaddress": "105A17*"
},
{
"macaddress": "10D561*"
},
{
"macaddress": "1869D8*"
},
{
"macaddress": "381F8D*"
},
{
"macaddress": "508A06*"
},
{
"macaddress": "68572D*"
},
{
"macaddress": "708976*"
},
{
"macaddress": "7CF666*"
},
{
"macaddress": "84E342*"
},
{
"macaddress": "D4A651*"
},
{
"macaddress": "D81F12*"
}
],
"is_built_in": true
},
"data": {
"endpoint": "https://openapi.tuyaus.com",
"auth_type": 0,
"country_code": "1",
"app_type": "tuyaSmart",
"mqtt_connected": true,
"disabled_by": null,
"disabled_polling": false,
"name": "Vacuum Thing",
"model": null,
"category": "sd",
"product_id": "eg0tdmbmozbtlzyg",
"product_name": "Coredy R750",
"online": true,
"sub": false,
"time_zone": "-05:00",
"active_time": "2022-01-27T06:19:27+00:00",
"create_time": "2021-03-22T17:24:18+00:00",
"update_time": "2022-01-27T06:19:32+00:00",
"function": {
"power": {
"type": "Boolean",
"value": {}
},
"mode": {
"type": "Enum",
"value": {
"range": [
"random",
"smart",
"wall_follow",
"chargego"
]
}
},
"power_go": {
"type": "Boolean",
"value": {}
},
"seek": {
"type": "Boolean",
"value": {}
}
},
"status_range": {
"power": {
"type": "Boolean",
"value": {}
},
"mode": {
"type": "Enum",
"value": {
"range": [
"random",
"smart",
"wall_follow",
"chargego"
]
}
},
"power_go": {
"type": "Boolean",
"value": {}
},
"seek": {
"type": "Boolean",
"value": {}
}
},
"status": {
"power": true,
"mode": "chargego",
"power_go": true,
"seek": false
},
"home_assistant": {
"name": "Vacuum Thing",
"name_by_user": null,
"disabled": false,
"disabled_by": null,
"entities": [
{
"disabled": false,
"disabled_by": null,
"entity_category": "config",
"device_class": null,
"original_device_class": "tuya__vacuum_mode",
"icon": null,
"original_icon": "mdi:layers-outline",
"unit_of_measurement": null,
"state": {
"entity_id": "select.vacuum_thing_mode",
"state": "chargego",
"attributes": {
"options": [
"random",
"smart",
"wall_follow",
"chargego"
],
"device_class": "tuya__vacuum_mode",
"icon": "mdi:layers-outline",
"friendly_name": "Vacuum Thing Mode"
},
"last_changed": "2022-02-03T16:09:19.365015+00:00",
"last_updated": "2022-02-03T16:09:19.365015+00:00"
}
},
{
"disabled": false,
"disabled_by": null,
"entity_category": null,
"device_class": null,
"original_device_class": null,
"icon": null,
"original_icon": null,
"unit_of_measurement": null,
"state": {
"entity_id": "vacuum.vacuum_thing",
"state": "unknown",
"attributes": {
"friendly_name": "Vacuum Thing",
"supported_features": 8987
},
"last_changed": "2022-02-03T07:21:53.384351+00:00",
"last_updated": "2022-02-03T07:21:53.384351+00:00"
}
}
]
}
}
}
Thank you for that!
I've opened up https://github.com/home-assistant/core/pull/65567 That should fix your issue.
But isn't this problem the lack of DPCODE STATUS on the device? The status added appear to be the DPCODE MODE which is not taken into account to define the status of the vacuum entity.
You are absolutely right @dougiteixeira
Re-opened the issue
@frenck @dougiteixeira just wanted to say thank you guys for helping me out with this! Am I correct in thinking that this new fix will just be added into the next update? Or is there an updated .py file I need to add? Not sure how this part works. Thanks again guys!!
Am I correct in thinking that this new fix will just be added into the next update?
Yes, that has been added in 2022.2.1, however, as pointed out by @dougiteixeira it won't fix your issue, as we don't take the mode data point into account. Hence, I've re-opened the issue.
Or is there an updated .py file I need to add? Not sure how this part works.
Nah, nothing like that, I code on Home Assistant Core, so stuff will be part of the normal releases (and their patch releases).
Am I correct in thinking that this new fix will just be added into the next update?
Yes, that has been added in 2022.2.1, however, as pointed out by @dougiteixeira it won't fix your issue, as we don't take the mode data point into account. Hence, I've re-opened the issue.
Or is there an updated .py file I need to add? Not sure how this part works.
Nah, nothing like that, I code on Home Assistant Core, so stuff will be part of the normal releases (and their patch releases).
Cool deal! Thank you sir! I will patiently wait for your magic
@frenck Got another question if you don't mind. I'm trying to understand the code better. What do you think the fix for my issue could be? As it's been pointed out the mode data points that my device is using aren't used on the HA side. Could it be something as simple as adding these data points to HA?
Could it be something as simple as adding these data points to HA?
Yes, however, the mode
datapoints works differently compared to switched for all these features mode provides. So, that requires some refactoring of the vacuum platform in the Tuya integration.
Yes, however, the
mode
datapoints works differently compared to switched for all these features mode provides. So, that requires some refactoring of the vacuum platform in the Tuya integration.
Gotcha.
Digging through the API Explorer on Tuya IOT there are other datapoints that my device reports: work_status -> STANDBY, CLEANING, DOCKED, CHARGING, FULLY CHARGED electricity -> battery level suction LV -> MAX, SMARTBOOSTER
would it be helpful if i sent over this data?
@frenck
Device Specifications {```
"result": { "category": "sd", "functions": [ { "code": "power", "lang_config": { "false": "Off", "true": "On" }, "name": "power", "type": "Boolean", "values": "{}" }, { "code": "mode", "lang_config": { "chargego": "Home", "random": "RANDOM", "smart": "AUTO", "wall_follow": "EDGE" }, "name": "Clean Mode", "type": "Enum", "values": "{\"range\":[\"random\",\"smart\",\"wall_follow\",\"chargego\"]}" }, { "code": "power_go", "lang_config": { "false": "", "true": "" }, "name": "", "type": "Boolean", "values": "{}" }, { "code": "seek", "lang_config": { "false": "", "true": "Determine" }, "name": "Find me", "type": "Boolean", "values": "{}" } ], "status": [ { "code": "power", "lang_config": { "false": "Off", "true": "On" }, "name": "power", "type": "Boolean", "values": "{}" }, { "code": "mode", "lang_config": { "chargego": "Home", "random": "RANDOM", "smart": "AUTO", "wall_follow": "EDGE" }, "name": "Clean Mode", "type": "Enum", "values": "{\"range\":[\"random\",\"smart\",\"wall_follow\",\"chargego\"]}" }, { "code": "power_go", "lang_config": { "false": "", "true": "" }, "name": "", "type": "Boolean", "values": "{}" }, { "code": "seek", "lang_config": { "false": "", "true": "Determine" }, "name": "Find me", "type": "Boolean", "values": "{}" } ] }, "success": true, "t": 1644034201941 }
@frenck
@DiGiSoUL84 All that data is already in the diagnostics download you've shared 😉
@DiGiSoUL84 All that data is already in the diagnostics download you've shared 😉
*Picard face palm
@frenck just wondering if you had any update? I know you are busy with everything and I don't want to be a bother just curious 🤠
I do not have an update, or else you would have seen it...
Sorry for the necro. I'm trying to configue a bluebot extreme via local tuya and I also have this problem. Any updates since last year on this issue?
Describe the bug Smart Life Tuya Vacuum always shows cleaning state. It doesn't update the device real state and doesn't work. The buttons are clickable but the vacuum don't do nothing. The vacuum works well trough Smart Life app.
Screenshots
Home Assistant Version core-2021.7.4 supervisor-2021.06.8 Home Assistant OS 6.1
**Device info
{ "active_time": 1627328843, "biz_type": 18, "category": "sd", "create_time": 1569953605, "icon": "smart/icon/1545007731p6el2x2a3np_0.png", "id": "XXXXXXXXXX", "ip": "XXXXXXXXXX", "lat": "XXXXXXXXXXXX", "local_key": "XXXXXXXXXX", "lon": "XXXXXXXXXX", "model": "Conga S1099", "name": "Conga", "online": true, "owner_id": "6497291", "product_id": "j6wUila5MykirOYY", "product_name": "S1099", "status": [ { "code": "power", "value": true }, { "code": "mode", "value": "standby" }, { "code": "direction_control", "value": "stop" }, { "code": "electricity_left", "value": 100 }, { "code": "edge_brush", "value": 0 }, { "code": "roll_brush", "value": 22 }, { "code": "filter", "value": 0 }, { "code": "power_go", "value": "0" }, { "code": "reset_edge_brush", "value": false }, { "code": "reset_roll_brush", "value": false }, { "code": "reset_filter", "value": false }, { "code": "seek", "value": false }, { "code": "clean_record", "value": "2021072611000011234543" }
**Device specifications
(2021-07-28 22:33:53 DEBUG (SyncWorker_2) [tuya iot] Request: method = GET, url = https://openapi.tuyaeu.com/v1.0/devices/bfe69d108f93434339rwrh/specifications, params = None, body = None, headers = {'client_id': 'umwvuxy5arq2tjyri5nv', 'sign': '36AC60A23558C4D4A062EF80EB47FC2EF555C5222C6447E91E5F5C47A97EB208', 'sign_method': 'HMAC-SHA256', 'access_token': 'dd90b8422d93cc9b9b9f32f23ecf6d92', 't': '1627504433606', 'lang': 'en'} 2021-07-28 22:33:53 DEBUG (SyncWorker_2) [tuya iot] Response: { "result": { "category": "sd", "functions": [ { "code": "power", "type": "Boolean", "values": "{}" }, { "code": "reset_filter", "type": "Boolean", "values": "{}" }, { "code": "mode", "type": "Enum", "values": "{“range”:[“standby”,“random”,“smart”,“wall_follow”]}" }, { "code": "direction_control", "type": "Enum", "values": "{“range”:[“forward”,“backward”,“turn_left”,“turn_right”,“stop”]}\t" }, { "code": "suction", "type": "Enum", "values": "{“range”:[“strong”,“normal”]}" }, { "code": "power_go", "type": "Enum", "values": "{}" }, { "code": "reset_edge_brush", "type": "Boolean", "values": "{}" }, { "code": "reset_roll_brush", "type": "Boolean", "values": "{}" }, { "code": "seek", "type": "Boolean", "values": "{}" } ], "status": [ { "code": "power", "type": "Boolean", "values": "{}" }, { "code": "mode", "type": "Enum", "values": "{“range”:[“standby”,“random”,“smart”,“wall_follow”]}" }, { "code": "suction", "type": "Enum", "values": "{“range”:[“strong”,“normal”]}" }, { "code": "reset_edge_brush", "type": "Boolean", "values": "{}" }, { "code": "seek", "type": "Boolean", "values": "{}" }, { "code": "electricity_left", "type": "Integer", "values": "{\"unit\":\"\",\"min\":0,\"max\":100,\"scale\":1,\"step\":1}" }, { "code": "clean_record", "type": "String", "values": "{}" }, { "code": "clean_area", "type": "Integer", "values": "{\"unit\":\"m\",\"min\":0,\"max\":10000,\"scale\":0,\"step\":1}" }, { "code": "filter", "type": "Integer", "values": "{\"unit\":\"%\",\"min\":0,\"max\":100,\"scale\":0,\"step\":1}" }, { "code": "power_go", "type": "Enum", "values": "{}" }, { "code": "direction_control", "type": "Enum", "values": "{“range”:[“forward”,“backward”,“turn_left”,“turn_right”,“stop”]}\t" }, { "code": "reset_roll_brush", "type": "Boolean", "values": "{}" }, { "code": "reset_filter", "type": "Boolean", "values": "{}" }, { "code": "edge_brush", "type": "Integer", "values": "{\"unit\":\"%\",\"min\":0,\"max\":100,\"scale\":0,\"step\":1}" }, { "code": "roll_brush", "type": "Integer", "values": "{\"unit\":\"%\",\"min\":0,\"max\":100,\"scale\":0,\"step\":1}" } ] }, "success": true, "t": 1627504433734
If need more information tell me. Thank you in advance.