DeebotUniverse / Deebot-4-Home-Assistant

Home Assistant integration for deebot vacuums
https://deebot.readthedocs.io/integrations/home-assistant/
GNU General Public License v3.0
180 stars 39 forks source link

last cleaning sensor not working for N8/T9 #166

Open mash2k3 opened 2 years ago

mash2k3 commented 2 years ago

Checks

The problem

last cleaning entity does not show timestamp but stays on unknown

Diagnostics information

{
  "home_assistant": {
    "installation_type": "Home Assistant OS",
    "version": "2022.4.7",
    "dev": false,
    "hassio": true,
    "virtualenv": false,
    "python_version": "3.9.9",
    "docker": true,
    "arch": "x86_64",
    "timezone": "America/New_York",
    "os_name": "Linux",
    "os_version": "5.10.108",
    "supervisor": "2022.04.0",
    "host_os": "Home Assistant OS 7.6",
    "docker_version": "20.10.9",
    "chassis": "vm",
    "run_as_root": true
  },
  "custom_components": {
    "frigate": {
      "version": "2.2.2",
      "requirements": []
    },
    "ble_monitor": {
      "version": "8.6.1",
      "requirements": [
        "pycryptodomex>=3.14.1",
        "janus>=1.0.0",
        "aioblescan>=0.2.12",
        "btsocket>=0.2.0",
        "pyric>=0.1.6.3"
      ]
    },
    "webrtc": {
      "version": "v2.3.0",
      "requirements": []
    },
    "alexa_media": {
      "version": "3.11.2",
      "requirements": [
        "alexapy==1.25.3",
        "packaging>=20.3",
        "wrapt>=1.12.1"
      ]
    },
    "hacs": {
      "version": "1.24.5",
      "requirements": [
        "aiogithubapi>=21.11.0"
      ]
    },
    "sonoff": {
      "version": "v2.4.7",
      "requirements": [
        "pycryptodome>=3.6.6"
      ]
    },
    "alarmo": {
      "version": "v1.8.7",
      "requirements": []
    },
    "fullykiosk": {
      "version": "1.0.1",
      "requirements": [
        "python-fullykiosk==0.0.11"
      ]
    },
    "govee": {
      "version": "0.2.2",
      "requirements": [
        "govee-api-laggat==0.2.2",
        "dacite==1.6.0"
      ]
    },
    "hubitat": {
      "version": "0.7.1",
      "requirements": [
        "hubitatmaker>=0.6.1,<0.7.0"
      ]
    },
    "nodered": {
      "version": "1.0.8",
      "requirements": []
    },
    "xiaomi_gateway3": {
      "version": "2.0.9",
      "requirements": [
        "zigpy>=0.33.0"
      ]
    },
    "deebot": {
      "version": "1.3.0",
      "requirements": [
        "deebot-client==1.3.0",
        "numpy>=1.21.2"
      ]
    },
    "dwains_dashboard": {
      "version": "3.0.0",
      "requirements": []
    }
  },
  "integration_manifest": {
    "domain": "deebot",
    "name": "Deebot 4 Home Assistant",
    "version": "1.3.0",
    "config_flow": true,
    "documentation": "https://deebot.readthedocs.io/integrations/home-assistant",
    "issue_tracker": "https://github.com/DeebotUniverse/Deebot-4-Home-Assistant/issues",
    "requirements": [
      "deebot-client==1.3.0",
      "numpy>=1.21.2"
    ],
    "codeowners": [
      "@DeebotUniverse",
      "@edenhaus"
    ],
    "iot_class": "cloud_polling",
    "is_built_in": false
  },
  "data": {
    "config": {
      "entry_id": "b96d24d9b6eb4ba3af200867ee0a93c4",
      "version": 3,
      "domain": "deebot",
      "title": "xxxxxxxxx",
      "data": {
        "username": "**REDACTED**",
        "password": "**REDACTED**",
        "country": "Us",
        "continent": "Na",
        "devices": "**REDACTED**"
      },
      "options": {},
      "pref_disable_new_entities": false,
      "pref_disable_polling": false,
      "source": "user",
      "unique_id": null,
      "disabled_by": null
    },
    "device": {
      "did": "**REDACTED**",
      "name": "**REDACTED**",
      "class": "85as7h",
      "resource": "TA0K",
      "nick": "DEEBOT",
      "company": "eco-ng",
      "bindTs": 1636670585975,
      "service": {
        "jmq": "jmq-ngiot-na.dc.ww.ecouser.net",
        "mqs": "api-ngiot.dc-na.ww.ecouser.net"
      },
      "homeSort": 9999,
      "deviceName": "DEEBOT N8 PRO+",
      "icon": "https://portal-ww.ecouser.net/api/pim/file/get/5feaeb585f437d0008e0e00c",
      "ota": true,
      "UILogicId": "DT_8SE_G",
      "materialNo": "110-2008-0902",
      "pid": "5fbc7f5069320300086ffa5e",
      "product_category": "DEEBOT",
      "model": "N8_PRO_PLUS_BLACK",
      "updateInfo": {
        "needUpdate": false,
        "changeLog": ""
      },
      "status": 1,
      "offmap": true
    }
  }
}

Anything in the logs that might be useful for us?

No response

Additional information

No response

cborisa commented 2 years ago

same issue with Deebot T9 integration

edenhaus commented 2 years ago

Please activate debug logs and post the logs here

mash2k3 commented 2 years ago

Not sure how to activate debug logs Also this sensor was broken more than it worked I know i had this issue b4. Originally it was working it broke after the migration to D4HA component then several month later an update fixed it then shortly after another update broke it. I just came to the conclusion that im going to base my automations of a sensor created with in HA(automate a timestamp when docked) instead of the last cleaning sensor that's always broken. It just breaks my automation all the time and my vacuum doesnt run. But i will assist in getting this fixed just instruct me on how to get what you want.

edenhaus commented 2 years ago

Please refer to https://deebot.readthedocs.io/integrations/home-assistant/issues/, how you can activate debug logs.

Maybe for your usecase you can use the event deebot_cleaning_job

The last cleaning job sensor is the only sensor, which is not interacting instead the ecovacs server are creating the state after cleaning. Probably they have changed it again. If you provide me the logs, I probably can fix it again. I personally can't use it as I don't use the ecovacs servers

cborisa commented 2 years ago

@edenhaus I have logs from HA, do you want to filter it to Deebot only, or do you need extra in the logs (I don't want to upload here full log from my HA instance, but can send it somehow else

edenhaus commented 2 years ago

I only need the deebot logs 😊

github-actions[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

cborisa commented 2 years ago

@edenhaus Here are the logs from my instance. I've filtered it to DEEBOT relevant events. Let me know if you need some extra info from the logs home-assistant-deebot.log .

edenhaus commented 2 years ago

I will release a version with more debug logs soon (I’m currently ill) and afterwords a need another time new logs

cborisa commented 2 years ago

@edenhaus get better soon! I have an HA testing instance which can also be connected to the vacuum - ready to deploy your version there for more debugging

edenhaus commented 2 years ago

I have released 1.3.2 as pre-release. If you don't see the update in HACS, please click on reinstall and activate "beta versions", then you should see it.

After installing I need again debug logs :)

cborisa commented 2 years ago

@edenhaus please find the new logs. I've cleaned them up keeping mostly only your data in. Let me know if you need other parts - I will get them to you home-assistant-deebot.log

github-actions[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

edenhaus commented 2 years ago

Sorry for the delay but my notebook was broken and without it's hard to analyse the logs.

Ecovacs has changed their api and url for the last cleaning sensor is returning no data.

2022-05-31 13:24:31 DEBUG (MainThread) [deebot_client._api_client] Success: calling api: url=https://portal-eu.ecouser.net/api/lg/log.do, params={'td': 'GetCleanLogs', 'u': '[USERIDREMOVED]', 'cv': '1.67.3', 't': 'a', 'av': '1.3.1'}, json={'td': 'GetCleanLogs', 'did': '[REMOVED]', 'resource': '7WZE'}, response={'ret': 'ok', 'logs': []}

Is someone able to analyse the traffic of the app and give me information about, what did change? For my 950 everything is working correctly.

vandalon commented 2 years ago

The last cleaning returns the stop reason on my N8 Pro:

image
Sab44 commented 2 years ago

Please refer to https://deebot.readthedocs.io/integrations/home-assistant/issues/, how you can activate debug logs.

Maybe for your usecase you can use the event deebot_cleaning_job

The last cleaning job sensor is the only sensor, which is not interacting instead the ecovacs server are creating the state after cleaning. Probably they have changed it again. If you provide me the logs, I probably can fix it again. I personally can't use it as I don't use the ecovacs servers

I have the same issue with my T9, that the last cleaning sensor stays on unknown. Not sure if related to this, but also the deebot_cleaning_job event is not firing for me at all.

freddieleeman commented 2 years ago

Same here; been trying to get coordinates for spot cleaning but deebot_cleaning_job is not firing, and sensor.deebot_last_cleaning is stuck at unknown.

Not sure if it is related, but running getStats gives me errors in the debug log:

2022-09-14 12:54:43.270 DEBUG (MainThread) [custom_components.deebot.vacuum] async_send_command getLifeSpan with ['sideBrush', 'brush', 'heap']
2022-09-14 12:54:43.449 WARNING (MainThread) [deebot_client.message] Could not parse getLifeSpan: {'ret': 'ok', 'resp': {'header': {'pri': 1, 'tzm': 480, 'ts': '1663152886633', 'ver': '0.0.1', 'fwVer': '2.5.5', 'hwVer': '0.1.1'}, 'body': {'code': 0, 'msg': 'ok', 'data': [{'type': 'sideBrush', 'left': 7880, 'total': 9000}, {'type': 'brush', 'left': 16941, 'total': 18000}, {'type': 'heap', 'left': 6139, 'total': 7200}]}}, 'id': '0Xap'}
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/deebot_client/message.py", line 52, in wrapper
    response = func(cls, event_bus, data)
  File "/usr/local/lib/python3.10/site-packages/deebot_client/message.py", line 108, in __handle_body_data
    return cls._handle_body_data(event_bus, data)
  File "/usr/local/lib/python3.10/site-packages/deebot_client/message.py", line 97, in _handle_body_data
    return cls._handle_body_data_dict(event_bus, data)
  File "/usr/local/lib/python3.10/site-packages/deebot_client/message.py", line 86, in _handle_body_data_dict
    raise NotImplementedError
NotImplementedError
xXDjMikeXx commented 1 year ago

I Have same issues with the X1!

no deebot_cleaning_job event Last Cleaning Sensor not working

joshnl1977 commented 1 year ago

I'm having the exact same problem with my X1 Omni, where no deebot_cleaning_job event is being triggered and last cleaning sensor reports unknown.

I'd really like to be able to get coordinates for the robot so I can have it clean custom areas through Home Assistant (since custom areas cannot be saved in the Ecovacs app), so was wondering if any progress has been made with this issue. Is there any information I can provide that would help solve the issue?