Husqvarna Automower monitoring

@jansh, how can I help? I would love to see this integrated natively. I can do dev work, what is needed? I’ve been using the custom component and it seems to work well from what I can tell.

Thanks! I’m glad that so many people are successfully using my component.

I think step 1 would be deciding on a strategy for the entity. @balloob said he’d favour a new component which would also be the easiest to implement because we wouldn’t mess with existing vacuum cleaners relying on the vacuum entity.

Then, step 2 would be actually introducing the new lawnmower entity in a fork.

Step 3 would be refactoring my custom component to use lawnmower instead of vacuum.

Step 4 would be figuring out if we need a test suite.

Step 5 would be preparing a pull request against HA and getting a code review from the core team.

Any contributions are welcome! Either as PR to my repo or directly to HA.

4 Likes

I have the Gardena Sileno Smart City 500 lawnmower. Gardena is owned by Husqvarna and supposedly use the same infrastructure. Is it possible to add Gardena support to this solution?

It’s really all about Husqvarna’s API. This communicates to Husqvarna servers to relay commands, so if it works like that then it probably already just works…

Otherwise, it would need to be it’s own module.

Hi again!

It’s great to see that efforts are being made to make this into it’s own module.

Now, have anyone used this custom component for any automations, yet?

I just got a rain gauge and would like to send my mower to it’s little house when it rains. But I can’t figure out the different states.
When reading through this thread I get start/stop/park, but when I check active states in HA I get on/off/park as the ones actually being used.
But if I use “on” in an automation, my automations will not load unless I use “start”.
Due to lack of rain I havn’t been able to test it yet. :slight_smile:

Does anyone have insight in how to call for it to park until further notice and then call again to activate the timer?

I’ve created a custom component for the Garena Smart devices which is discussed in this topic:

@jansh
Just checking the sha256sum of your file and it’s different to the one linked above ^^.

Any cause for concern or has it changed or do I have the wrong command?
Cheers R.

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