KrzysztofHajdamowicz / home-assistant-vacuum-styj02ym

81 stars 24 forks source link

Platform error vacuum.rest - No module named 'homeassistant.components.rest.vacuum' #36

Open jeremysherriff opened 2 years ago

jeremysherriff commented 2 years ago

Integration version: 1.30

Home Assistant Core 2022.6.7 Home Assistant Supervisor 2022.05.3 Home Assistant OS 8.2

Error:

2022-07-06 18:51:26 ERROR (MainThread) [homeassistant.components.hassio] The system cannot restart because the configuration is not valid: Platform error vacuum.rest - No module named 'homeassistant.components.rest.vacuum'
2022-07-06 18:51:26 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [139861637089168] The system cannot restart because the configuration is not valid: Platform error vacuum.rest - No module named 'homeassistant.components.rest.vacuum'
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 193, in handle_call_service
    await hass.services.async_call(
  File "/usr/src/homeassistant/homeassistant/core.py", line 1704, in async_call
    task.result()
  File "/usr/src/homeassistant/homeassistant/core.py", line 1741, in _execute_service
    await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)(
  File "/usr/src/homeassistant/homeassistant/components/hassio/__init__.py", line 684, in async_handle_core_service
    raise HomeAssistantError(
homeassistant.exceptions.HomeAssistantError: The system cannot restart because the configuration is not valid: Platform error vacuum.rest - No module named 'homeassistant.components.rest.vacuum'

Configuration:

vacuum:
  - platform: miio2
    host: 192.168.220.126
    token: !secret bert_token
    name: Bert
  - platform: miio2
    host: 192.168.220.133
    token: !secret wally_token
    name: Wally

When I comment out the configuration lines above, I am able to verify the yaml and restart fine but obviously have lost HA control of my vacuums.

Is there an updated configuration I need to use instead?

jeremysherriff commented 2 years ago

I should mention I have uninstalled and reinstalled the integration from HA/HACS, every time I re-enable the configuration lines I can no longer check configuration successfully.

honkerst commented 1 year ago

Any difference with only one vacuum in your config?

I have two different Xiaomi vacuums, the original one and a much newer Mop Pro, and noticed when setting up this integration I could not run it alongside the normal miio integration for my other vacuum. I don't remember the error but neither one worked. In the end I could only solve it by running each integration on separate HA installs.

jeremysherriff commented 1 year ago

Have a look into the "Xiaomi Miot Auto" integration (it's in HACS): image

I never resolved this issue and I believe it was a python dependency issue which sounds like what you are also experiencing. I moved to the Miot integration which resolved my problem, it was almost seamless in terms of swapping the entities in my automations (there was some minor renaming needed for some of the attributes). I suspect it will natively support both your Xiaomi vacuums, but even if it only supports the Mop Pro there is a chance that the dependency clash will be avoided.