Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Roborock failed Setup #102952

Closed
GitMeTender opened this issue Oct 28, 2023 · 30 comments
Closed

Roborock failed Setup #102952

GitMeTender opened this issue Oct 28, 2023 · 30 comments

Comments

@GitMeTender
Copy link

The problem

Roborock stopped working after I rebooted the System due to a relocation of my Raspberry with HA installed on it. I tried reloading the System/Integration multiple times. I attached a snippet of the error in the Debug console.

What version of Home Assistant Core has the issue?

core-2023.10.5

What was the last working version of Home Assistant Core?

core-2023.10.5

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

2023-10-28 11:47:01.881 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry [email protected] for roborock
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 399, in async_setup
result = await component.async_setup_entry(hass, self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/roborock/init.py", line 29, in async_setup_entry
user_data = UserData.from_dict(entry.data[CONF_USER_DATA])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/roborock/containers.py", line 90, in from_dict
return from_dict(cls, decamelize_obj(data, ignore_keys), config=Config(cast=[Enum]))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/dacite/core.py", line 68, in from_dict
raise WrongTypeError(field_path=field.name, field_type=field.type, value=value)
dacite.exceptions.WrongTypeError: wrong value type for field "rriot" - should be "roborock.containers.RRiot | None" instead of value "{'u': '5GU7EP31faFf9AOqpl7Ii', 's': 'p1Nnir', 'h': 'awjjmNBrna', 'k': '8FKYpRIN', 'r': {'r': 'EU', 'a': 'https://api-eu.roborock.com', 'm': 'ssl://mqtt-eu-4.roborock.com:8883', 'l': 'https://wood-eu.roborock.com'}}" of type "dict"

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

@home-assistant
Copy link

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)

@crpeck
Copy link

crpeck commented Oct 29, 2023

I just tried setting it up again this AM, everything is up to date:
Logger: homeassistant.components.roborock.config_flow
Source: components/roborock/config_flow.py:84
Integration: Roborock (documentation, issues)
First occurred: 8:31:14 AM (1 occurrences)
Last logged: 8:31:14 AM

'types.UnionType' object has no attribute 'origin'
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/dacite/types.py", line 22, in extract_origin_collection
return collection.extra
^^^^^^^^^^^^^^^^^^^^
AttributeError: 'types.UnionType' object has no attribute 'extra'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/roborock/config_flow.py", line 84, in async_step_code
login_data = await self.client.code_login(code)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/roborock/api.py", line 660, in code_login
return UserData.from_dict(user_data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/roborock/containers.py", line 90, in from_dict
return from_dict(cls, decamelize_obj(data, ignore_keys), config=Config(cast=[Enum]))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/dacite/core.py", line 64, in from_dict
value = build_value(type=field_type, data=field_data, config=config)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/dacite/core.py", line 101, in build_value
if is_subclass(type
, cast_type):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/dacite/types.py", line 168, in is_subclass
if is_generic_collection(sub_type):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/dacite/types.py", line 147, in is_generic_collection
origin = extract_origin_collection(type
)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/dacite/types.py", line 24, in extract_origin_collection
return collection.origin
^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'types.UnionType' object has no attribute 'origin'

@cmsite
Copy link

cmsite commented Nov 1, 2023

I have the same problem. Roborock stopped working and i tried reinstall but error in integration.

@Lash-L
Copy link
Contributor

Lash-L commented Nov 1, 2023

This is an issue I have relatively little control over unfortunately. A few other issues have been made that talk about it
#101289
#101857

Basically the following things are of note:

If you have the govee hacs integration, switch to the core integration.

You may need to manually update the dacite install version by executing pip install dacite==1.8.1 inside the home assistant docker container

Lots of info in both of those threads

@crpeck
Copy link

crpeck commented Nov 1, 2023

Just updated Home Assistant, removed Govee HACS, dacite had already been update to 1.8.1, it accepts the code emailed to me, but, "failed to setup device".

@Lash-L
Copy link
Contributor

Lash-L commented Nov 1, 2023

@crpeck share your logs please

@crpeck
Copy link

crpeck commented Nov 1, 2023

Logger: homeassistant.config_entries
Source: config_entries.py:402
First occurred: 3:42:37 PM (2 occurrences)
Last logged: 3:45:17 PM

Error setting up entry [email protected] for roborock
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/dacite/types.py", line 22, in extract_origin_collection
return collection.extra
^^^^^^^^^^^^^^^^^^^^
AttributeError: 'types.UnionType' object has no attribute 'extra'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 402, in async_setup
result = await component.async_setup_entry(hass, self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/roborock/init.py", line 32, in async_setup_entry
home_data = await api_client.get_home_data(user_data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/roborock/api.py", line 711, in get_home_data
return HomeData.from_dict(home_data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/roborock/containers.py", line 90, in from_dict
return from_dict(cls, decamelize_obj(data, ignore_keys), config=Config(cast=[Enum]))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/dacite/core.py", line 64, in from_dict
value = build_value(type=field_type, data=field_data, config=config)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/dacite/core.py", line 95, in _build_value
data = build_value_for_union(union=type, data=data, config=config)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/dacite/core.py", line 113, in _build_value_for_union
return build_value(type=types[0], data=data, config=config)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/dacite/core.py", line 97, in _build_value
data = build_value_for_collection(collection=type, data=data, config=config)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/dacite/core.py", line 154, in build_value_for_collection
return data_type(build_value(type=item_type, data=item, config=config) for item in data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/dacite/core.py", line 154, in
return data_type(build_value(type=item_type, data=item, config=config) for item in data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/dacite/core.py", line 99, in build_value
data = from_dict(data_class=type
, data=data, config=config)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/dacite/core.py", line 64, in from_dict
value = build_value(type=field_type, data=field_data, config=config)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/dacite/core.py", line 101, in build_value
if is_subclass(type
, cast_type):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/dacite/types.py", line 168, in is_subclass
if is_generic_collection(sub_type):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/dacite/types.py", line 147, in is_generic_collection
origin = extract_origin_collection(type
)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/dacite/types.py", line 24, in extract_origin_collection
return collection.origin
^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'types.UnionType' object has no attribute 'origin'

@Lash-L
Copy link
Contributor

Lash-L commented Nov 1, 2023

@crpeck You do not have a fully up to date version of dacite. Make sure you are inside the actual home assistant docker container instead of just the terminal when you are running pip show dacite

@crpeck
Copy link

crpeck commented Nov 1, 2023

My bad - Guess I had to pip installl dacite==1.8.1 again, I did that in the container & restart Home Assistant - it works!!!!!

My bad again, updated manifest.json in giver to dacite>=1.8.0, restarted,
homeassistant:/config/custom_components/govee# pip show dacite
Name: dacite
Version: 1.8.1

installed Roborock, got the exact same error as above. I need giver more than Roborock right now, so...

ha info:

ha info

arch: amd64
channel: stable
docker: 24.0.6
features:

  • reboot
  • shutdown
  • services
  • network
  • hostname
  • timedate
  • os_agent
  • haos
  • resolved
  • journal
  • disk
  • mount
    hassos: "11.1"
    homeassistant: 2023.11.2
    hostname: homeassistant
    logging: info
    machine: generic-x86-64
    operating_system: Home Assistant OS 11.1
    state: running
    supervisor: 2023.11.0
    supported: true
    supported_arch:
  • amd64
  • i386
    timezone: America/New_York

@cmsite
Copy link

cmsite commented Nov 2, 2023

I dont have docker, only HA in raspberry.

My log:

Logger: homeassistant.components.roborock.config_flow
Source: components/roborock/config_flow.py:84
Integration: roborock (documentation, issues)
First occurred: 08:43:13 (1 occurrences)
Last logged: 08:43:13

wrong value type for field "rriot" - should be "roborock.containers.RRiot | None" instead of value "{'u': '51sLrkA3ZVSuKySNh0zkmR', 's': 'vpfPpD', 'h': 'v5Lv5fW8Mt', 'k': 'Esl6iFn4', 'r': {'r': 'EU', 'a': 'https://api-eu.roborock.com', 'm': 'ssl://mqtt-eu-2.roborock.com:8883', 'l': 'https://wood-eu.roborock.com'}}" of type "dict"
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/roborock/config_flow.py", line 84, in async_step_code
login_data = await self._client.code_login(code)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/roborock/api.py", line 660, in code_login
return UserData.from_dict(user_data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/roborock/containers.py", line 90, in from_dict
return from_dict(cls, decamelize_obj(data, ignore_keys), config=Config(cast=[Enum]))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/dacite/core.py", line 68, in from_dict
raise WrongTypeError(field_path=field.name, field_type=field.type, value=value)
dacite.exceptions.WrongTypeError: wrong value type for field "rriot" - should be "roborock.containers.RRiot | None" instead of value "{'u': '51sLrkA3ZVSuKySNh0zkmR', 's': 'vpfPpD', 'h': 'v5Lv5fW8Mt', 'k': 'Esl6iFn4', 'r': {'r': 'EU', 'a': 'https://api-eu.roborock.com', 'm': 'ssl://mqtt-eu-2.roborock.com:8883', 'l': 'https://wood-eu.roborock.com'}}" of type "dict"

@sdrapha
Copy link
Contributor

sdrapha commented Nov 10, 2023

I had the same issues and fixed them with this: LaggAt/hacs-govee#132

EDIT: Not really fixed yet . I still have problems!! 🤦‍♂️

@norimicry
Copy link

+1 having same issue, even with dacite 1.8.1

@AdamWeglarz
Copy link

I have almost clean supervised installation of HA updated to latest release and I also reproduce this issue.

@eosho
Copy link

eosho commented Nov 17, 2023

+1

@Lash-L
Copy link
Contributor

Lash-L commented Nov 17, 2023

If you are having issues and you can confirm you have dacite==1.8.1 - please post your logs

@eosho
Copy link

eosho commented Nov 17, 2023

I just set dicite==1.6.0 in groove manifest.json, rebooted and it's working.

@norimicry
Copy link

norimicry commented Nov 18, 2023

If you are having issues and you can confirm you have dacite==1.8.1 - please post your logs

After setting the Govee manifest.json to

"requirements": ["govee-api-laggat==0.2.2", "dacite==1.8.1"],

and rebooting. When sshing into the box and triggering pip show dacite it does not come up, however. If installed manually, it gets removed after a reboot. But manually installing dacite 1.8.1 via pip does not seem to fix the issue either.

Source: components/roborock/config_flow.py:84
Integration: Roborock (documentation, issues)
First occurred: 8:59:38 AM (1 occurrences)
Last logged: 8:59:38 AM

'types.UnionType' object has no attribute '__origin__'
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/dacite/types.py", line 22, in extract_origin_collection
    return collection.__extra__
           ^^^^^^^^^^^^^^^^^^^^
AttributeError: 'types.UnionType' object has no attribute '__extra__'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/roborock/config_flow.py", line 84, in async_step_code
    login_data = await self._client.code_login(code)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/roborock/api.py", line 660, in code_login
    return UserData.from_dict(user_data)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/roborock/containers.py", line 90, in from_dict
    return from_dict(cls, decamelize_obj(data, ignore_keys), config=Config(cast=[Enum]))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/dacite/core.py", line 64, in from_dict
    value = _build_value(type_=field_type, data=field_data, config=config)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/dacite/core.py", line 101, in _build_value
    if is_subclass(type_, cast_type):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/dacite/types.py", line 168, in is_subclass
    if is_generic_collection(sub_type):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/dacite/types.py", line 147, in is_generic_collection
    origin = extract_origin_collection(type_)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/dacite/types.py", line 24, in extract_origin_collection
    return collection.__origin__
           ^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'types.UnionType' object has no attribute '__origin__'

@norimicry
Copy link

I had the same issues and fixed them with this: LaggAt/hacs-govee#132

EDIT: Not really fixed yet . I still have problems!! 🤦‍♂️

this helped get dacite 1.8.1 to stick but unfortunately did not solve the roborock integration unexpected error issue.

@Lash-L
Copy link
Contributor

Lash-L commented Nov 18, 2023

If you are having issues and you can confirm you have dacite==1.8.1 - please post your logs

After setting the Govee manifest.json to

"requirements": ["govee-api-laggat==0.2.2", "dacite==1.8.1"],

and rebooting. When sshing into the box and triggering pip show dacite it does not come up, however. If installed manually, it gets removed after a reboot. But manually installing dacite 1.8.1 via pip does not seem to fix the issue either.


Source: components/roborock/config_flow.py:84

Integration: Roborock (documentation, issues)

First occurred: 8:59:38 AM (1 occurrences)

Last logged: 8:59:38 AM



'types.UnionType' object has no attribute '__origin__'

Traceback (most recent call last):

  File "/usr/local/lib/python3.11/site-packages/dacite/types.py", line 22, in extract_origin_collection

    return collection.__extra__

           ^^^^^^^^^^^^^^^^^^^^

AttributeError: 'types.UnionType' object has no attribute '__extra__'



During handling of the above exception, another exception occurred:



Traceback (most recent call last):

  File "/usr/src/homeassistant/homeassistant/components/roborock/config_flow.py", line 84, in async_step_code

    login_data = await self._client.code_login(code)

                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/usr/local/lib/python3.11/site-packages/roborock/api.py", line 660, in code_login

    return UserData.from_dict(user_data)

           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/usr/local/lib/python3.11/site-packages/roborock/containers.py", line 90, in from_dict

    return from_dict(cls, decamelize_obj(data, ignore_keys), config=Config(cast=[Enum]))

           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/usr/local/lib/python3.11/site-packages/dacite/core.py", line 64, in from_dict

    value = _build_value(type_=field_type, data=field_data, config=config)

            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/usr/local/lib/python3.11/site-packages/dacite/core.py", line 101, in _build_value

    if is_subclass(type_, cast_type):

       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/usr/local/lib/python3.11/site-packages/dacite/types.py", line 168, in is_subclass

    if is_generic_collection(sub_type):

       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/usr/local/lib/python3.11/site-packages/dacite/types.py", line 147, in is_generic_collection

    origin = extract_origin_collection(type_)

             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/usr/local/lib/python3.11/site-packages/dacite/types.py", line 24, in extract_origin_collection

    return collection.__origin__

           ^^^^^^^^^^^^^^^^^^^^^

AttributeError: 'types.UnionType' object has no attribute '__origin__'

You do not have the right version of dacite.

Try running in terminal "ha core rebuild" that should reinstall all your dependencies.

@norimicry
Copy link

norimicry commented Nov 18, 2023

If you are having issues and you can confirm you have dacite==1.8.1 - please post your logs

After setting the Govee manifest.json to
"requirements": ["govee-api-laggat==0.2.2", "dacite==1.8.1"],
and rebooting. When sshing into the box and triggering pip show dacite it does not come up, however. If installed manually, it gets removed after a reboot. But manually installing dacite 1.8.1 via pip does not seem to fix the issue either.


Source: components/roborock/config_flow.py:84

Integration: Roborock (documentation, issues)

First occurred: 8:59:38 AM (1 occurrences)

Last logged: 8:59:38 AM



'types.UnionType' object has no attribute '__origin__'

Traceback (most recent call last):

  File "/usr/local/lib/python3.11/site-packages/dacite/types.py", line 22, in extract_origin_collection

    return collection.__extra__

           ^^^^^^^^^^^^^^^^^^^^

AttributeError: 'types.UnionType' object has no attribute '__extra__'



During handling of the above exception, another exception occurred:



Traceback (most recent call last):

  File "/usr/src/homeassistant/homeassistant/components/roborock/config_flow.py", line 84, in async_step_code

    login_data = await self._client.code_login(code)

                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/usr/local/lib/python3.11/site-packages/roborock/api.py", line 660, in code_login

    return UserData.from_dict(user_data)

           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/usr/local/lib/python3.11/site-packages/roborock/containers.py", line 90, in from_dict

    return from_dict(cls, decamelize_obj(data, ignore_keys), config=Config(cast=[Enum]))

           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/usr/local/lib/python3.11/site-packages/dacite/core.py", line 64, in from_dict

    value = _build_value(type_=field_type, data=field_data, config=config)

            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/usr/local/lib/python3.11/site-packages/dacite/core.py", line 101, in _build_value

    if is_subclass(type_, cast_type):

       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/usr/local/lib/python3.11/site-packages/dacite/types.py", line 168, in is_subclass

    if is_generic_collection(sub_type):

       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/usr/local/lib/python3.11/site-packages/dacite/types.py", line 147, in is_generic_collection

    origin = extract_origin_collection(type_)

             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/usr/local/lib/python3.11/site-packages/dacite/types.py", line 24, in extract_origin_collection

    return collection.__origin__

           ^^^^^^^^^^^^^^^^^^^^^

AttributeError: 'types.UnionType' object has no attribute '__origin__'

You do not have the right version of dacite.

Try running in terminal "ha core rebuild" that should reinstall all your dependencies.

After ha core rebuild

Logger: homeassistant.components.roborock.config_flow
Source: components/roborock/config_flow.py:84
Integration: Roborock (documentation, issues)
First occurred: 7:42:06 AM (1 occurrences)
Last logged: 7:42:06 AM

'types.UnionType' object has no attribute '__origin__'
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/dacite/types.py", line 22, in extract_origin_collection
    return collection.__extra__
           ^^^^^^^^^^^^^^^^^^^^
AttributeError: 'types.UnionType' object has no attribute '__extra__'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/roborock/config_flow.py", line 84, in async_step_code
    login_data = await self._client.code_login(code)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/roborock/api.py", line 660, in code_login
    return UserData.from_dict(user_data)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/roborock/containers.py", line 90, in from_dict
    return from_dict(cls, decamelize_obj(data, ignore_keys), config=Config(cast=[Enum]))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/dacite/core.py", line 64, in from_dict
    value = _build_value(type_=field_type, data=field_data, config=config)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/dacite/core.py", line 101, in _build_value
    if is_subclass(type_, cast_type):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/dacite/types.py", line 168, in is_subclass
    if is_generic_collection(sub_type):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/dacite/types.py", line 147, in is_generic_collection
    origin = extract_origin_collection(type_)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/dacite/types.py", line 24, in extract_origin_collection
    return collection.__origin__
           ^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'types.UnionType' object has no attribute '__origin__'

Confirmed version 1.8.1 after

docker exec -it homeassistant bash

and

pip show dacite

@BillyFKidney
Copy link

If you are having issues and you can confirm you have dacite==1.8.1 - please post your logs
The following steps resolved my issue:

  1. Remove all Govee (Cloud) devices from HA Integrations
  2. Restart HA
  3. Remove Govee (Cloud) from HACS
  4. Restart HA
  5. From terminal ha core rebuild
    6a) Wait on rebuild / restart
    6b) Add Roborock Integration

If I did not restart HA twice it failed to remove everything properly and the rebuild did not resolve the problem. :)

@norimicry
Copy link

If you are having issues and you can confirm you have dacite==1.8.1 - please post your logs

The following steps resolved my issue:

  1. Remove all Govee (Cloud) devices from HA Integrations

  2. Restart HA

  3. Remove Govee (Cloud) from HACS

  4. Restart HA

  5. From terminal ha core rebuild

6a) Wait on rebuild / restart

6b) Add Roborock Integration

If I did not restart HA twice it failed to remove everything properly and the rebuild did not resolve the problem. :)

Yes removing Govee works, but what about people who want to use both? Switching to Govee LAN helped me get both working together.

@sdrapha
Copy link
Contributor

sdrapha commented Nov 23, 2023

Govee Lan is only compatible with a very small subset of devices, almost nothing. Not a workaround for most people.

I did manage only once to have Roborock working while Govee installed and working at same time. But that was a fluke, out of me troubleshooting some unrelated dns resolver issues. So my connection was on and off in the meantime, and I ended up with both running, which was weird.

From my ad-hoc experimentation. together with some wild guessing:
I think there is some sort of race condition setting up the integrations. if Roborock gets its setup first, than it works.

So here it comes the really wild guess, excuse me if I'm talking bananas, but I hope at least I inspire someone in the right direction:

Maybe the code on Dacite is instantiating some kind of protected class that can not be Really instantiated more than once. Hence whoever get to it first gets the free pass. And not the others.

@atle-dahlman
Copy link

atle-dahlman commented Nov 23, 2023

Sigh....
I have the same problem. After updating HA OS from 2023.11.2 to 2023.11.3 the Roborock integration stopped working.
I have the same integration, with the same Roborock account in my summer house, which are still working (not upgraded yet).
Neither place have ever had the Govee HACS integration installed.
This is my error log:

`Logger: homeassistant.config_entries
Source: config_entries.py:402
First occurred: 16:52:51 (2 occurrences)
Last logged: 17:01:25

Error setting up entry [email protected] for roborock
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 402, in async_setup
result = await component.async_setup_entry(hass, self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/roborock/init.py", line 45, in async_setup_entry
network_results = await asyncio.gather(
^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/roborock/api.py", line 513, in get_networking
return await self.send_command(RoborockCommand.GET_NETWORK_INFO, return_type=NetworkInfo)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/roborock/api.py", line 404, in send_command
response = await self._send_command(method, params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/roborock/cloud_api.py", line 207, in _send_command
return await self.send_message(roborock_message)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/roborock/cloud_api.py", line 185, in send_message
(response, err) = await async_response
^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/roborock/api.py", line 335, in _wait_response
raise RoborockTimeout(f"id={request_id} Timeout after {self.queue_timeout} seconds") from None
roborock.exceptions.RoborockTimeout: id=25451 Timeout after 10 seconds
`

@Lash-L
Copy link
Contributor

Lash-L commented Nov 24, 2023

@atle-dahlman unless you have more logs. Your vacuum isn't reachable from the cloud. As it currently stands (will change in 2023.12) - if you have a signle device offline, the integration will not start

@Lash-L
Copy link
Contributor

Lash-L commented Nov 24, 2023

Anyone stitll having problems:

Attempt updating your govee hacs to the latest version or switch to the govee lan integration (my understanding is it still works with most govee devices). This is the downside of custom integrations, If it were a core integration, I could have likely fixed the problem within hours, but since it is custom, I had no power or control

@chpego
Copy link
Contributor

chpego commented Nov 24, 2023

Hi !
I've HA OS, never installed Govee, i've the same error:

Logger: homeassistant.config_entries
Source: config_entries.py:402
First occurred: 09:24:18 (1 occurrences)
Last logged: 09:24:18

Error setting up entry [email protected] roborock
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 402, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/roborock/__init__.py", line 45, in async_setup_entry
    network_results = await asyncio.gather(
                      ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/roborock/api.py", line 513, in get_networking
    return await self.send_command(RoborockCommand.GET_NETWORK_INFO, return_type=NetworkInfo)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/roborock/api.py", line 404, in send_command
    response = await self._send_command(method, params)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/roborock/cloud_api.py", line 207, in _send_command
    return await self.send_message(roborock_message)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/roborock/cloud_api.py", line 185, in send_message
    (response, err) = await async_response
                      ^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/roborock/api.py", line 335, in _wait_response
    raise RoborockTimeout(f"id={request_id} Timeout after {self.queue_timeout} seconds") from None
roborock.exceptions.RoborockTimeout: id=26037 Timeout after 10 seconds

In my homeassistant container:

homeassistant:/config# pip show dacite
Name: dacite
Version: 1.8.1
Summary: Simple creation of data classes from dictionaries.
Home-page: https://github.com/konradhalas/dacite
Author: Konrad Hałas
Author-email: [email protected]
License: MIT
Location: /usr/local/lib/python3.11/site-packages
Requires: 
Required-by: brother, gios, home-assistant-chip-clusters, nettigo-air-monitor, python-matter-server, python-roborock

@atle-dahlman
Copy link

@atle-dahlman unless you have more logs. Your vacuum isn't reachable from the cloud. As it currently stands (will change in 2023.12) - if you have a signle device offline, the integration will not start

Ok, thanks. Didn't know that all devices had to be online.
Just before the upgrade I had added another robot, and taken the old one offline. When I turned on the old one again, everything was fine.

@Lash-L
Copy link
Contributor

Lash-L commented Nov 29, 2023

Closing this issue as there is a confirmed solution and anyone still having problems is seemingly having a seperate problem.

Quoting what I said above for anyone else who coms upon this thread

Attempt updating your govee hacs to the latest version or switch to the govee lan integration (my understanding is it still works with most govee devices). Restart Home Assistant

@Lash-L
Copy link
Contributor

Lash-L commented Nov 29, 2023

@home-assistant close

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests