Closed reef-actor closed 1 month ago
It isn't clear what needs to be done here. The initial config was submitted as a PR, so the initial information that is used to create configs is not available. There have been a couple of bug reports in the past about device detection that suggest the initial integration was not well tested, but without more info about the device anything I could do here would be just blind experimentation.
If there is any diagnostics/logs that might contain clues I can have a dig through them. Can you explain what effect the change to the "power" entry in this commit had? I suspect this issue is due to Power and Activate being mixed up, perhaps the device is dealing with them in a funky way.
I had assumed this vacuum didn't support this, but on a whim I tried localtuya and was able to start cleaning (ironically this was the only function that worked out of the box with that integration). I am trying to understand what that code is doing differently but I don't regularly deal with python so it will take a bit of effort to understand how it maps DPs.
It is more the tuya developer portal info for the device that will help. ie, the QueryThingsDataModel cloud API call result. That will show what names Tuya has given to the dps, and maybe include Chinese language descriptions that explain a bit more how they are used.
The commit you highlight just makes those two dps optional, as previous reports showed they weren't always reported by the device. The power dp has a default of off added, because if the power is missing HA makes the whole entity unavailable and you cannot use it.
What you are saying sounds familiar, so probably one of the other vacuums has already been changed to deal with this same issue.
From the API:
{
"abilityId": 2,
"accessMode": "rw",
"code": "pause",
"description": "true:暂停当前工作状态\nfalse:继续当前工作状态",
"extensions": {
"iconName": "icon-dp_pause",
"attribute": "672"
},
"name": "暂停/继续",
"typeSpec": {
"type": "bool"
}
}
In the YAML
- id: 2
type: boolean
name: activate
optional: true
I'm not 100% on how to interpret this, but that looks suspect?
Yes, when the dps are labelled switch_go and pause, they cannot be mapped directly to power and activate like that. Pause has the logic reversed, and switch_go is not the same as power. Those dps work more like buttons than switches.
I added support getting maps for this vacuum (from the cloud) to the tuya_cloud_map_extractor and think it would be cool if it could be done locally. DP 16 looks promising, but my concern is the disruption on this codebase caused by bringing all the parsing and decompressing functions over here. @make-all what do you think? Would it be worth me having a go to see how it turns out?
It may be worth adding the compression and decoding to the camera platform within tuya_local.
I appreciate your work here. It is ✨sometimes✨ working now. There seems to be a sequence of the pause, clean spot, locate and return to base commands that are needed, followed by one or several pushes of the start button to start it up. I will try and pin down a reproducible way start the cleaning.
Update: It seems that it is just necessary to keep trying Start until it works. Sometimes it works on the first attempt, sometimes it takes quite a few attempts.
When the vacuum is docked (status: sleep), the ▶️ button does not start cleaning. It does change the value of the Activate attribute to true. The ⏸️ button will reset Activate to false. I have not found a way to start cleaning using Tuya Local.
Starting cleaning using the app, I see the following attribute changes: Power: false -> true Command: return_to_base -> smart The "Activate" attribute stays false.
When cleaning has been started, the ▶️ button will change the vacuum to "status: paused". When the vacuum is "status: paused", the ⏸️ button will resume cleaning.
Expected behavior The ▶️ button will start or resume cleaning. The ⏸️ button will pause cleaning or returning to dock.
Device diagnostics
``` { "home_assistant": { "installation_type": "Unsupported Third Party Container", "version": "2024.9.2", "dev": false, "hassio": false, "virtualenv": false, "python_version": "3.12.4", "docker": true, "arch": "x86_64", "timezone": "Europe/London", "os_name": "Linux", "os_version": "6.1.0-25-amd64", "run_as_root": false }, "custom_components": { "tuya_cloud_map_extractor": { "documentation": "https://github.com/oven-lab/tuya_cloud_map_extractor/blob/main/README.md", "version": "v1.2.0", "requirements": [ "numpy", "pillow", "requests" ] }, "ingress": { "documentation": "https://github.com/lovelylain/hass_ingress", "version": "1.1.6", "requirements": [] }, "homewhiz": { "documentation": "https://github.com/home-assistant-HomeWhiz/home-assistant-HomeWhiz", "version": "0.0.6", "requirements": [ "awsiotsdk", "bleak", "bleak_retry_connector", "dacite", "aiohttp", "bidict" ] }, "watchman": { "documentation": "https://github.com/dummylabs/thewatchman", "version": "0.6.3", "requirements": [ "prettytable==3.10.0" ] }, "frigate": { "documentation": "https://github.com/blakeblackshear/frigate", "version": "5.4.0", "requirements": [ "pytz" ] }, "tuya_local": { "documentation": "https://github.com/make-all/tuya-local", "version": "2024.9.0", "requirements": [ "tinytuya==1.15.1", "tuya-device-sharing-sdk>=0.1.9,<=0.2.99" ] }, "hacs": { "documentation": "https://hacs.xyz/docs/configuration/start", "version": "2.0.1", "requirements": [ "aiogithubapi>=22.10.1" ] }, "elkbledom": { "documentation": "https://github.com/dave-code-ruiz/elkbledom", "version": "1.0.2", "requirements": [ "bleak-retry-connector>=1.17.1", "bleak>=0.17.0" ] }, "localtuya": { "documentation": "https://github.com/rospogrigio/localtuya/", "version": "5.2.1", "requirements": [] } }, "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": [ "tinytuya==1.15.1", "tuya-device-sharing-sdk>=0.1.9,<=0.2.99" ], "version": "2024.9.0", "is_built_in": false }, "setup_times": { "null": { "setup": 3.7493009585887194e-05 }, "4b2cdc49720b1c7452f49e793ea524f3": { "wait_import_platforms": -2.048404594010208, "wait_base_component": -0.001281788048800081, "config_entry_setup": 2.158301817951724 } }, "data": { "name": "Robot vacuum", "type": "lublueblu_sl60d_vacuum", "device_id": "**REDACTED**", "device_cid": "", "local_key": "**REDACTED**", "host": "**REDACTED**", "protocol_version": 3.3, "tinytuya_version": "1.15.1", "api_version_set": 3.3, "api_version_used": 3.3, "api_working": true, "status": {}, "cached_state": { "updated_at": 1727359800.2520025, "1": false, "2": true, "3": true, "4": "smart", "5": "charge_done", "6": 0, "7": 0, "8": 100, "9": "normal", "10": "middle", "11": true, "12": "stop", "16": "get_both", "17": 79, "19": 229, "21": 79, "25": false, "26": 33, "27": false, "28": 0, "29": 4484, "30": 182, "31": 4068, "37": 1, "39": false, "40": "none", "41": "only_sweep", "44": "adaptive", "45": true, "15": "qgADFQEAFqoAARcXqgADKQEAKg==" }, "pending_state": {}, "connected": true, "force_dps": [], "home_assistant": { "name": "Robot vacuum", "name_by_user": null, "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": "vacuum.robot_vacuum", "state": "idle", "attributes": { "fan_speed_list": [ "Low", "Medium", "High" ], "fan_speed": "Medium", "power": false, "activate": true, "charge": true, "command": "smart", "status": "sleep", "locate": true, "direction_control": "stop", "break_clean": false, "error": 0, "friendly_name": "Robot vacuum", "supported_features": 14263 }, "last_changed": "2024-09-26T14:08:25.499247+00:00", "last_reported": "2024-09-26T14:09:28.513366+00:00", "last_updated": "2024-09-26T14:08:25.499247+00:00" } }, { "disabled": false, "disabled_by": null, "entity_category": "diagnostic", "device_class": null, "original_device_class": "duration", "icon": null, "unit_of_measurement": "min", "state": { "entity_id": "sensor.robot_vacuum_cleaning_time", "state": "0", "attributes": { "unit_of_measurement": "min", "device_class": "duration", "icon": "mdi:progress-clock", "friendly_name": "Robot vacuum Cleaning time" }, "last_changed": "2024-09-26T12:58:26.419585+00:00", "last_reported": "2024-09-26T14:09:28.514944+00:00", "last_updated": "2024-09-26T12:58:26.419585+00:00" } }, { "disabled": false, "disabled_by": null, "entity_category": "diagnostic", "device_class": null, "original_device_class": null, "icon": null, "unit_of_measurement": "m\u00b2", "state": { "entity_id": "sensor.robot_vacuum_cleaning_area", "state": "0", "attributes": { "unit_of_measurement": "m\u00b2", "icon": "mdi:floor-plan", "friendly_name": "Robot vacuum Cleaning area" }, "last_changed": "2024-09-26T12:58:26.420260+00:00", "last_reported": "2024-09-26T14:09:28.515263+00:00", "last_updated": "2024-09-26T12:58:26.420260+00:00" } }, { "disabled": false, "disabled_by": null, "entity_category": null, "device_class": null, "original_device_class": "battery", "icon": null, "unit_of_measurement": "%", "state": { "entity_id": "sensor.robot_vacuum_battery", "state": "100", "attributes": { "state_class": "measurement", "unit_of_measurement": "%", "device_class": "battery", "friendly_name": "Robot vacuum Battery" }, "last_changed": "2024-09-26T12:50:49.004552+00:00", "last_reported": "2024-09-26T14:09:28.515605+00:00", "last_updated": "2024-09-26T12:50:49.004552+00:00" } }, { "disabled": false, "disabled_by": null, "entity_category": "diagnostic", "device_class": null, "original_device_class": "enum", "icon": null, "unit_of_measurement": null, "state": { "entity_id": "sensor.robot_vacuum_water_tank", "state": "unavailable", "attributes": { "restored": true, "options": [ "Closed", "Low", "Medium", "High" ], "device_class": "enum", "icon": "mdi:cup-water", "friendly_name": "Water tank", "supported_features": 0 }, "last_changed": "2024-09-26T12:51:26.076369+00:00", "last_reported": "2024-09-26T12:51:26.076369+00:00", "last_updated": "2024-09-26T12:51:26.076369+00:00" } }, { "disabled": false, "disabled_by": null, "entity_category": "diagnostic", "device_class": null, "original_device_class": "duration", "icon": null, "unit_of_measurement": "h", "state": { "entity_id": "sensor.robot_vacuum_side_brush_lifetime", "state": "79", "attributes": { "unit_of_measurement": "h", "device_class": "duration", "friendly_name": "Robot vacuum Side brush lifetime" }, "last_changed": "2024-09-26T12:50:49.005203+00:00", "last_reported": "2024-09-26T14:09:28.515945+00:00", "last_updated": "2024-09-26T12:50:49.005203+00:00" } }, { "disabled": false, "disabled_by": null, "entity_category": "diagnostic", "device_class": null, "original_device_class": "duration", "icon": null, "unit_of_measurement": "h", "state": { "entity_id": "sensor.robot_vacuum_rolling_brush_lifetime", "state": "229", "attributes": { "unit_of_measurement": "h", "device_class": "duration", "friendly_name": "Robot vacuum Rolling brush lifetime" }, "last_changed": "2024-09-26T12:50:49.006546+00:00", "last_reported": "2024-09-26T14:09:28.516265+00:00", "last_updated": "2024-09-26T12:50:49.006546+00:00" } }, { "disabled": false, "disabled_by": null, "entity_category": "diagnostic", "device_class": null, "original_device_class": "duration", "icon": null, "unit_of_measurement": "h", "state": { "entity_id": "sensor.robot_vacuum_filter_lifetime", "state": "79", "attributes": { "unit_of_measurement": "h", "device_class": "duration", "friendly_name": "Robot vacuum Filter lifetime" }, "last_changed": "2024-09-26T12:50:49.006749+00:00", "last_reported": "2024-09-26T14:09:28.516587+00:00", "last_updated": "2024-09-26T12:50:49.006749+00:00" } }, { "disabled": false, "disabled_by": null, "entity_category": "diagnostic", "device_class": null, "original_device_class": "duration", "icon": null, "unit_of_measurement": "min", "state": { "entity_id": "sensor.robot_vacuum_duster_cloth_lifetime", "state": "unknown", "attributes": { "unit_of_measurement": "min", "device_class": "duration", "friendly_name": "Robot vacuum Duster cloth lifetime" }, "last_changed": "2024-09-26T12:50:49.006897+00:00", "last_reported": "2024-09-26T14:09:28.516947+00:00", "last_updated": "2024-09-26T12:50:49.006897+00:00" } }, { "disabled": false, "disabled_by": null, "entity_category": "diagnostic", "device_class": null, "original_device_class": null, "icon": null, "unit_of_measurement": "m\u00b2", "state": { "entity_id": "sensor.robot_vacuum_total_cleaning_area", "state": "4484", "attributes": { "unit_of_measurement": "m\u00b2", "icon": "mdi:texture-box", "friendly_name": "Robot vacuum Total cleaning area" }, "last_changed": "2024-09-26T12:50:49.007050+00:00", "last_reported": "2024-09-26T14:09:28.517334+00:00", "last_updated": "2024-09-26T12:50:49.007050+00:00" } }, { "disabled": false, "disabled_by": null, "entity_category": "diagnostic", "device_class": null, "original_device_class": null, "icon": null, "unit_of_measurement": null, "state": { "entity_id": "sensor.robot_vacuum_total_cleaning_times", "state": "182", "attributes": { "icon": "mdi:counter", "friendly_name": "Robot vacuum Total cleaning times" }, "last_changed": "2024-09-26T12:50:49.007193+00:00", "last_reported": "2024-09-26T14:09:28.517695+00:00", "last_updated": "2024-09-26T12:50:49.007193+00:00" } }, { "disabled": false, "disabled_by": null, "entity_category": "diagnostic", "device_class": null, "original_device_class": "duration", "icon": null, "unit_of_measurement": "min", "state": { "entity_id": "sensor.robot_vacuum_total_cleaning_time", "state": "4068", "attributes": { "unit_of_measurement": "min", "device_class": "duration", "icon": "mdi:history", "friendly_name": "Robot vacuum Total cleaning time" }, "last_changed": "2024-09-26T12:50:49.007392+00:00", "last_reported": "2024-09-26T14:09:28.518024+00:00", "last_updated": "2024-09-26T12:50:49.007392+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": "switch.robot_vacuum_do_not_disturb_2", "state": "off", "attributes": { "icon": "mdi:minus-circle", "friendly_name": "Robot vacuum Do not disturb" }, "last_changed": "2024-09-26T12:50:49.003966+00:00", "last_reported": "2024-09-26T14:09:28.514539+00:00", "last_updated": "2024-09-26T12:50:49.003966+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": "button.robot_vacuum_reset_map", "state": "unknown", "attributes": { "icon": "mdi:map-marker-remove", "friendly_name": "Robot vacuum Reset map" }, "last_changed": "2024-09-26T12:50:49.003499+00:00", "last_reported": "2024-09-26T12:50:49.003499+00:00", "last_updated": "2024-09-26T12:50:49.003499+00:00" } }, { "disabled": false, "disabled_by": null, "entity_category": "config", "device_class": null, "original_device_class": "restart", "icon": null, "unit_of_measurement": null, "state": { "entity_id": "button.robot_vacuum_reset_edge_brush", "state": "unknown", "attributes": { "device_class": "restart", "friendly_name": "Robot vacuum Reset edge brush" }, "last_changed": "2024-09-26T12:50:49.003609+00:00", "last_reported": "2024-09-26T12:50:49.003609+00:00", "last_updated": "2024-09-26T12:50:49.003609+00:00" } }, { "disabled": false, "disabled_by": null, "entity_category": "config", "device_class": null, "original_device_class": "restart", "icon": null, "unit_of_measurement": null, "state": { "entity_id": "button.robot_vacuum_reset_roll_brush", "state": "unknown", "attributes": { "device_class": "restart", "friendly_name": "Robot vacuum Reset roll brush" }, "last_changed": "2024-09-26T12:50:49.003707+00:00", "last_reported": "2024-09-26T12:50:49.003707+00:00", "last_updated": "2024-09-26T12:50:49.003707+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": "button.robot_vacuum_reset_filter", "state": "unknown", "attributes": { "icon": "mdi:air-filter", "friendly_name": "Robot vacuum Reset filter" }, "last_changed": "2024-09-26T12:50:49.003813+00:00", "last_reported": "2024-09-26T12:50:49.003813+00:00", "last_updated": "2024-09-26T12:50:49.003813+00:00" } }, { "disabled": false, "disabled_by": null, "entity_category": "config", "device_class": null, "original_device_class": null, "icon": null, "unit_of_measurement": "%", "state": { "entity_id": "number.robot_vacuum_volume", "state": "33", "attributes": { "min": 0.0, "max": 100.0, "step": 1.0, "mode": "auto", "unit_of_measurement": "%", "icon": "mdi:volume-high", "friendly_name": "Robot vacuum Volume" }, "last_changed": "2024-09-26T12:50:49.002347+00:00", "last_reported": "2024-09-26T14:09:28.510436+00:00", "last_updated": "2024-09-26T12:50:49.002347+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.robot_vacuum_water_tank", "state": "Medium", "attributes": { "options": [ "Closed", "Low", "Medium", "High" ], "icon": "mdi:cup-water", "friendly_name": "Robot vacuum Water tank" }, "last_changed": "2024-09-26T12:50:49.002100+00:00", "last_reported": "2024-09-26T14:09:28.509876+00:00", "last_updated": "2024-09-26T12:50:49.002100+00:00" } } ] } } } ```