Husqvarna Automower monitoring

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

So, my mower is chugging along and the zones are working fine. Let me know if I can share anything or test anything.
Also, let me know if you ever feel inclined to add more statuses to the history time line like, where it is, charging and so on.

I’m still waiting to include it in some automations, i’ll share those I make.

Hi @jansh,

thanks a ton for making this happen! My Automower is currently waiting for spring, but I’m eager to see him showing up in Home Assistant. I already installed the custom component from your zip file and everything is up and running so far.

Two questions from a newbie:

  1. How do I get the latest version of your component? Is the ZIP file dynamically created based on the GIT content? Probably yes and I need to dig into GIT in the near future, I guess…

  2. I’ve got an Automower 420. I didn’t see this model in your code, but I also didn’t see a model character in Home Assistant which I could report to you…

Again, thanks a lot for your great work!

Thanks for all the work. Working great.

Online history shows the On/Off status and device tracker shows location. It would be cool status of mowing vs charging is being recorded in history. Is this possible?

Current info in Vacuum entity:

Now you see history is the On/Off , i would like to show the Status in a history graph to see how much charging and cutting there is.

EDIT: Seems after updating to the latest automower.py from the github this is solved!

Hi,

two more information pieces which could be added:

Model E = Automower 420

STATUS_DISABLED = ‘OFF_HATCH_CLOSED_DISABLED’

STATUS_DISABLED: { ‘icon’: ‘mdi:pause’, ‘message’: ‘Disabled’ },

Would be great if this component could be added to the official repository soon to ease the update process…

Thx and all the best!