Gardena smart system + Home assistant?

Hi Tobias,

I have a mower, irrigation control and a sensor. All three work great so you can check them as tested! Many its a idea to add this add-on to HASC?

Hi Tobias, i did setup everything according to the readme file

Unfortunately I get response notification after reboot:
Invalid config
The following integrations and platforms could not be set up:
Gardena
Please check your config.

I installed the plugin,
stored the credentials inside secret file,
generated the api key and stored in configurations

Can you please assist?

Logfile:

2020-05-04 15:53:58 WARNING (MainThread) [homeassistant.util.async_] Detected I/O inside the event loop. This is causing stability issues. Please report issue to the custom component author for gardena doing I/O at custom_components/gardena/init.py, line 109: self.smart_system.update_devices(self.smart_system.locations[location_id])
2020-05-04 15:53:58 ERROR (MainThread) [homeassistant.setup] Error during setup of component gardena
Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/setup.py”, line 171, in _async_setup_component
hass, processed_config
File “/config/custom_components/gardena/init.py”, line 63, in async_setup
hass, config[DOMAIN], SmartSystem
File “/config/custom_components/gardena/init.py”, line 109, in init
self.smart_system.update_devices(self.smart_system.locations[location_id])
File “/usr/local/lib/python3.7/site-packages/gardena/smart_system.py”, line 170, in update_devices
if len(response_data[“data”][“relationships”][“devices”][“data”]) < 1:
KeyError: ‘relationships’

Thank you

It’s really a shame that it didn’t make it into HA. Thanks for updating/fixing it!
I got it up and running and it seems to work fine with the water control and sensor. :grin:

Hi, in HA log there is following Info/Error:
Detected I/O inside the event loop:

  • Detected I/O inside the event loop. This is causing stability issues. Please report issue to the custom component author for gardena doing I/O at custom_components/gardena/init.py, line 97: self.smart_system.authenticate()
  • Detected I/O inside the event loop. This is causing stability issues. Please report issue to the custom component author for gardena doing I/O at custom_components/gardena/init.py, line 100: self.smart_system.update_locations()
  • Detected I/O inside the event loop. This is causing stability issues. Please report issue to the custom component author for gardena doing I/O at custom_components/gardena/init.py, line 109: self.smart_system.update_devices(self.smart_system.locations[location_id])
  • Detected I/O inside the event loop. This is causing stability issues. Please report issue to the custom component author for gardena doing I/O at custom_components/gardena/init.py, line 111: self.smart_system.start_ws(self._hass.data[GARDENA_LOCATION])

Do you plan to bring this to HACS?

Thanks a lot, it works nice in my setup with irrigation control, smart sensor and sileno city.

Same here . This fork doesn’t work

Hey Michiel,

Short question (since i have only the mower currently) can you confirm that the Gardena Smart Sensor is able to report data towards HomeAssistant using the fork of @tobiask?

I am about to setup my irrigation using a Sonoff 4-ch pro (since i refuse to pay 200 EUR for an Gardena Smart Irrigate control) and would like to base the ‘do i need to water the lawn’ on the data coming from the soil moisture sensor, temperature, forecast etc.

And since i already have a Smart Sileno City mower, that needs to be docked as well before i start watering the lawn off course :wink:

An alternative would be that i buy the VH400 Vegetronix sensor and wip something together using Arduino and MQTT but that would be almost as expensive as the Gardena sensor which already has a nice box around it.

Hi,

Currently its not working. When the fork is fixed. it should work. I get all the data of the sensor.

Thanks a lot it works fine!
With my Gardena irrigation control and sileno

My sensor, irrigation control and sensor are also working again :nerd_face:

Update: Use https://github.com/py-smart-gardena/hass-gardena-smart-system

I have also created a fork of @grm’s work and created an integration of it:


Should be possible to install via HACS if you add that URL as a custom repository.

The “Detected I/O inside the event loop” problem is fixed in my version.

I’ve also added config flow setup, i.e. you set up the integration from the GUI. This also allowed me to add “devices” (in Home Assistant terms) that the entities (switches, sensors, vacuum/mower) are connected to, and also add battery level sensors.

I own the Gardena Smart Water Control and the Smart Sensor, so those devices I’ve been able to test myself.

I can confirm it is working for me with my Sileno mower, thanks for your work! :slightly_smiling_face:

However I’m missing some of the sensors from old integration like:
error
last_error_code
timestamp_next_start
source_for_next_start
manual_operation
cutting_time
collisions
charging_cycles

Is it possible to retrieve that data aswell?

1 Like

Thanks for this Integration. A valve of the irrigation control, could be activated via switch. And the valve could be closed if you activate the switch an deactivate it within 3 sec. Afterwards the switch go to off and don’t represent the status of the valve.

Thanks for the integration. I own a smart irrigation control and a pressure pump. The irrigation control is working as expected but I have some problems with the pump. It is detected and listed in HA but when I try to switch it on I get a 502 Error.

Can someone assist in debugging this?

I‘ve too switch over to -> https://github.com/py-smart-gardena/hass-gardena-smart-system

Thanks for your work @wijnandtop @kayloehmann and all other, but i think the Integration of @osks is now closer to the target to become an official HA integration status with use of the official Gardena/Husquarna API

Hey All,

I integrated my gardena smart system and got the connection working. I can see my sileno lawn mower. However when I try to start it, I get an error 502 (Error communicating with the backend). My error log looks as follows:

Logger: homeassistant.components.websocket_api.http.connection.1673027632
Source: custom_components/gardena_smart_system/vacuum.py:174
Integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 12:08:26 (1 occurrences)
Last logged: 12:08:26

502 : error communicating with the backend
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/websocket_api/commands.py", line 130, in handle_call_service
    connection.context(msg),
  File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/core.py", line 1260, in async_call
    task.result()
  File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/core.py", line 1295, in _execute_service
    await handler.func(service_call)
  File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/helpers/entity_component.py", line 209, in handle_service
    self._platforms.values(), func, call, required_features
  File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/helpers/service.py", line 454, in entity_service_call
    future.result()  # pop exception if have
  File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/helpers/entity.py", line 595, in async_request_call
    await coro
  File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/helpers/service.py", line 485, in _handle_entity_call
    await result
  File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/vacuum/__init__.py", line 361, in async_start
    await self.hass.async_add_executor_job(self.start)
  File "/usr/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/home/homeassistant/.homeassistant/custom_components/gardena_smart_system/vacuum.py", line 174, in start
    self._device.start_seconds_to_override(duration)
  File "/srv/homeassistant/lib/python3.7/site-packages/gardena/devices/mower.py", line 34, in start_seconds_to_override
    self.smart_system.call_smart_system_service(self.id, data)
  File "/srv/homeassistant/lib/python3.7/site-packages/gardena/smart_system.py", line 155, in call_smart_system_service
    raise Exception(f"{r.status_code} : {response['errors'][0]['title']}")
Exception: 502 : error communicating with the backend

When I go to options of the integration, I can see that the override timer is set for 60 minutes.
Does anyone have an idea what is going on?
Regards

Thomas

After some troubleshooting with the help husqvarna, I found the issue.

The wrong service ID was provided.
The ID 78bd80de-xxxxx-365 was sent via the function ‘call_smart_system_service’ in the file smart_system.py.
However it should have been: 78bd80de-xxxxx-365:cbtg

I tried to find a proper way to correct this in the definition of the mower, but could not find it. Maybe @osks can help with solving this issue properly.

What integration are you using (how did you install it?) and which version of it? I’m not sure, but it kind of looks like something that was fixed recently in py-smart-gardena.

Hi,

I used this one: https://github.com/py-smart-gardena/hass-gardena-smart-system

I download the latest version on monday and installed it moanually (not through hacs)

Is there a way to check with you and see where in the code this issue is and that it is solver or not in the current release on the site?

Regards,

Thomas

@osks I uninstalled my version and installed the latest version with HACS and then I received a newer version of the gardena library 0.8.7. I was using the version 0.8.6.
With this version, the serviceID of the mower is complete. So it is working properly.

What I’m looking at is, how I can translate the status codes ‘ok_cutting’, ‘OK_LEAVING’ , … to my own text. I can do this with a translation JS. but I have no idea yet how to structure or place it correctly.

Hey!

First of all, thanks a lot to the creators of this integration. Much appreciated.
I have been testing it for a couple of weeks with my Gardena Smart Mower and it’s been working great.
However I do notice it disconnects from the API approximately every hour.
So I was just wondering if this is normal behavior, or if there is something I can do to prevent it.
Not a big issue, I just like to get rid of all error messages possible.
Thanks :slight_smile:

From Core log:

2020-07-20 14:12:39 INFO (Thread-5) [gardena.smart_system] Connection close to gardena API
2020-07-20 14:12:39 INFO (Thread-5) [gardena.smart_system] Restarting websocket
2020-07-20 14:12:41 INFO (Thread-7) [gardena.smart_system] Connected to Gardena API

2020-07-20 15:13:26 INFO (Thread-7) [gardena.smart_system] Connection close to gardena API
2020-07-20 15:13:26 INFO (Thread-7) [gardena.smart_system] Restarting websocket
2020-07-20 15:13:27 INFO (Thread-9) [gardena.smart_system] Connected to Gardena API

2020-07-20 16:14:02 INFO (Thread-9) [gardena.smart_system] Connection close to gardena API
2020-07-20 16:14:02 INFO (Thread-9) [gardena.smart_system] Restarting websocket
2020-07-20 16:14:04 INFO (Thread-11) [gardena.smart_system] Connected to Gardena API

From logbook:

gardena

1 Like