Saltar al contenido principal

Integración domótica Husqvarna Automower, gratuita y de código abierto

Integración Husqvarna Automower para Gladys Assistant

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

info

La documentación de esta integración la escribe su autor y, por ahora, solo está disponible en inglés.

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.

Parámetros de configuración​

Estos son los parámetros que Husqvarna Automower te pide en su pantalla de configuración en Gladys.

ParámetroTipoObligatorioDescripción
Husqvarna Automower in GladyssectionNoUnofficial 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 applicationsectionNoOn 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 keysecretSíStored encrypted by Gladys and only sent to Husqvarna.
Application secretsecretSíStored encrypted by Gladys and only sent to the Husqvarna authentication service.
Mowing time of a start (minutes)numberNoUsed 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)numberNoThe 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)selectNo

Cómo instalar Husqvarna Automower en Gladys​

  1. En Gladys, abre Integraciones: Husqvarna Automower aparece en el catálogo junto a las integraciones nativas, con una insignia de comunidad.
  2. Haz clic en Instalar. Gladys descarga la imagen Docker (ghcr.io/lm1lc3n7/gladys-automower:0.1.1), la ejecuta en un entorno aislado del núcleo y genera la interfaz de la integración (dispositivos, descubrimiento y configuración).
  3. Abre la pantalla de Configuración de la integración, rellena los parámetros y guarda.
  4. También puedes instalarla directamente desde la URL de su repositorio: https://github.com/LM1LC3N7/gladys-automower.

Husqvarna Automower requiere Gladys >=5.1.0. El catálogo de Gladys se actualiza cada hora, así que una nueva versión está disponible como máximo una hora después de publicarse.

¿Todavía no usas Gladys? Es gratuito y de código abierto: sigue la guía de instalación para empezar.

Sobre las integraciones externas​

Husqvarna Automower es una integración externa: una integración comunitaria empaquetada como contenedor Docker y publicada en GitHub. Gladys la instala con un clic y la ejecuta en un entorno aislado del núcleo. La publica y mantiene LM1LC3N7, no el equipo principal de Gladys.

Suscríbete a la newsletter de Gladys Assistant

Unos pocos correos al mes sobre nuevas versiones y novedades del proyecto. Enviados por Pierre-Gilles Leymarie, fundador del proyecto. Puedes darte de baja cuando quieras 🙂