Husqvarna Automower monitoring

Here we go, it’s working now as a custom component. If you’re interested in checking out the current status of the Automower component, copy this .zip file into your ~/.homeassistant/ folder and unzip it.

After that, add the following to your configuration.yaml:

automower:
    username: <your husqvarna connect email>
    password: <your husqvarna connect password>

The component will add a device tracker and a vacuum (I know) to your HA instance. You’ll be able to see where your Automower is, what its status is and you’ll be able to start/stop/park it.

Here are two current screenshots:

SHA256 checksum of that zip file is e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855.

1 Like

Thanks for this!

Just installed it and it seems to be working fine.

1 Like

Thanks for your feedback! :grinning:

@jenslj which Automower model do you have and which model code is displayed when you click on the device tracker badge at the top? Mine was H which I translated to 450X. Happy to add your model as well.

Edit: Also, if your mower runs into any errors (outside working area, etc.) and there is no lastErrorMessage in HomeAssistant, feel free to let me know the lastErrorCode from HA and the error message displayed in the Automower app (or on its display). I’d like to add all possible error codes step by step…

Hey!

So the model reported is: L. Mine is a 315.

But now I sort of have a semi-contact with the mower. So the controls for stopping and starting seem to work but not the status updates.
What I really liked about your screenshots was the ability to see that shift in status, like how long it has been cutting and charging during the day.

There are 2 different status screens. One if I click the logo in HA, another if I click my mowers name under Vacuum (by the panels). One says stopping, the other says parked due to timer. And it’s mowing.

Can I share anything with you that will help you improve this?
I think the idea is solid and should be an available add-on for HA. I’m just now thinking about the possibilities to start and stop the mower based on where I am, the weather and so on. Seems much better than the schedule.

Why Husqvarna is not developing plugins for all available smart plattforms is beyond me. Then they could offer the basic functionality in the app and even more via another system.

So the model reported is: L. Mine is a 315.

Thanks, added.

There are 2 different status screens. One if I click the logo in HA, another if I click my mowers name under Vacuum (by the panels).

Yes, the first one is a device tracker. It should display a GPS position if your mower is equipped with GPS. Does it show Longitude and Latitude? I have created zones in HA for my different lawns:

I can also see where the mower is on the map in HA:

The panel under vacuum is for controlling the mower (start/stop/park). The vacuum platform however only tracks status history as “on” or “off”.

You can see the detailed status when you click on your mower under vacuum. It should display a line that says “Status: …”. By the way, if you see a technical all caps code here (e.g. OK_CUTTING) instead of a proper english word or phrase, please let me know the exact spelling of the code and what your Husqvarna app or the mower itself reports as its current status. I have collected a few statuses already, but I’m sure I’m missing a few still. The same goes for lastErrorCodes.

What I really liked about your screenshots was the ability to see that shift in status, like how long it has been cutting and charging during the day.

I might re-introduce a simple sensor then in addition to the device tracker and the vacuum that only displays the detailed mower status. That would enable you to analyse the history, percentage, length, etc. of cutting, charging, searching base, etc. Thanks for your feedback.

One says stopping, the other says parked due to timer. And it’s mowing. Can I share anything with you that will help you improve this?

That’s strange. It might be the caching. When you do notice a discrepancy between what your Husqvarna app says and what HA says, the following would help me:

  • The value of storedTimestamp that the vacuum panel should show you.
  • The entire JSON output you’re seeing when you run husmow --login '<your username>' --password '<your pw>' status on a command line. (You might need to pip install pyhusmow before you can run husmow.)
  • If the problem still occurs after a complete HA restart.

Thanks!

Why Husqvarna is not developing plugins for all available smart plattforms is beyond me.

I get it. It’s a lot of work to build and to maintain. There are a ton of automation platforms like OpenHAB, domoticz, etc. Their support staff would need to be trained to support all those, and much more. I completely get why they only offer their app.

I just started with Home Assistant, so I do not know a lot about it.
I am using two Husqvarna Automowers at my home, so I would like to use this.

I downloaded the .zip file and extracted it in my .homeassistant folder and added the part with the username and password in the configuration.yaml file, but I get an invalid config error:

The following components and platforms could not be set up:
automower
Please check your config

Please have a look at your home-assistant.log and tell us what it says. I’m sure we can work it out.

It says:
2017-09-11 14:24:02 ERROR (MainThread) [homeassistant.loader] Error loading custom_components.automower. Make sure all dependencies are installed
Traceback (most recent call last):
File “/srv/homeassistant/lib/python3.4/site-packages/homeassistant/loader.py”, line 141, in get_component
module = importlib.import_module(path)
File “/usr/lib/python3.4/importlib/init.py”, line 109, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File “”, line 2254, in _gcd_import
File “”, line 2237, in _find_and_load
File “”, line 2226, in _find_and_load_unlocked
File “”, line 1200, in _load_unlocked
File “”, line 1129, in _exec
File “”, line 1471, in exec_module
File “”, line 321, in _call_with_frames_removed
File “/home/homeassistant/.homeassistant/custom_components/automower.py”, line 14, in
from homeassistant.components.vacuum import (
ImportError: No module named ‘homeassistant.components.vacuum’
2017-09-11 14:24:03 ERROR (MainThread) [homeassistant.loader] Unable to find component automower
2017-09-11 14:24:03 ERROR (MainThread) [homeassistant.setup] Setup failed for automower: Component not found.

I’m no HA expert yet, but No module named 'homeassistant.components.vacuum’ seems to be of relevance here.

Automower depends on the vacuum platform which seems to have been introduced in 0.51 earlier in August this year.

Are you running a version earlier than 0.51? If yes, please update your HA before attempting to run the Automower component.

Hi, I extracted the files and it worked all fine. I have a 430X and it shows as Model G. Thanks for this. Great work!

@Orgath thanks! I’ve added model code G.

@Rick_Havinga is it working for you now? I would be really interested in some screenshots of more than mower in HA. I have only one and wasn’t able to test it.

@jenslj were you able to do some further debugging?

@Kristoffer_Stoffe_Pe were you able to install it using the zip file?

Yes, it does work now:

@Rick_Havinga awesome, thanks! Which model is “Jan”? I see that it shows model code K. If you let me know which model that is, I’ll add it to the list. Same goes for “Hendrik”. Is it a K as well or something different?

Sorry for not getting back sooner,

but most issues I had got solved by a restart of the raspberry pi. So now it works as expected.
I’ll keep on eye out for any status messages or errors not covered and send you those I find.

I was intrigued by your zones! How do you set that up?

So now it works as expected.

Great to hear!

I was intrigued by your zones! How do you set that up?

That isn’t specific to Automower, it’s a default HA feature. Check out the docs here.

Thanks! Did not know that feature existed.

So all te new stuff you added are they packed into the zip-file you linked to above?

Yes, they are!

1 Like