Gardena smart system + Home assistant?

@maralex: I know…time is often very tight but maybe my thread helps.

I opened a feature request for Gardena / Husqvarna integration. It is already integrated in OpenHab. I have the Java source code and a german description of what has to be respected.

This is the thread:

I’m working on a proper home assistant component for the gardena smart ecosystem.
My goal is to make it a default home-assistant component but time is limited so I like to share my progress with you.

Currently I have all the code in a custom_component (which later should become a pypi library), it currently only supports the lawn mower, and registers it as a vacum cleaner.

Project:
https://github.com/wijnandtop/home_assistant_gardena

Setup should be very easy and feedback is welcome :slight_smile:

2 Likes

Had some more time today to work on it, update is available in the git repo.

Added:

  • support for smart sensor
  • support for watering computer added in the underlying library, but not registered in HA yet

Details in the readme within the git repo.

Hi wijnandtop,

I’m running Hass.io 0.77.1 in a docker container on Ubuntu.

I copied the contents of your git repo to /config/custom_components, but when restarting home assistant I get an error message saying:

Fri Aug 31 2018 12:39:17 GMT+0200 (centraleuropeisk sommartid)

Error loading custom_components.gardena. Make sure all dependencies are installed
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/homeassistant/loader.py", line 94, in get_component
module = importlib.import_module(path)
  File "/usr/local/lib/python3.6/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 994, in _gcd_import
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/config/custom_components/gardena.py", line 16, in <module>
from custom_components.pygardena.account import *
  File "/config/custom_components/pygardena/account.py", line 2, in <module>
from custom_components.pygardena.location import *
  File "/config/custom_components/pygardena/location.py", line 2, in <module>
from custom_components.pygardena.mower import *
  File "/config/custom_components/pygardena/mower.py", line 1, in <module>
from custom_components.pygardena.device import *
  File "/config/custom_components/pygardena/device.py", line 2, in <module>
import objectpath
ModuleNotFoundError: No module named 'objectpath'

Are there any special dependencies and how do I install them?

Thanks!

Good one, I installed this dependency myself during development.

Just updated the code and added them to the requirements of the module, which should result in an auto install of this module (haven’t tested it yet, still want to check the custom_component with a clean install)

Just give the latest version a try! Let me know if it did work and with which device / mower you tried.

B.t.w. did quite some updates last few days, as a result: more reliable updates and support for the Watering computer.

1 Like

I spun up a new test VM, installed hass.io and your custom component, but I had to do pip3.6 install objectpath to get it to work.
I have a smart sileno+ 1600 and I’m able to control it via HA now. :smile:

Thanks!

Would be so good to have gardena smart irrigation control in HA, but i understand it is not supported yet?

Thanks a lot for the project! We just got a smart sileno and we still have do the actual physical install, but at least the smart gateway seems to have connected.

1 Like

Tested on my Sileno Smart City 500, and it seems to work fine :slight_smile: Really hoping youre planning to take this to an official component and continue development on it!

1 Like

Probably won’t work, I don’t own the irrigation device and therefore I cannot do the implementation.
If I own the device it will be an hour work or so :slight_smile:

But if someone owns the device and is able to add support for it, that would be great!

I am only getting Component not found: gardena, when trying out your component @wijnandtop

Did you copy all the files to this folder:

/config/custom_components

Files shouldn’t be in a subfolder!

Hi, I was wondering if the components can communicate directly to the Gardena devices, or does it communicate with the gateway?

It uses the Gardena online API which is not documented but is used by the gardena web interface (and probably the smartphone app).

The gateway connects to the gardena online service as wel. Note that status updates aren’t realtime but the plugin does poll for changes.

Hi, works with this:

?

Yes, after configuring your credentials it should be automatically detected as a switch.

Build the plugin quite a while ago and since it is wintertime over here I haven’t used it for a couple of months, but is should work :slight_smile:

Hi, after Update to 0.88.1 gardena doesn´t work anymore. In Version 0.87.1 it works. Can anyone help me?

hi, is that your problem? you have to rename your files and folder:

rename / move…
binary_sensor/gardena.py to gardena/binary_sensor.py
sensor/gardena.py to gardena/sensor.py
switch/gardena.py to gardena/switch.py
vacuum/gardena.py to gardena/vacuum.py
gardena.py to gardena/init.py

@wijnandtop

is gardena already working after firmware update with HomeKit integration?
in my case its not :confused:
could you check that please?

Error during setup of component gardena
Traceback (most recent call last):
File "/usr/local/lib/python3.5/site-packages/homeassistant/setup.py", line 154, in _async_setup_component
component.setup, hass, processed_config) # type: ignore
File "/usr/local/lib/python3.5/asyncio/futures.py", line 381, in iter
yield self # This tells Task to wait for completion.
File "/usr/local/lib/python3.5/asyncio/tasks.py", line 310, in _wakeup
future.result()
File "/usr/local/lib/python3.5/asyncio/futures.py", line 294, in result
raise self._exception
File "/usr/local/lib/python3.5/concurrent/futures/thread.py", line 55, in run
result = self.fn(*self.args, **self.kwargs)
File "/home/hass/.homeassistant/custom_components/gardena/init.py", line 39, in setup
hass.data[GARDENA_LOGIN] = GardenaHub(hass, config[DOMAIN], GardenaSmartAccount)
File "/home/hass/.homeassistant/custom_components/gardena/init.py", line 59, in init
self.my_gardena = gardena(domain_config[CONF_USERNAME], domain_config[CONF_PASSWORD])
File "/home/hass/.homeassistant/deps/lib/python3.5/site-packages/wt/pygardena/account.py", line 14, in init
self.update_authtokens()
File "/home/hass/.homeassistant/deps/lib/python3.5/site-packages/wt/pygardena/account.py", line 42, in update_authtokens
self.AuthToken = response_data['sessions']['token']
KeyError: 'sessions'

Haven’t tried it yet. My gardena equipment is currently boxed since I will move to a different location soon (so my mower has more lawn to mow).