DeebotUniverse / Deebot-4-Home-Assistant

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

Migrating and merging this component with the Ecovacs core integration #512

Open edenhaus opened 5 months ago

edenhaus commented 5 months ago

I'm currently migrating this integration to the core to make it easier to use it and add the ability to translate it into all supported languages. This issue is here to track the status.

This whole component will be included in HA 2024.2 except for the following things:

Migrations steps

1: Remove all Deebot 4 Home Assistant config entries 2: Uninstall Deebot 4 Home Assistant via HACS 3: Restart Home Assistant 4: Setup the builtin Ecovacs integration

If you have issues setting up the core integration, make sure no deebot folder exists under [config dir]/custom_components (Delete it if it exists) and restart Home Assistant

scooper1 commented 5 months ago

the builtin Ecovacs integration is failing to authorise in the United Kingdom working fine before migration feb beta 2

edenhaus commented 5 months ago

the builtin Ecovacs integration is failing to authorise in the United Kingdom working fine before migration feb beta 2

@scooper1 Reported with https://github.com/home-assistant/core/issues/109336 and should be fixed with the next beta

Ali229 commented 4 months ago

When I try to setup using integration it loads the setup for a long time and shows this: Config flow could not be loaded: Unknown error

Also can you tell me where are the cofig entries I should delete for Deebot 4 Home Assistant

Update: Restarted home assistant and the Ecovacs integration setup worked

MVladislav commented 4 months ago

The new core version is failing for me with authenticate for the self hosted bumper version. It is because of cert verify failing, as i use bumper with https.

My current intermediate solution is as follow:

$docker exec -it homeassistant bash -c "sed -i 's/async_get_clientsession(hass)/async_get_clientsession(hass, verify_ssl=False)/g' /usr/src/homeassistant/homeassistant/components/ecovacs/config_flow.py"
$docker exec -it homeassistant bash -c "sed -i 's/async_get_clientsession(self._hass)/async_get_clientsession(self._hass, verify_ssl=False)/g' /usr/src/homeassistant/homeassistant/components/ecovacs/controller.py"
mariomaz87 commented 4 months ago

Hi, I'm planning on migrating but I have one question about point 1: "Remove all Deebot 4 Home Assistant config entries". What do you mean specifically? I set up the HACS integration using the UI so I don't have created any config entries manually. Thanks!

edenhaus commented 4 months ago

Hi, I'm planning on migrating but I have one question about point 1: "Remove all Deebot 4 Home Assistant config entries". What do you mean specifically? I set up the HACS integration using the UI so I don't have created any config entries manually. Thanks!

I added a link, which should show all your config entries. You need to remove all first

jayscovill commented 4 months ago

I've migrated to the core integration but am having problems with the service call in my automation not working. I previously used this in my automation, which worked fine with the Deebot HACS integration:

service: vacuum.send_command
data:
  params:
    rooms: 0
    cleanings: 1
  command: spot_area
target:
  entity_id: vacuum.george

This still seems to work fine if I manually run the action in the automation. But when it's called from the automation, which is triggered buy a schedule event, it just seems to skip over and exit the automation.

image
edenhaus commented 4 months ago

@jayscovill Please create an issue in the core repo with the automation traces and logs

aidbish commented 4 months ago

I have migrated to the core integration, but it seems it no longer has the command to refresh, will this be added at a later date?

edenhaus commented 4 months ago

I have migrated to the core integration, but it seems it no longer has the command to refresh, will this be added at a later date?

Nope as also in this integration that command is deprecated. Please use the builtin update_entity service

Stopka commented 4 months ago

I have migrated to the core integration and nowI am missing the last_cleaning sensor. Especially I used it's timestamp attribute in my automations to check if cleaning was already done today. Why is it missing? Or is there other way to get this value?

myhomeiot commented 4 months ago

Also missing way to get last_cleaning, meanwhile I make this by saving time at input_text but sure this was a good sensor in previous version.

jayscovill commented 4 months ago

I've never had a last cleaning sensor for the X1 Omni and I've done the same thing. As part of the cleaning automation I write the current date/time to a input_datetime.

service: input_datetime.set_datetime
target:
  entity_id: input_datetime.vacuum_cleaning_start
data:
  datetime: "{{ now().strftime('%Y-%m-%d %H:%M:%S') }}"
ianackerley commented 4 months ago

I feel like I'm missing something really obvious here (sorry) but without the cleaning_job event what's the best way to monitor for successful completion of a job?

edenhaus commented 4 months ago

I have migrated to the core integration and nowI am missing the last_cleaning sensor. Especially I used it's timestamp attribute in my automations to check if cleaning was already done today. Why is it missing? Or is there other way to get this value?

You can use the state of the vacuum itself. You can use it like in the comment above or you can extract the value with https://www.home-assistant.io/integrations/history_stats/

The last cleaning sensor was not migrated as all information are already available from other sensors

edenhaus commented 4 months ago

I feel like I'm missing something really obvious here (sorry) but without the cleaning_job event what's the best way to monitor for successful completion of a job?

Good point I completely forgot about this event. Sorry. Will check with the core team, if there is a better solution as firing the event

smarthomesydney commented 4 months ago

Hi @edenhaus Sorry to see you merge. Have used your integration for years. Thank you

Quick Q Without the custom_command, how do I call only specific rooms to be cleaned, based on the room number in the entity info?

Stopka commented 4 months ago

I have migrated to the core integration and nowI am missing the last_cleaning sensor. Especially I used it's timestamp attribute in my automations to check if cleaning was already done today. Why is it missing? Or is there other way to get this value?

Ok, I found solution that serves me well. I created event-triggered template sensor that holds the needed information for me:

template:
  - trigger:
      - platform: state
        entity_id: 
          - vacuum.r2d2
        to: 
          - cleaning
    sensor:
      - name: R2D2 Last cleaning time
        state: "{{ now() }}"
        device_class: timestamp
        icon: 'mdi:clock' 
edenhaus commented 3 months ago

I feel like I'm missing something really obvious here (sorry) but without the cleaning_job event what's the best way to monitor for successful completion of a job?

I will implement event entities for it. Should be available hopefully with the next version :) https://github.com/home-assistant/core/pull/113826

edenhaus commented 3 months ago

Sorry to see you merge. Have used your integration for years. Thank you

Why sorry? Having the integration directly in the core makes it easier to maintain it.

Without the custom_command, how do I call only specific rooms to be cleaned, based on the room number in the entity info?

Why do you need a custom component for it? Why aren't you using the send_command for it?