Home

Awesome

Prerequisites

You need one or more Garden Smart system devices : https://www.gardena.com/int/products/smart/
A developper application to access gardena API : https://developer.husqvarnagroup.cloud/docs/get-started
This application needs to be connected to Authentication API AND GARDENA smart system API like this : Application
("Create application" button -> Fill In Name only -> "Create" button -> "+Connect new API" button -> Add both API)

This image uses the new Gardena API which allows to be informed immediately when an event occurs on any Smart System device.

How does it work

Diagram

How-to

Install

For Docker, run it by executing the following commmand:

docker run \
    -d \
    --name gardena2mqtt \
    --restart=always \
    -e GARDENA_USER="GardenaUserName" \
    -e GARDENA_PASSWORD="GardenaPassword" \
    -e GARDENA_APIKEY="GardenaApiKey" \
    -e HOST="192.168.1.x" \
    -e PORT=1883 \
    -e PREFIX="gardena2mqtt" \
    -e CLIENTID="gardena2mqttclid" \
    -e USER="usr" \
    -e PASSWORD="pass" \
    domochip/gardena2mqtt

For Docker-Compose, use the following yaml:

version: '3'
services:
  gardena2mqtt:
    container_name: gardena2mqtt
    image: domochip/gardena2mqtt
    environment:
    - GARDENA_USER=GardenaUserName
    - GARDENA_PASSWORD=GardenaPassword
    - GARDENA_APIKEY=GardenaApiKey
    - HOST=192.168.1.x
    - PORT=1883
    - PREFIX=gardena2mqtt
    - CLIENTID=gardena2mqttclid
    - USER=mqtt_username
    - PASSWORD=mqtt_password
    restart: always

Configure

Parameters explanation

Environment variables

Topics

gardena2mqtt status

Status of gardena2mqtt is published to the topic gardena2mqtt/connected using the following payload:

Devices state

Devices informations and state are published to individual topics following this scheme: gardena2mqtt/Location/Device

ex : gardena2mqtt/MyGarden/MySileno

Devices informations are published when:

Device control

You can control your Gardena devices by sending command (JSON format) to the control topic of each device: gardena2mqtt/Location/Device/control And receive command execution result on: gardena2mqtt/Location/Device/result

ex : gardena2mqtt/MyGarden/MySileno/control gardena2mqtt/MyGarden/MySileno/result

Mower

Power Socket

Smart Irrigation Control (Valve Set)

Water Control (Valve)

Troubleshoot

Logs

You need to have a look at logs using :
docker logs gardena2mqtt

Updating

To update to the latest Docker image:

docker stop gardena2mqtt
docker rm gardena2mqtt
docker rmi domochip/gardena2mqtt
# Now run the container again, Docker will automatically pull the latest image.

Ref/Thanks

Many thanks to py-smart-gardena which the library used to build this project : https://github.com/py-smart-gardena/py-smart-gardena