Home

Awesome

GitHub Release Home Assistant Publish Docker image Publish Docker Dev image

Prerequisites

You need one or more Gardena Smart system devices : https://www.gardena.com/int/products/smart-system/smart-system
Follow the official documentation to have API accesses for Authentication and GARDENA : https://developer.husqvarnagroup.cloud/docs/get-started
This application needs to be connected to Authentication API AND GARDENA smart system API like this : Application

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_CLIENT_ID="GardenaApplicationKey" \
    -e GARDENA_CLIENT_SECRET="GardenaApplicationSecret" \
    -e MQTT_HOST="192.168.1.x" \
    -e MQTT_PORT=1883 \
    -e MQTT_PREFIX="gardena2mqtt" \
    -e MQTT_CLIENTID="gardena2mqttclid" \
    -e MQTT_USER="usr" \
    -e MQTT_PASSWORD="pass" \
    -e HOMEASSISTANT="1" \
    -e HOMEASSISTANT_DISCOVERY="homeassistant" \
    domochip/gardena2mqtt

For Docker-Compose, use the following yaml:

version: '3'
services:
  gardena2mqtt:
    container_name: gardena2mqtt
    image: domochip/gardena2mqtt
    environment:
    - GARDENA_CLIENT_ID=GardenaApplicationKey
    - GARDENA_CLIENT_SECRET=GardenaApplicationSecret
    - MQTT_HOST=192.168.1.x
    - MQTT_PORT=1883
    - MQTT_PREFIX=gardena2mqtt
    - MQTT_CLIENTID=gardena2mqttclid
    - MQTT_USER=mqtt_username
    - MQTT_PASSWORD=mqtt_password
    - HOMEASSISTANT=1
    - HOMEASSISTANT_DISCOVERY_TOPIC=homeassistant
    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/Device

ex : gardena2mqtt/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/Device/control And receive command execution result on: gardena2mqtt/Device/result

ex : gardena2mqtt/MySileno/control
gardena2mqtt/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