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.21k stars 30.58k forks source link

Google Assistant dosen't support non-StateVacuumDevice #18391

Closed dbradley771 closed 5 years ago

dbradley771 commented 5 years ago

Home Assistant release with the issue: Home Assistant 0.82.0

Last working Home Assistant release (if known): None

Operating environment (Hass.io/Docker/Windows/etc.): Windows 10 Home

Component/platform: Google Assistant Vacuum cleaner robots

Description of problem: The new Google Assistant vacuum support added in #17657 only seems to work with the relatively new StateVacuumDevice vacuums (added in #15573). I believe this is because the StartStopTrait for Google Assistant only uses vacuum.SERVICE_START, which is only available to StateVacuumDevice and not the regular VacuumDevice.

I looked into fixing this but am unsure of what the proper way would be. Here is what I thought of so far:

...or another way I didn't think of. It seems weird that there is a STOP command but not a START command in _BaseVacuum. Is it a goal to move everything over to StateVacuumDevices?

Problem-relevant configuration.yaml entries and (fill out even if it seems unimportant):

google_assistant:
  project_id: !secret google_project_id
  api_key: !secret google_api_key
  expose_by_default: false
  entity_config:
    vacuum.living_room:
      expose: true
      name: 'Living Room Vacuum'

ecovacs:
  username: !secret vacuum_email
  password: !secret vacuum_password
  country: US
  continent: NA

Traceback (if applicable):

2018-11-11 16:56:16 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "C:\Program Files\Python36\lib\site-packages\homeassistant\helpers\service.py", line 224, in _handle_service_platform_call
    await getattr(entity, func)(**data)
AttributeError: 'EcovacsVacuum' object has no attribute 'async_start'
kmlucy commented 5 years ago

I'm having the same issue. 'Stop' also isn't working, but 'pause' and 'charge' work.

dshokouhi commented 5 years ago

I thought the plan was to move all vacuum platforms to the new StateVacuumDevice method, that was actually the intention behind the new states for vacuums.

https://github.com/home-assistant/architecture/issues/29

dbradley771 commented 5 years ago

I'm having the same issue. 'Stop' also isn't working, but 'pause' and 'charge' work.

Interesting. Didn't seem like that could happen from the code I looked over. What vacuum are you using?

I thought the plan was to move all vacuum platforms to the new StateVacuumDevice method, that was actually the intention behind the new states for vacuums.

That's what I assumed as it dosen't seem great to have two options. I guess we'll just have to go down the route of updating them all, unless anyone has a better idea...

dshokouhi commented 5 years ago

@dbradley771 in order to respond to the query requests sent from google you need to have the other platforms updated for the new states. Neato and Xiaomi have already been updated to support this. I recommend updating your platform to support the new model to take advantage of it.

dbradley771 commented 5 years ago

@dbradley771 in order to respond to the query requests sent from google you need to have the other platforms updated for the new states. Neato and Xiaomi have already been updated to support this. I recommend updating your platform to support the new model to take advantage of it.

Makes sense. I'll look into updating Ecovacs, since that's what I have.

@OverloadUT you seem to have knowledge on the Ecovacs vacuum. Is it possible to update it to use StateVacuumDevice?

OverloadUT commented 5 years ago

Yes, migrating Ecovacs to StateVacuumDevice is on my roadmap, but personal development has been slow so I am happy to review someone else's PR if they've got more time right now. Ecovacs has a couple of critical issues that I need to fix as well :(

kmlucy commented 5 years ago

@dbradley771 I have a N79. It's not the same error as with start. With start, Google thinks it's fine but I get an error in my Home Assistant Logs. With stop, Google throws an error and nothing shows up in my Home Assistant Logs.

dbradley771 commented 5 years ago

@kmlucy Hmm, no logs ya say? I'm guessing Google is giving the standard "Sorry, something went wrong"?

Home Assistant doesn't show the stop command in the logs?

kmlucy commented 5 years ago

Right on all counts.

dbradley771 commented 5 years ago

I wonder if telling Google to re-sync might help. I don't know too much about the Google Assistant or Ecovacs systems, so I can't fully digestions your problems. Although it sounds like a Google Assistant problem to me...

kmlucy commented 5 years ago

I didn't even need to resync. Whatever was causing the error yesterday is gone and 'stop' is working now. Thanks for the help. 'Start' still isn't working, but thats in the known scope of this issue.

marchingphoenix commented 5 years ago

Google Assistant Trait working as intended. vacuum components will need to be updated to support the vacuum.SERVICE_START service.

marchingphoenix commented 5 years ago

Closing as there has been no further comment in 30 days.