Gardena smart system + Home assistant?

Ive done most of the steps, but this whole clone from Git and running the install has me confused. Do you have a quick 1/2/3 steps on how to do that part?

Im getting this error from Home Assistant after updating configuration.yaml, sensors.yaml, groups.yaml and binary_sensors.yaml. The Gardena_Smart.py file is under /config/custom_components/sensor:

Error loading custom_components.sensor.gardena_smart. Make sure all dependencies are installed
Traceback (most recent call last):
File “/usr/src/app/homeassistant/loader.py”, line 86, 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 “”, line 994, in _gcd_import
File “”, line 971, in _find_and_load
File “”, line 955, in _find_and_load_unlocked
File “”, line 665, in _load_unlocked
File “”, line 678, in exec_module
File “”, line 219, in _call_with_frames_removed
File “/config/custom_components/sensor/gardena_smart.py”, line 13, in
from deps.gardena_smart import *
ModuleNotFoundError: No module named ‘deps.gardena_smart’

I was able to get it installed by copying the files from the Ubuntu host to the Docker.
But what happens next time Home Assistant gets upgraded? Do I need to do this each time?

I still cant get this to work sadly. I get an error on my binary_sensors.yaml. There also seems to be an error with the sensors.yaml example. Its not supposed to start with “r platform” I assume?

Really wanna get this integrated, but Im feeling half lost :smile:

Progress! Under States I can see data from the Gardena Smart Sileno City 500 I have. So its clearly a problem with presenting the data to HA:
sensor.pikachu “ok_cutting” name: Pikachu
dev_state: ok
last_online: 2018-05-15T13:14:40.032000+02:00
battery_level: 53
charging_satus: false
radio_quality: 70
radio_status: good
radio_connection_status: status_device_alive
in_manual_mode: false
status: ok_cutting
error: no_message
error_time: 1970-01-01T01:00:00+01:00
last_error_msg: no_message
next_source_for_start: no_source
next_start: 1969-12-31T23:00:00+01:00
cutting_time: 17
charge_cycles: 15
collisions: 590
running_time: 17
unit_of_measurement:
friendly_name: Pikachu

Can you doublecheck the Sensors/Binary_Sensors.yaml to see if theres anything that could be related to this?
Thanks for an awesome job so far :slight_smile:

I have updated sensors.yaml, correcting the “r”

I have modified the script to use pypi, so that it automatically pulls the update. You may need to delete it from deps folder first.

wrt your sensor and binary_sensor it is hard to say without seeing the error message. It seems that you are getting all the parameters so it is a home assistant configuration that is incorrect.

I think Ive found the error. I let my kids give the robot a new name. They wanted to call it Pikachu, so I changed it in the Gardena app. Maybe thats why the sensors/binary_sensors doesnt seem to catch it?

Yep! I renamed it back to Sileno in the Gardena app, and now the entire Sileno Group works flawlessly. I still get an error on the binary_sensors.yaml file tho…

This is the entire file:

  • platform: template
    sensors:
    sileno_charging:
    friendly_name: “Sileno charging”
    device_class: plug
    value_template: “{{ states.sensor.sileno.attributes.charging_status }}”
    sileno_manual_mode:
    friendly_name: “Sileno in manual mode”
    value_template: “{{ states.sensor.sileno.attributes.in_manual_mode }}”

and then I added this to my configuration.yaml:
binary_sensors: !include binary_sensors.yaml

EDIT: Thanks to assistance from Ludeeus on Discord, I had an error in the configuration.yaml file.
Its supposed to be binary_sensor, not binary_sensors:

Now its integrated! Thank you so much and hope you continue development of this module :slight_smile:

Hey, after updating to 0.72 it seems this has stopped working. Got any idea what can have caused this?

2018-06-25 23:00:25 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up platform gardena_smart,
Traceback (most recent call last):,
File “/usr/src/app/homeassistant/helpers/entity_platform.py”, line 129, in _async_setup_platform,
SLOW_SETUP_MAX_WAIT, loop=hass.loop),
File “/usr/local/lib/python3.6/asyncio/tasks.py”, line 358, in wait_for,
return fut.result(),
File “/usr/local/lib/python3.6/concurrent/futures/thread.py”, line 56, in run,
File “/config/custom_components/sensor/gardena_smart.py”, line 39, in setup_platform,
add_devices([gardena_smart(username, password, location_id, device_id)]),
File “/config/custom_components/sensor/gardena_smart.py”, line 59, in init,
self.update(),
File “/usr/src/app/homeassistant/util/init.py”, line 319, in wrapper,
result = method(*args, **kwargs),
File “/config/custom_components/sensor/gardena_smart.py”, line 91, in update,
mower_info = self.gardena.get_mower_info(self.gardena.get_devices_in_catagory(‘mower’)[0]),
mower_info[‘error’] = self.get_mower_error(id)[0],
File “/config/deps/gardena_smart/init.py”, line 107, in get_mower_info,
File “/config/deps/gardena_smart/init.py”, line 80, in get_mower_error,
IndexError: list index out of range,
return (error[2][‘value’], error[7][‘value’]),
2018-06-25 23:00:26 ERROR (SyncWorker_0) [homeassistant.components.coinbase] Authentication error connecting to coinbase: APIError(id=authentication_error): request timestamp expired,
2018-06-25 23:00:28 ERROR (MainThread) [homeassistant.setup] Error during setup of component arlo,
2018-06-25 23:00:26 ERROR (MainThread) [homeassistant.setup] Setup failed for coinbase: Component failed to initialize.,
File “/usr/src/app/homeassistant/setup.py”, line 146, in _async_setup_component,
component.setup, hass, processed_config) # type: ignore,
File “/usr/src/app/homeassistant/components/arlo.py”, line 48, in setup,
result = self.fn(*self.args, **self.kwargs),
conf = config[DOMAIN]

Hi MortenB,

actually, it it’s not 0.72 causing the problem but the “numbering/order” of the JSON response abilities from gardena seems to have changed since you first used rcastbergs gardena integration.

Therefore, a slightly adapted code fragment for __init__py:

def get_mower_name(self, id):
    return self.device_info[id]['name']
def get_mower_device_state(self, id):
    return self.device_info[id]['device_state']
def get_mower_last_online(self, id):
    return self.device_info[id]['abilities'][0]['properties'][5]['value']
def get_mower_battery_level(self, id):
    return self.device_info[id]['abilities'][1]['properties'][0]['value']
def get_mower_charging_status(self, id):
    return self.device_info[id]['abilities'][1]['properties'][1]['value']
def get_mower_radio_quality(self, id):
    return self.device_info[id]['abilities'][2]['properties'][0]['value']
def get_mower_radio_status(self, id):
    return self.device_info[id]['abilities'][2]['properties'][2]['value']
def get_mower_radio_connection_status(self, id):
    return self.device_info[id]['abilities'][2]['properties'][1]['value']
def get_mower_manual_mode(self, id):
    return self.device_info[id]['abilities'][4]['properties'][0]['value']
def get_mower_status(self, id):
    return self.device_info[id]['abilities'][4]['properties'][1]['value']
def get_mower_error(self, id):
    """Return error and last ts"""
    error = self.device_info[id]['abilities'][4]['properties']
    return (error[2]['value'], error[7]['timestamp'])
def get_mower_last_error(self, id):
    return self.device_info[id]['abilities'][4]['properties'][3]['value']
def get_mower_next_source_start(self, id):
    return self.device_info[id]['abilities'][4]['properties'][4]['value']
def get_mower_next_start(self, id):
    return self.device_info[id]['abilities'][4]['properties'][5]['timestamp']
def get_mower_cutting_time(self, id):
    return self.device_info[id]['abilities'][5]['properties'][0]['value']
def get_mower_charging_cycles(self, id):
    return self.device_info[id]['abilities'][5]['properties'][1]['value']
def get_mower_collisions(self, id):
    return self.device_info[id]['abilities'][5]['properties'][2]['value']
def get_mower_running_time(self, id):
    return self.device_info[id]['abilities'][5]['properties'][3]['value']

@rcastberg: thank you for your integration so far!

Cheers,
Markus

Thanks! That fixed my issue :slight_smile: Any plans to expand this integration?

Yes, but my time is veeeery limited, I just moved with my family :slight_smile:

@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!