Husqvarna Automower monitoring

Hi,

Since ugrade to 0.88 the Automower integration is not working properly anymore.

2019-02-23 17:46:18 ERROR (MainThread) [homeassistant.loader] Error loading custom_components.automower.vacuum. Make sure all dependencies are installed
Traceback (most recent call last):
  File "/usr/src/app/homeassistant/loader.py", line 147, in _load_file
    module = importlib.import_module(path)
  File "/usr/local/lib/python3.7/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 962, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'custom_components.automower.vacuum'; 'custom_components.automower' is not a package
2019-02-23 17:46:18 WARNING (MainThread) [homeassistant.loader] Integrations need to be in their own folder. Change vacuum/automower.py to automower/vacuum.py. This will stop working soon.

Make a new folder in custom_components called automower. in that folder you put all the three files, but rename the one that was in the sensors-folder to sensor.py, the one in device_tracker-folder to device_tracker.py. Then it should work. You might have to rename automower.py to __init__.py

1 Like

I have tried moving/renaming as follows:
automower.py -> custom_components/automower/automower.py device_tracker/automower.py -> custom_components/automower/device_tracker.py vacuum/automower.py -> custom_components/automower/vacuum.py

I have also tried:
automower.py -> custom_components/automower/__init__.py

But I only get these error messages:

Error loading custom_components.automower.vacuum. Make sure all dependencies are installed
Traceback (most recent call last): File “/usr/local/lib/python3.7/site-packages/homeassistant/loader.py”, line 147, in _load_file module = importlib.import_module(path) File “/usr/local/lib/python3.7/importlib/init.py”, line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File “<frozen importlib._bootstrap>”, line 1006, in _gcd_import File “<frozen importlib._bootstrap>”, line 983, in _find_and_load File “<frozen importlib._bootstrap>”, line 967, in _find_and_load_unlocked File “<frozen importlib._bootstrap>”, line 677, in _load_unlocked File “<frozen importlib._bootstrap_external>”, line 728, in exec_module File “<frozen importlib._bootstrap>”, line 219, in _call_with_frames_removed File “/config/custom_components/automower/vacuum.py”, line 8, in <module> from homeassistant.components.automower import DOMAIN as AUTOMOWER_DOMAIN ModuleNotFoundError: No module named ‘homeassistant.components.automower’

Error loading custom_components.automower.device_tracker. Make sure all dependencies are installed
Traceback (most recent call last): File “/usr/local/lib/python3.7/site-packages/homeassistant/loader.py”, line 147, in _load_file module = importlib.import_module(path) File “/usr/local/lib/python3.7/importlib/init.py”, line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File “<frozen importlib._bootstrap>”, line 1006, in _gcd_import File “<frozen importlib._bootstrap>”, line 983, in _find_and_load File “<frozen importlib._bootstrap>”, line 967, in _find_and_load_unlocked File “<frozen importlib._bootstrap>”, line 677, in _load_unlocked File “<frozen importlib._bootstrap_external>”, line 728, in exec_module File “<frozen importlib._bootstrap>”, line 219, in _call_with_frames_removed File “/config/custom_components/automower/device_tracker.py”, line 8, in <module> from homeassistant.components.automower import DOMAIN as AUTOMOWER_DOMAIN ModuleNotFoundError: No module named ‘homeassistant.components.automower’

Hi,

I have the same issue.

Br
Johannes

Ah. You also need to change this import “homeassistant.components.automower import DOMAIN as AUTOMOWER_DOMAIN”
to custom_components.automower import DOMAIN as AUTOMOWER_DOMAIN I think, I can’t look at the files right now. In both device tracker and vacuum file.

3 Likes

Now it works again! :+1: :slight_smile: Thank you!

This is what I did just to clarify:
Moved/renamed:
automower.py -> custom_components/automower/__init__.py device_tracker/automower.py -> custom_components/automower/device_tracker.py vacuum/automower.py -> custom_components/automower/vacuum.py

And changed the files device_tracker.py and vacuum.py like you described above

from:
from homeassistant.components.automower import DOMAIN as AUTOMOWER_DOMAIN
to:
from custom_components.automower import DOMAIN as AUTOMOWER_DOMAIN

2 Likes

@jansh My 430X is reporting the status OFF_DISABLED when powered off and stored in my garage. I suggest that these two lines are entered at appropriate positions in automower/init.py.
STATUS_OFF_DISABLED = ‘OFF_DISABLED’
STATUS_OFF_DISABLED: {‘icon’: ‘mdi:close-circle-outline’, ‘message’: ‘Off’}

1 Like

Hi I’d like to try this component, I’ve downloaded the files from here:

Once I’ve added the files to my custom components folder, how do I set up the options in my config files? Are there any docs or do I just need to put in a username and password?

Followed your advice but get the following error, cant figure out why.

2019-04-05 22:36:41 ERROR (MainThread) [homeassistant.loader] Unable to find platform automower. Search path was limited to path of component: custom_components
2019-04-05 22:36:41 ERROR (MainThread) [homeassistant.setup] Unable to prepare setup for platform automower.vacuum: Platform not found.
2019-04-05 22:36:41 ERROR (MainThread) [homeassistant.loader] Unable to find platform automower. Search path was limited to path of component: custom_components
2019-04-05 22:36:41 ERROR (MainThread) [homeassistant.setup] Unable to prepare setup for platform automower.device_tracker: Platform not found.

Based on those I’d say it can’t find the component in the custom components folder. You sure it’s in the right place and folder structure?

Could someone please explain what files I need to put where?
I tried to download the .zip-file and put them in the homeassistant directory but I just got a bunch of error messages saying I need to make sure all dependencies are installed and
No module named 'custom_components.automower.vacuum'; 'custom_components.automower' is not a package

It also told me to change the file names of
vacuum/automower.py to automower/vacuum.py
and
device_tracker/automower.py to automower/device_tracker.py
but after that I got the same message regarding dependencies and also
Unable to find platform automower. Search path was limited to path of component: custom_components

What dependencies do I need to install? It’s not that clear in the error message…

I ran into the same issue myself, but after some trying I got it working placing the files like this :

custom_components/automower/__init__.py
custom_components/automower/device_tracker.py
custom_components/automower/vacuum.py

(do you know which files Im referring to above)

Niklas

This: Husqvarna Automower monitoring

Thanks,

If I take the files from the Git is it suppose to be like this then:

git: homeassistant/components/automower.py -> custom_components/automower/__init__.py
git: homeassistant/components/device_tracker/automower.py -> custom_components/automower/device_tracker.py
git: homeassistant/components/vacuum/automower.py -> custom_components/automower/vacuum.py

@Christian_Hollbjar yeah I tried that but I’m a bit confused to exactly which files he meant.

Yeah, that should do it :slight_smile:

1 Like

F****** amazing, it works now. Thank you! :smiley:

1 Like

In my switch: section I added this:

  - platform: template
    switches:
      automower_switch:
        entity_id: vacuum.automower_420
        value_template: "{{ is_state('vacuum.automower_420', 'on') }}"
        turn_on:
          service: vacuum.turn_on
          data:
            entity_id: vacuum.automower_420
        turn_off:
          service: vacuum.turn_off
          data:
            entity_id: vacuum.automower_420

To sync it too Google Home as a switch. But when I say “OK Google, stop lawn mower” it only pauses it. What service do I need to call to make it go back home to the charging station?

EDIT: I should have looked around a bit more. I changed it to vacuum.return_to_base instead of vacuum.turn_off

you do know that you can talk to Automower without HA? just say “OK Google, Talk to Automower”

Did not know that. Thank you for that! However I want it in HA so I can link it with my sprinkler system so my sprinklers wont start when the Automower is out.

2 Likes

Hi, After updating to latest hass.io 0.93 this beautiful integration stopped working for me.