Zum Hauptinhalt springen

Husqvarna Automower Smart-Home-Integration, kostenlos und Open Source

Husqvarna Automower-Integration für Gladys Assistant

Unofficial connector: Automower robotic mowers, status, battery, start, park and errors.

Info

Die Dokumentation dieser Integration wird von ihrem Autor geschrieben und ist bisher nur auf Englisch verfügbar.

Unofficial connector, not affiliated with Husqvarna. It brings Husqvarna Automower® robotic mowers into Gladys through the official Automower Connect API, with an application you create yourself on the Husqvarna Developer Portal. Automower is a trademark of Husqvarna AB.

What you get​

SurfaceContent
One device per moweroperational state, battery, activity, mode, error code and error text, connection to the Husqvarna cloud, next start, a mow / pause select and a return to dock button
Scene triggerserror, activity changed, mowing finished, disconnected
Scene actionsstart mowing (for a duration), park (until the next schedule, until further notice or for a duration), pause, resume the schedule
Dashboard widgetRobotic mower: battery, next start, activity, state, mode, error, connection, and Start / Park / Pause / Resume buttons
Configuration screena Test Husqvarna button listing your mowers

Setup​

  1. Open the Husqvarna Developer Portal and sign in with your Automower Connect account (the one of the phone app, where your mowers are paired).
  2. Create an application: any name, and http://localhost:8080 as the redirect URL (it is not used).
  3. In the application, connect it to the Authentication API and to the Automower Connect API. Without the second one, Husqvarna refuses every request.
  4. Copy the application key and the application secret into the configuration of the integration in Gladys, and save.
  5. Open Discovery and add your mowers.
  6. Put the Robotic mower widget on a dashboard.

The key and the secret are stored encrypted by Gladys and only sent to Husqvarna. If Husqvarna refuses them, the integration stops trying until you save the configuration again: repeated failed logins lock the Husqvarna account for 30 minutes.

The device​

Gladys has no robotic mower category yet: the state and the two commands use the robot vacuum category, the only one describing a robot that runs, docks and charges. The device card therefore shows:

  • State: Running (mowing or leaving the station), Returning to dock, Charging, Docked, Paused, Error, Stopped;
  • Mowing (idle: pause): a select whose "Clean" choice starts mowing for the configured duration (3 hours by default) and "Idle" pauses the mower;
  • Park until the next schedule: the "Return to dock" button.

The other features are the battery (%), the activity and the mode (texts in the language chosen in the configuration), the error code (0: none) and its text, the connection to the Husqvarna cloud and the next start, in the mower's own time.

A start command does not make a mower leave its station at once: Husqvarna says it leaves once fully charged.

Scenes​

  • Automower error: once per error (trapped, lifted, outside the working area...). Variables: the code, the text in English and in French, the time, the mower state.
  • Automower activity changed: optionally for one activity (mowing, going home, charging, leaving, parked, stopped in the garden...). Variables: the new and the previous activity, the state, the battery.
  • Automower mowing finished: the mower ended a session (parked in its station, stopped in the garden or waiting for a manual start). Going home to charge in the middle of a session does not count. Variables: where it ended, the session length in minutes (empty when the session began before Gladys saw it), the battery, the error code.
  • Automower disconnected: the mower lost its connection to the Husqvarna cloud. Husqvarna only reports it in a full refresh: up to 30 minutes late by default.

The actions start mowing, park, pause and resume the schedule act on the chosen mower, or on every mower when the field is empty. They give mower_name and count to the following actions of the scene, which find them in their variable list (written {{<step>.<action>.<key>}}, for instance {{0.0.count}} when this action is the first of the scene).

How often Husqvarna is called​

Husqvarna allows 21,000 requests per week and application. The integration reads all the mowers once at start, then follows them through the live events of the Automower Connect websocket. It reads everything again every 30 minutes (option Full refresh interval), and every 10 minutes while the live link is down. A command is read back once, 30 seconds later. A typical week uses about 2 % of the allowance.

Troubleshooting​

  • "Husqvarna refused the application key or secret": copy them again from the portal (My applications), then save the configuration.
  • "The application is not connected to the Automower Connect API": connect it on the portal (step 3), then save the configuration again.
  • No live events while REST works: Husqvarna advises renewing the application secret on the portal.
  • The next start is one hour off: the mower sends its own local time; the integration reads it in the time zone of Gladys.
  • Logs: the integration's log level is set with the LOG_LEVEL variable.

Privacy​

The integration uses the state of your mowers only: the GPS positions Husqvarna sends along are dropped at once, never stored nor shown. The application key and secret go to Husqvarna only, and never appear in a log, a status or a scene.

Konfigurationseinstellungen​

Diese Einstellungen fragt Husqvarna Automower in seinem Konfigurationsbildschirm in Gladys ab.

EinstellungTypPflichtfeldBeschreibung
Husqvarna Automower in GladyssectionNeinUnofficial connector, not affiliated with Husqvarna. It reads your robotic mowers through the official Automower Connect API with your own Developer Portal application: one device per mower (state, battery, activity, mode, error, connection, next start, a mow / pause select and a return to dock button), live events over a websocket, scene triggers on errors, activity changes, the end of mowing and a lost connection, scene actions to start, park, pause and resume the schedule, and a dashboard widget. Automower is a trademark of Husqvarna AB.
Your Husqvarna applicationsectionNeinOn the Developer Portal, sign in with your Automower Connect account, create an application (any name, redirect URL http://localhost:8080), then connect it to the "Authentication API" and the "Automower Connect API". Copy its application key and application secret below. Your mowers must be paired in the Automower Connect app.
Application keysecretJaStored encrypted by Gladys and only sent to Husqvarna.
Application secretsecretJaStored encrypted by Gladys and only sent to the Husqvarna authentication service.
Mowing time of a start (minutes)numberNeinUsed by the mow / pause select of the device, the Start button of the widget and the start scene action without a duration. The mower overrides its schedule for that long, then goes back to it.
Full refresh interval (minutes)numberNeinThe live events carry the changes; the whole account is read again at this pace (the connection to Husqvarna is only seen this way). Husqvarna limits the API calls per week and application: 30 minutes uses a few percent of it.
Language of the texts (activity, mode, error)selectNein

So installierst du Husqvarna Automower in Gladys​

  1. Öffne in Gladys Integrationen: Husqvarna Automower erscheint im Katalog neben den nativen Integrationen, mit einem Community-Badge.
  2. Klicke auf Installieren. Gladys lädt das Docker-Image (ghcr.io/lm1lc3n7/gladys-automower:0.1.1) herunter, startet es in einer vom Kern isolierten Sandbox und erzeugt die Oberfläche der Integration (Geräte, Erkennung und Konfiguration).
  3. Öffne den Bildschirm Konfiguration der Integration, fülle die Einstellungen aus und speichere.
  4. Du kannst sie auch direkt über die URL ihres Repositorys installieren: https://github.com/LM1LC3N7/gladys-automower.

Husqvarna Automower benötigt Gladys >=5.1.0. Der Katalog in Gladys wird stündlich aktualisiert, eine neue Version ist also spätestens eine Stunde nach ihrer Veröffentlichung verfügbar.

Du nutzt Gladys noch nicht? Es ist kostenlos und Open Source: folge der Installationsanleitung, um loszulegen.

Über externe Integrationen​

Husqvarna Automower ist eine externe Integration: eine Community-Integration, die als Docker-Container verpackt und auf GitHub veröffentlicht wird. Gladys installiert sie mit einem Klick und führt sie in einer vom Kern isolierten Sandbox aus. Sie wird von LM1LC3N7 veröffentlicht und gepflegt, nicht vom Gladys-Kernteam.

Abonniere den Newsletter von Gladys Assistant

Ein paar E-Mails im Monat zu neuen Releases und Neuigkeiten aus dem Projekt. Verschickt von Pierre-Gilles Leymarie, dem Gründer des Projekts. Jederzeit abbestellbar 🙂