Husqvarna AutoMower Integration

This application and driver provides Integration for Husqvarna AutoMower.

it allows you to monitor and control basic mower operations via the Husqvarna API.

It is available now in HPM

or

It consists of an application and a device hander (App will create the child devices once configured).

After you install you have to get an API key and secret from Husqvarna to securely connect to their API:

Instructions:

DO NOT SHARE THIS KEY OR SECRET WITH OTHERS

  • Add app on HE
    - HE console -> Apps -> "+ Add User App" and select Husqvarna Connect

  • App during configuration will have you enter the API key/secret, and have you go thru the OAUTH process to connect securely to the Husqvarna API. The app will handle Oauth refreshes automatically.


  • Note: currently Husqvarna API allows a total of 10K requests a month per application (and they only let you create 1 per account). This app must poll so this must be taken into your decisions on polling rate.

    • This works out to shortest poll is every 5 minutes, with little remaining headroom so likely 10 - 15 minute polls are better

    • I don't know this, but I expect the mobile apps for these products from Husqvarna also share the total API limits, so longer poll times are likely your friend.

  • This API for Husqvarna is also used for their Gardena line of products (and they all share the above limit). I don't have these other products so I have not added drivers for them.

In addition to custom attributes based on the REST API from Husqvarna, the mower device also exposes battery, motion sensors, and power source.

  • battery shows charge %
  • motion is active while moving/mowing, and inactive when stopped, or parked.
  • powersource is battery or mains (when charging)

Custom attributes:

  • mowerStatus -> MAIN_AREA, SECONDARY_AREA, HOME, DEMO, UNKNOWN

  • mowerActivity -> UNKNOWN, NOT_APPLICABLE, MOWING, GOING_HOME, CHARGING, LEAVING, PARKED_IN_CS, STOPPED_IN_GARDEN

  • mowerState -> UNKNOWN, NOT_APPLICABLE, PAUSED, IN_OPERATION, WAIT_UPDATING, WAIT_POWER_UP, RESTRICTED, OFF, STOPPED, ERROR, FATAL_ERROR, ERROR_AT_POWER_UP

  • mowerConnected -> TRUE or FALSE

  • mowerTimeStamp -> LAST TIME connected (EPOCH LONG)

  • errorCode -> current error code (long list with meanings in API site)

  • errorTimeStamp -> (EPOCH LONG)

  • plannerNextStart -> (EPOCH LONG)

  • plannerOverride -> Override Action

  • name

  • model

  • serialNumber

Commands supported:

  • start(mins) - start mowing for x minutes
  • pause - pause operation
  • park(mins) - park for x minutes
  • parkuntilnext - park until next schedule start
  • parkindefinite - park until someone takes you out of park
  • resumeSchedule - resume operations based on schedule settings

At some point I will add some apps. Initial thoughts:

  • park the mower for rain event and time after (your lawn floods)
  • don't let the mower operate if it is cold (or hot)
  • don't have the mower show off during a party (or if something is turned on like the sprinklers)
  • alert me if the mower is angry or otherwise bothered
6 Likes

Reserved for future use

Great you’ve released this. I’m still deciding on which mower to buy.
Is there any access to real-time GPS position via the Husqvarna API whilst mowing ?

It does in the API include coordinates (which I did not expose in attributes)

Their mobile app shows a map view that has both where the mower is now, and if is running where it has recently been.

If the mower is removed from a circle around the property area, it gets very angry...

The API also exposes some of the schedule data, which I did not expose in attributes.

1 Like

Now if they only made these in 52" cut. :scissors: With my almost 4 acres, these AutoMowers are so appealing but would be out of their league.

Cool integration though! I was wondering when somebody would do this. Not surprised you did it first, good job!

I'm in the same boat, a little over 3. When we get rain like we have had the last few weeks and I can't get out to mow like I need to, even my Exmark has a time cutting it.

1 Like

After clicking Authorize I just get a blank page and it still says that I need to authorize in apps.
I get this from the log,

error AutoMower App (v00.00.01) | groovyx.net.http.HttpResponseException: status code: 400, reason phrase: Bad Request on line 590
error AutoMower App (v00.00.01) | auth callback() Exception: groovyx.net.http.HttpResponseException: status code: 400, reason phrase: Bad Request

What am I doing wrong? I have Tripp,e checked my key and secret…

Did you install with HPM?

If so please do a HPM repair and retry.

That did things happened. :slight_smile: Now I got a lot ore options and authorize went fine. Thanks!

Hi @nh.schottfam , I have managed to get the device to connect. I can see status of it etc. However I can't start it from hubitat. I do get this errors (see log below , I cleaned the mower-id so the log looks ok for that). I insalled it with HPM and have tried to repair with that as well.

Also a request ( if I managed to controll it I will try fix this my self though):
add capability Switch or similar so we can controll it from tile master.

Logs

app:3612021-07-27 21:59:31.598 info AutoMower App (v00.00.01) | refreshAuthToken(sendCmdToHusqvarna, null) | Token is valid | exiting, token expires in 67884.786 seconds

app:3612021-07-27 21:59:31.592 errorAutoMower App (v00.00.01) | groovyx.net.http.HttpResponseException: status code: 500, reason phrase: Internal Server Error on line 907

app:3612021-07-27 21:59:31.584 errorAutoMower App (v00.00.01) | sendCmdToHusqvarna(mower: xxxxxxxx, data: [data:[type:Start, attributes:[duration:null]]], isRetry: false) | ___exception Exception: groovyx.net.http.HttpResponseException: status code: 500, reason phrase: Internal Server Error

start requires you to provide the duration for the run.

If you want to just resume your schedule, use resumeSchedule.

Download the Hubitat app