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.34k stars 30.63k forks source link

Roborock startup log error #101040

Closed luca-angemi closed 1 year ago

luca-angemi commented 1 year ago

The problem

Since 2023.10.0b0 once HA starts this issue appeaes in the logs

2023-09-28 11:34:12.847 WARNING (MainThread) [py.warnings] /usr/src/homeassistant/homeassistant/helpers/entity_platform.py:495: RuntimeWarning: coroutine 'EntityPlatform._async_add_entity' was never awaited
tasks = [
2023-09-28 11:34:12.849 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 495, in async_add_entities
tasks = [
^
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 495, in <listcomp>
tasks = [
^
File "/usr/src/homeassistant/homeassistant/components/roborock/sensor.py", line 211, in <genexpr>
if description.value_fn(coordinator.roborock_device_info.props) is not None
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/roborock/sensor.py", line 150, in <lambda> value_fn=lambda data: data.last_clean_record.begin_datetime,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'begin_datetime'

What version of Home Assistant Core has the issue?

2023.10.0b0

What was the last working version of Home Assistant Core?

2023.9

What type of installation are you running?

Home Assistant OS

Integration causing the issue

roborock

Link to integration documentation on our website

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

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

home-assistant[bot] commented 1 year ago

Hey there @humbertogontijo, @lash-l, mind taking a look at this issue as it has been labeled with an integration (roborock) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `roborock` 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 roborock` Removes the current integration label and assignees on the issue, add the integration domain after the command.

(message by CodeOwnersMention)


roborock documentation roborock source (message by IssueLinks)

Lash-L commented 1 year ago

Just to confirm, you were on 2023.9.0 before this?

luca-angemi commented 1 year ago

Yes, I mean .9.3

Lash-L commented 1 year ago

Do other entities get setup?

Lash-L commented 1 year ago

And what vacuum are you using?

luca-angemi commented 1 year ago

S5e. Most of the entities are not available. Screenshot_20230928_151824_Home Assistant Screenshot_20230928_151829_Home Assistant

Lash-L commented 1 year ago

Can you upload your diagnostic data? I think your vacuum is simply missing the last clean record

luca-angemi commented 1 year ago

Attached

El jue, 28 sept 2023, 15:46, Luke Lashley @.***> escribió:

Can you upload your diagnostic data? I think your vacuum is simply missing the last clean record

— Reply to this email directly, view it on GitHub https://github.com/home-assistant/core/issues/101040#issuecomment-1739234540, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACMEAY3RTPZ7BSNZ4X33AJLX4V5S7ANCNFSM6AAAAAA5KV5TYA . You are receiving this because you authored the thread.Message ID: @.***>

Lash-L commented 1 year ago

It did not attach. I think you need to do it through github

luca-angemi commented 1 year ago

Sorry I'm from mobile. It says json art not supported.

luca-angemi commented 1 year ago

Renamed to zip. config_entry-roborock-e67f94f2cc7d0b056c1058abb98e7461.zip

Lash-L commented 1 year ago

It says it is corrupted/ not a valid zip. You can just paste the entire text if you would like

luca-angemi commented 1 year ago

Yes it's not a zip. Rename it to json.

luca-angemi commented 1 year ago
{
    "home_assistant":{
        "installation_type":"HomeAssistantOS",
        "version":"2023.10.0b1",
        "dev":false,
        "hassio":true,
        "virtualenv":false,
        "python_version":"3.11.5",
        "docker":true,
        "arch":"armv7l",
        "timezone":"Europe/Madrid",
        "os_name":"Linux",
        "os_version":"6.1.21-v7",
        "supervisor":"2023.09.3",
        "host_os":"HomeAssistantOS10.5",
        "docker_version":"23.0.6",
        "chassis":"embedded",
        "run_as_root":true
    },
    "custom_components":{
        "dlink":{
            "version":"1",
            "requirements":[
                "pyW215==0.7.0"
            ]
        },
        "ideenergy":{
            "version":"1.0.4",
            "requirements":[
                "ideenergy==1.0.0rc2"
            ]
        },
        "imap":{
            "version":"1",
            "requirements":[
                "aioimaplib==1.0.1",
                "PyPDF2"
            ]
        }
    },
    "integration_manifest":{
        "domain":"roborock",
        "name":"Roborock",
        "codeowners":[
            "@humbertogontijo",
            "@Lash-L"
        ],
        "config_flow":true,
        "documentation":"https://www.home-assistant.io/integrations/roborock",
        "iot_class":"local_polling",
        "loggers":[
            "roborock"
        ],
        "requirements":[
            "python-roborock==0.34.1"
        ],
        "is_built_in":true
    },
    "data":{
        "config_entry":{
            "username":"**REDACTED**",
            "user_data":{
                "uid":"**REDACTED**",
                "tokentype":"",
                "token":"**REDACTED**",
                "rruid":"**REDACTED**",
                "region":"eu",
                "countrycode":"34",
                "country":"ES",
                "nickname":"LucaAngemi",
                "rriot":{
                    "u":"5qsWitDMUF23ZMmlD0ZT9e",
                    "s":"CWQe2h",
                    "h":"bSQpwn25TE",
                    "k":"IKiglC0r",
                    "r":{
                        "r":"EU",
                        "a":"https://api-eu.roborock.com",
                        "m":"ssl://mqtt-eu.roborock.com:8883",
                        "l":"https://wood-eu.roborock.com"
                    }
                },
                "tuyaDeviceState":2,
                "avatarurl":"https://files.roborock.com/iottest/default_avatar.png"
            },
            "base_url":"https://euiot.roborock.com"
        },
        "coordinators":{
            "**REDACTED-0**":{
                "roborock_device_info":{
                    "device":{
                        "duid":"**REDACTED**",
                        "name":"Robotina",
                        "localKey":"**REDACTED**",
                        "fv":"02.16.62",
                        "activeTime":1682435868,
                        "timeZoneId":"Europe/Madrid",
                        "iconUrl":"",
                        "productId":"42qYXusGAhtBh5L2Sa4SMV",
                        "share":false,
                        "online":true,
                        "pv":"1.0",
                        "tuyaUuid":"stsj1359644e76ac837e",
                        "tuyaMigrated":true,
                        "extra":"{\"xxxx\":\"xxxx\"}",
                        "sn":"R0517S03709654",
                        "featureSet":"0",
                        "newFeatureSet":"0000000000002000",
                        "deviceStatus":{
                            "121":8,
                            "122":100,
                            "123":104,
                            "124":203,
                            "125":30,
                            "126":0,
                            "127":60,
                            "120":0
                        },
                        "silentOtaSwitch":false
                    },
                    "network_info":{
                        "ip":"192.168.1.4",
                        "ssid":"MOVISTAR_406D",
                        "mac":"**REDACTED**",
                        "bssid":"**REDACTED**",
                        "rssi":-59
                    },
                    "product":{
                        "id":"42qYXusGAhtBh5L2Sa4SMV",
                        "name":"RoborockS5Max",
                        "model":"roborock.vacuum.s5e",
                        "capability":0,
                        "category":"robot.vacuum.cleaner",
                        "schema":[
                            {
                                "id":"101",
                                "name":"rpc_request",
                                "code":"rpc_request",
                                "mode":"rw",
                                "type":"RAW"
                            },
                            {
                                "id":"102",
                                "name":"rpc_response",
                                "code":"rpc_response",
                                "mode":"rw",
                                "type":"RAW"
                            },
                            {
                                "id":"120",
                                "name":"错误代码",
                                "code":"error_code",
                                "mode":"ro",
                                "type":"ENUM"
                            },
                            {
                                "id":"121",
                                "name":"设备状态",
                                "code":"state",
                                "mode":"ro",
                                "type":"ENUM"
                            },
                            {
                                "id":"122",
                                "name":"设备电量",
                                "code":"battery",
                                "mode":"ro",
                                "type":"ENUM"
                            },
                            {
                                "id":"123",
                                "name":"清扫模式",
                                "code":"fan_power",
                                "mode":"rw",
                                "type":"ENUM"
                            },
                            {
                                "id":"124",
                                "name":"拖地模式",
                                "code":"water_box_mode",
                                "mode":"rw",
                                "type":"ENUM"
                            },
                            {
                                "id":"125",
                                "name":"主刷寿命",
                                "code":"main_brush_life",
                                "mode":"rw",
                                "type":"VALUE"
                            },
                            {
                                "id":"126",
                                "name":"边刷寿命",
                                "code":"side_brush_life",
                                "mode":"rw",
                                "type":"VALUE"
                            },
                            {
                                "id":"127",
                                "name":"滤网寿命",
                                "code":"filter_life",
                                "mode":"rw",
                                "type":"VALUE"
                            },
                            {
                                "id":"128",
                                "name":"额外状态",
                                "code":"additional_props",
                                "mode":"ro",
                                "type":"RAW"
                            },
                            {
                                "id":"130",
                                "name":"完成事件",
                                "code":"task_complete",
                                "mode":"ro",
                                "type":"RAW"
                            },
                            {
                                "id":"131",
                                "name":"电量不足任务取消",
                                "code":"task_cancel_low_power",
                                "mode":"ro",
                                "type":"RAW"
                            },
                            {
                                "id":"132",
                                "name":"运动中任务取消",
                                "code":"task_cancel_in_motion",
                                "mode":"ro",
                                "type":"RAW"
                            },
                            {
                                "id":"133",
                                "name":"充电状态",
                                "code":"charge_status",
                                "mode":"ro",
                                "type":"RAW"
                            },
                            {
                                "id":"134",
                                "name":"烘干状态",
                                "code":"drying_status",
                                "mode":"ro",
                                "type":"RAW"
                            }
                        ]
                    },
                    "props":{
                        "status":{
                            "msgVer":2,
                            "msgSeq":915,
                            "state":8,
                            "battery":97,
                            "cleanTime":1831,
                            "cleanArea":30535000,
                            "squareMeterCleanArea":30.5,
                            "errorCode":0,
                            "mapPresent":1,
                            "inCleaning":0,
                            "inReturning":0,
                            "inFreshState":1,
                            "labStatus":3,
                            "waterBoxStatus":0,
                            "fanPower":104,
                            "dndEnabled":0,
                            "mapStatus":7,
                            "isLocating":0,
                            "lockStatus":0,
                            "waterBoxMode":203,
                            "waterBoxCarriageStatus":0,
                            "mopForbiddenEnable":0,
                            "unsaveMapReason":0,
                            "unsaveMapFlag":1,
                            "distanceOff":0
                        },
                        "cleanSummary":{
                            "cleanTime":767414,
                            "cleanArea":11658592500,
                            "squareMeterCleanArea":11658.6,
                            "cleanCount":617,
                            "records":[
                                1695901270,
                                1695899514,
                                1695651875,
                                1695637179,
                                1695631214,
                                1695207298,
                                1695205123,
                                1695202987,
                                1695202452,
                                1695030654,
                                1694677362,
                                1693995972,
                                1693993927,
                                1693752680,
                                1693734039,
                                1692721673,
                                1692720495,
                                1692716742,
                                1692693472,
                                1692607352
                            ]
                        },
                        "consumable":{
                            "mainBrushWorkTime":767447,
                            "sideBrushWorkTime":767447,
                            "filterWorkTime":220173,
                            "filterElementWorkTime":3713,
                            "sensorDirtyTime":88813,
                            "mainBrushTimeLeft":312553,
                            "sideBrushTimeLeft":-47447,
                            "filterTimeLeft":319827,
                            "sensorTimeLeft":19187
                        }
                    }
                },
                "api":{
                    "unknown":{},
                    "get_clean_summary":{
                        "params":[],
                        "response":[
                            767414,
                            11658592500,
                            617,
                            [
                                1695901270,
                                1695899514,
                                1695651875,
                                1695637179,
                                1695631214,
                                1695207298,
                                1695205123,
                                1695202987,
                                1695202452,
                                1695030654,
                                1694677362,
                                1693995972,
                                1693993927,
                                1693752680,
                                1693734039,
                                1692721673,
                                1692720495,
                                1692716742,
                                1692693472,
                                1692607352
                            ]
                        ]
                    },
                    "get_clean_record":{
                        "params":[
                            1695901270
                        ],
                        "response":[
                            1695901270,
                            1695903101,
                            1831,
                            30535000,
                            0,
                            1,
                            2,
                            3,
                            56
                        ]
                    },
                    "app_segment_clean":{
                        "params":[
                            16,
                            1
                        ]
                    }
                }
            }
        }
    }
}
Lash-L commented 1 year ago

Okay here's the run down.

Your device returns clean records different than newer devices. I'll have to check to see if it is a list and then manually apply the variables.

Your latest clean record has the following information:

          1695901270,
          1695903101,
          1831,
          30535000,
          0,
          1,
          2,
          3,
          56

From what I can logic through: Start time: 1695901270 End time: 1695903101 Duration: 1831 area: 30535000 aka 30.535 square meters

Here are the rest of the attributes we have typically:

error: int | None = None
complete: int | None = None
start_type: int | None = None
clean_type: int | None = None
finish_reason: int | None = None
dust_collection_status: int | None = None
avoid_count: int | None = None
wash_count: int | None = None
map_flag: int | None = None

None of them are really needed - but I think you don't have object avoidance/ washing on that device.

error: int | None = None
complete: int | None = None
start_type: int | None = None
clean_type: int | None = None
finish_reason: int | None = None
dust_collection_status: int | None = None
map_flag: int | None = None

I'm assuming error = 0

complete = 1

Are you able to try to logic through the rest based on information found in your app?

luca-angemi commented 1 year ago

The vacuum doesn't have object avoidance but if by washing you mean a mop/water box, yes it has them but they are both currently not attached.

I looked into the app but couldn't find anything significant.

luca-angemi commented 1 year ago

Updated to 0b6 still throws an error while setting up. Shall I open a new issue?

frenck commented 1 year ago

@luca-angemi Yes please 👍