home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
73.52k stars 30.71k forks source link

The status of the vacuum robot (lb3jihr6cvumqomi) is not updating #97836

Closed almirus closed 8 months ago

almirus commented 1 year ago

The problem

I can control the vacuum cleaner through integration, but the status is not visible.

image

The status of the vacuum cleaner is displayed correctly in the official Tuya IoT application and website. image

curl --request GET "https://openapi.tuyaeu.com/v1.0/iot-03/devices/status?device_ids=bfac38a13f374022fbbaho" --header "sign_method: HMAC-SHA256" --header "client_id: x8ne5jnaaxqbg3l983dx" --header "t: 1691234068754" --header "mode: cors" --header "Content-Type: application/json" --header "sign: HIDDEN" --header "access_token: HIDDEN"
{
  "result": [
    {
      "id": "bfac38a13f374022fbbaho",
      "status": [
        {
          "code": "power_go",
          "value": true
        },
        {
          "code": "pause",
          "value": false
        },
        {
          "code": "switch_charge",
          "value": true
        },
        {
          "code": "mode",  //<-----
          "value": "smart"   //<-----
        },
        {
          "code": "seek",
          "value": false
        }
      ]
    }
  ],
  "success": true,
  "t": 1691234069088,
  "tid": "3eaeb55d338111ee94e0a2e0adfc0b14"
}

What version of Home Assistant Core has the issue?

core-2023.8.1

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Tuya

Link to integration documentation on our website

https://www.home-assistant.io/integrations/tuya/

Diagnostics information

{ "home_assistant": { "installation_type": "Home Assistant OS", "version": "2023.8.1", "dev": false, "hassio": true, "virtualenv": false, "python_version": "3.11.4", "docker": true, "arch": "aarch64", "timezone": "Europe/Moscow", "os_name": "Linux", "os_version": "6.1.21-v8", "supervisor": "2023.07.1", "host_os": "Home Assistant OS 10.4", "docker_version": "23.0.6", "chassis": "embedded", "run_as_root": true }, "custom_components": { "yandex_smart_home": { "version": "0.6.3", "requirements": [] }, "yandex_weather": { "version": "3.1.0", "requirements": [] }, "hacs": { "version": "1.32.1", "requirements": [ "aiogithubapi>=22.10.1" ] }, "yandex_station": { "version": "3.12.3", "requirements": [] }, "xiaomi_miot": { "version": "0.7.10", "requirements": [ "construct==2.10.56", "python-miio>=0.5.6", "micloud>=0.3" ] }, "ble_monitor": { "version": "12.3.2", "requirements": [ "pycryptodomex>=3.14.1", "janus>=1.0.0", "aioblescan>=0.2.14", "btsocket>=0.2.0", "pyric>=0.1.6.3" ] }, "nodered": { "version": "2.1.0", "requirements": [] } }, "integration_manifest": { "domain": "tuya", "name": "Tuya", "codeowners": [ "@Tuya", "@zlinoliver", "@frenck" ], "config_flow": true, "dependencies": [ "ffmpeg" ], "dhcp": [ { "macaddress": "105A17" }, { "macaddress": "10D561" }, { "macaddress": "1869D8" }, { "macaddress": "381F8D" }, { "macaddress": "508A06" }, { "macaddress": "68572D" }, { "macaddress": "708976" }, { "macaddress": "7CF666" }, { "macaddress": "84E342" }, { "macaddress": "D4A651" }, { "macaddress": "D81F12*" } ], "documentation": "https://www.home-assistant.io/integrations/tuya", "integration_type": "hub", "iot_class": "cloud_push", "loggers": [ "tuya_iot" ], "requirements": [ "tuya-iot-py-sdk==0.6.6" ], "is_built_in": true }, "data": { "endpoint": "https://openapi.tuyaeu.com", "auth_type": 0, "country_code": "49", "app_type": "tuyaSmart", "mqtt_connected": true, "disabled_by": null, "disabled_polling": false, "name": "Laser Robot Vacuum Cleaner", "model": "50021004", "category": "sd", "product_id": "lb3jihr6cvumqomi", "product_name": "", "online": true, "sub": false, "time_zone": "+03:00", "active_time": "2023-05-12T14:45:53+00:00", "create_time": "2023-05-12T14:45:54+00:00", "update_time": "2023-08-02T20:14:33+00:00", "function": { "power_go": { "type": "Boolean", "value": {} }, "pause": { "type": "Boolean", "value": {} }, "switch_charge": { "type": "Boolean", "value": {} }, "mode": { "type": "Enum", "value": { "range": [ "smart", "chargego", "zone", "pose", "part" ], "type": "enum" } }, "seek": { "type": "Boolean", "value": {} } }, "status_range": { "power_go": { "type": "Boolean", "value": {} }, "pause": { "type": "Boolean", "value": {} }, "switch_charge": { "type": "Boolean", "value": {} }, "mode": { "type": "Enum", "value": { "range": [ "smart", "chargego", "zone", "pose", "part" ], "type": "enum" } }, "seek": { "type": "Boolean", "value": {} } }, "status": { "power_go": true, "pause": false, "switch_charge": true, "mode": "smart", "seek": false }, "home_assistant": { "name": "Laser Robot Vacuum Cleaner", "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, "original_icon": null, "unit_of_measurement": null, "state": { "entity_id": "vacuum.laser_robot_vacuum_cleaner", "state": "unknown", "attributes": { "friendly_name": "Laser Robot Vacuum Cleaner", "supported_features": 13084 }, "last_changed": "2023-08-05T08:44:16.714066+00:00", "last_updated": "2023-08-05T08:44:16.714066+00:00" } } ] } } }

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

curl --request GET "https://openapi.tuyaeu.com/v1.0/iot-03/devices/bfac38a13f374022fbbaho/functions" --header "sign_method: HMAC-SHA256" --header "client_id: x8ne5jnaaxqbg3l983dx" --header "t: 1691233942112" --header "mode: cors" --header "Content-Type: application/json" --header "sign: HIDDEN" --header "access_token: HIDDEN"
{
  "result": {
    "category": "sd",
    "functions": [
      {
        "code": "power_go",
        "desc": "power go",
        "name": "power go",
        "type": "Boolean",
        "values": "{}"
      },
      {
        "code": "pause",
        "desc": "pause",
        "name": "pause",
        "type": "Boolean",
        "values": "{}"
      },
      {
        "code": "switch_charge",
        "desc": "switch charge",
        "name": "switch charge",
        "type": "Boolean",
        "values": "{}"
      },
      {
        "code": "mode",
        "desc": "mode",
        "name": "mode",
        "type": "Enum",
        "values": "{\"range\":[\"smart\",\"chargego\",\"zone\",\"pose\",\"part\"],\"type\":\"enum\"}"
      },
      {
        "code": "seek",
        "desc": "seek",
        "name": "seek",
        "type": "Boolean",
        "values": "{}"
      }
    ]
  },
  "success": true,
  "t": 1691233942542,
  "tid": "f342d8ab338011ee94e0a2e0adfc0b14"
}
curl --request GET "https://openapi.tuyaeu.com/v1.0/iot-03/devices/bfac38a13f374022fbbaho/specification" --header "sign_method: HMAC-SHA256" --header "client_id: x8ne5jnaaxqbg3l983dx" --header "t: 1691233861465" --header "mode: cors" --header "Content-Type: application/json" --header "sign: HIDDEN" --header "access_token: HIDDEN"

{
  "result": {
    "category": "sd",
    "functions": [
      {
        "code": "power_go",
        "desc": "{}",
        "name": "清扫开关",
        "type": "Boolean",
        "values": "{}"
      },
      {
        "code": "pause",
        "desc": "{}",
        "name": "暂停开关",
        "type": "Boolean",
        "values": "{}"
      },
      {
        "code": "switch_charge",
        "desc": "{}",
        "name": "回充开关",
        "type": "Boolean",
        "values": "{}"
      },
      {
        "code": "mode",
        "desc": "{\"range\":[\"smart\",\"chargego\",\"zone\",\"pose\",\"part\"],\"type\":\"enum\"}",
        "name": "工作模式",
        "type": "Enum",
        "values": "{\"range\":[\"smart\",\"chargego\",\"zone\",\"pose\",\"part\"],\"type\":\"enum\"}"
      },
      {
        "code": "seek",
        "desc": "{}",
        "name": "寻找机器",
        "type": "Boolean",
        "values": "{}"
      }
    ],
    "status": [
      {
        "code": "power_go",
        "name": "清扫开关",
        "type": "Boolean",
        "values": "{}"
      },
      {
        "code": "pause",
        "name": "暂停开关",
        "type": "Boolean",
        "values": "{}"
      },
      {
        "code": "switch_charge",
        "name": "回充开关",
        "type": "Boolean",
        "values": "{}"
      },
      {
        "code": "mode",
        "name": "工作模式",
        "type": "Enum",
        "values": "{\"range\":[\"smart\",\"chargego\",\"zone\",\"pose\",\"part\"],\"type\":\"enum\"}"
      },
      {
        "code": "seek",
        "name": "寻找机器",
        "type": "Boolean",
        "values": "{}"
      }
    ]
  },
  "success": true,
  "t": 1691233861801,
  "tid": "c3205c3f338011ee871736843e81b476"
}
home-assistant[bot] commented 1 year ago

Hey there @tuya, @zlinoliver, @frenck, mind taking a look at this issue as it has been labeled with an integration (tuya) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `tuya` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign tuya` Removes the current integration label and assignees on the issue, add the integration domain after the command.

(message by CodeOwnersMention)


tuya documentation tuya source (message by IssueLinks)

MaBeniu commented 1 year ago

I avoided this integration as it requires it platform account. Nevertheless decided to proceed. And I get same result as in the first post. It does create only one entity which can accept input when using toggles on entity however actual states are not recognized. So nearly useless integration for vacuum robot. Anyone tried setting this up in smart life platform to compare. Maybe API are developed properly there?

daniel-simpson commented 12 months ago

I'm getting a similar issue with my vacuum (Kogan G50, powered by Tuya).

Looking closely at the IoT site it looks like the status is "cleanning" instead of "cleaning" when my vac is running.

Will submit a PR shortly to add that to the smart life to home assistant map and see if that helps others 🤞

daniel-simpson commented 12 months ago

My Tuya account is also in EU, and was seeing two incorrectly spelled / enumerated values returned for my vacuum "cleanning" spelled incorrectly during a cleaning cycle, and "pause" instead of "paused" when device isn't cleaning.

Unfortunately my PR was knocked back to being a device specific issue, even though all I did was add a few extra mapped values :(

Not sure where I'm supposed to open a Tuya support ticket, but thats the suggestion I've been given in my PR.

almirus commented 12 months ago

I solved the problem by moving to another integration, it works great and locally. https://github.com/make-all/tuya-local/commit/53098df5532333e8dfa21c1b702ce00c88efcde2#diff-a68e498d27c3ae5c2d73d2795924de519cbb46de2aebe95cd48243441f86b2c8

MaBeniu commented 11 months ago

I solved the problem by moving to another integration, it works great and locally. make-all/tuya-local@53098df#diff-a68e498d27c3ae5c2d73d2795924de519cbb46de2aebe95cd48243441f86b2c8 @almirus

I have downloaded file you share in the link, added to folder /devices however when I try to add new device and I enter device ID and local key it says this device is not supported. would you be able to help me set this up?

almirus commented 11 months ago

@MaBeniu may be you need to change name: Neatsvor X600 products:

OR your device is significantly different from mine. Then you should to correct DPs manually

MaBeniu commented 11 months ago

@MaBeniu may be you need to change name: Neatsvor X600 products:

  • id: lb3jihr6cvumqomi

OR your device is significantly different from mine. Then you should to correct DPs manually

Mine robot is exactly same, I also checked DP's on tuya they are same, one difference though mine goes with different product ID which is wierd. I tried config file with two IDs listed, yours and mine, also tried keeping only one which matches my product. still same error. what other values you used for ip address, protocol version? default? image it seems like file is not being picked up by integration. while after any change in the device yaml I do restart home assistant

almirus commented 11 months ago

Use only first Device ID Try to different Protocols with same Device ID and Local key

MaBeniu commented 11 months ago

with protocol auto or version 3.3 I get error device is not supported, with other protocol versions I get unable to connect.

this is my config for device image

almirus commented 11 months ago

Switch On Enable debug logging image Try to add device by deferent protocols type Switch Off Then check Global HA Log and find reason

MaBeniu commented 11 months ago

I get such in the logs Device matches None with quality of 0%. DPS: {"updated_at": 1700069024.1419725, "4": "chargego", "5": "charge_done", "6": 33, "7": 41, "8": 100, "9": "gentle", "10": "closed", "17": 19, "19": 119, "23": 149, "26": 8, "28": 0} which I assume means DP's failed to map correct???

I looked one by one few initial DP's as per instruction with browser page inspection and those looked to match. this is query parameters result which I reviewed and for me DP's logically were matching. { "result": { "properties": [ { "code": "switch_go", "custom_name": "", "dp_id": 1, "time": 1699189628467, "value": false }, { "code": "pause", "custom_name": "", "dp_id": 2, "time": 1699101125416, "value": false }, { "code": "switch_charge", "custom_name": "", "dp_id": 3, "time": 1699101687176, "value": true }, { "code": "mode", "custom_name": "", "dp_id": 4, "time": 1700051546883, "value": "chargego" }, { "code": "status", "custom_name": "", "dp_id": 5, "time": 1700058441857, "value": "charge_done" }, { "code": "clean_time", "custom_name": "", "dp_id": 6, "time": 1700051546186, "value": 33 }, { "code": "clean_area", "custom_name": "", "dp_id": 7, "time": 1700051546186, "value": 41 }, { "code": "residual_electricity", "custom_name": "", "dp_id": 8, "time": 1700058430156, "value": 100 }, { "code": "suction", "custom_name": "", "dp_id": 9, "time": 1700051653213, "value": "gentle" }, { "code": "cistern", "custom_name": "", "dp_id": 10, "time": 1699817120359, "value": "closed" }, { "code": "seek", "custom_name": "", "dp_id": 11, "time": 1698579621680, "value": false }, { "code": "direction_control", "custom_name": "", "dp_id": 12, "time": 1698579621680, "value": "foward" }, { "code": "reset_map", "custom_name": "", "dp_id": 13, "time": 1698579621680, "value": false }, { "code": "path_data", "custom_name": "", "dp_id": 14, "time": 1699817118375 }, { "code": "command_trans", "custom_name": "", "dp_id": 15, "time": 1700051674969, "value": "qgABFxc=" }, { "code": "request", "custom_name": "", "dp_id": 16, "time": 1698579621680, "value": "get_map" }, { "code": "edge_brush_life", "custom_name": "", "dp_id": 17, "time": 1700051546877, "value": 19 }, { "code": "edge_brush_life_reset", "custom_name": "", "dp_id": 18, "time": 1698579621680, "value": false }, { "code": "roll_brush_life", "custom_name": "", "dp_id": 19, "time": 1700051546877, "value": 119 }, { "code": "roll_brush_life_reset", "custom_name": "", "dp_id": 20, "time": 1698579621680, "value": false }, { "code": "filter_life", "custom_name": "", "dp_id": 21, "time": 1698579621680, "value": 0 }, { "code": "filter_reset", "custom_name": "", "dp_id": 22, "time": 1698579621680, "value": false }, { "code": "rag_life", "custom_name": "", "dp_id": 23, "time": 1699817120431, "value": 149 }, { "code": "rag_life_reset", "custom_name": "", "dp_id": 24, "time": 1698579621680, "value": false }, { "code": "switch_disturb", "custom_name": "", "dp_id": 25, "time": 1698579621680, "value": false }, { "code": "volume_set", "custom_name": "", "dp_id": 26, "time": 1699817120488, "value": 8 }, { "code": "fault", "custom_name": "", "dp_id": 28, "time": 1699817120359, "value": 0 }, { "code": "device_timer", "custom_name": "", "dp_id": 32, "time": 1698580666966, "value": "qgAMMQIBAX8NOwABAQAB/w==" }, { "code": "disturb_time_set", "custom_name": "", "dp_id": 33, "time": 1699817118375 }, { "code": "device_info", "custom_name": "", "dp_id": 34, "time": 1699817120079, "value": "eyJEZXZpY2VfU04iOiJ6Y3BjZTR4cnhoeDRlcDA1IiwiRmlybXdhcmVfVmVyc2lvbiI6IjE2NDYxOTQyIiwiSVAiOiIxOTIuMTY4LjAuMTQ3IiwiTUNVX1ZlcnNpb24iOiI1MDAyMTAwNCIsIk1hYyI6IkQ4OkMwOkE2OkVFOkM0Ojk2IiwiTW9kdWxlX1VVSUQiOiJ1dWlkOWVhN2FjMzkxMWZlYWY2NSJ9" }, { "code": "voice_data", "custom_name": "", "dp_id": 35, "time": 1699817118375 }, { "code": "language", "custom_name": "", "dp_id": 36, "time": 1698579621680, "value": "Chinese" } ] }, "success": true, "t": ......................, "tid": "...................................." }

almirus commented 11 months ago

DP's failed to map correct

yep

MaBeniu commented 11 months ago

DP's failed to map correct

yep

which I believe is due to device config file is not being picked up, do you know if there are any prerequisites how to enable new device config file or that is simply just placing it into device folder?

almirus commented 11 months ago

Simply move the file "neatsvor_x600_vacuum.yaml" to "/homeassistant/custom_components/tuya_local/devices" and make sure to restart HA afterwards.

MaBeniu commented 11 months ago

I give up. all seems ok but it just doesnt work :( its by the way the only tuya device I have and wish to add so maybe that is somehow an issue

almirus commented 11 months ago

Unfortunately, I still have not figured out the algorithm of “DPs match calculation”, when I wrote the template, I just selected the parameters following the values that the Tuya Service API gives. Try to create a duplicate of my template with a different name and fix it according to the API, if it does not help write to the integration developer.

And do not forget to restart HA after each template change. Good luck.

issue-triage-workflows[bot] commented 8 months ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.