Giter Club home page Giter Club logo

hass-gardena-smart-system's Introduction

hacs_badge hass-gardena-smart-system

Home Assistant integration for Gardena Smart System

Custom component to support Gardena Smart System devices.

Table of Contents

⚠️ Starting from version 1.0.0b5: You might probably have to uninstall and reinstall the integration as credentials requirements and method has changed. THERE IS A BREAKING CHANGE IN THE CONFIGURATION DUE TO AN UPDATE ON THE GARDENA API

About

This component is originally based on https://github.com/grm/home-assistant/tree/feature/smart_gardena and https://github.com/grm/py-smart-gardena

The integration / component has been changed quite a lot, mainly to add support for config flow setup and Home Assistant devices. It has also been cleaned up and some bugs have been fixed. Gardena devices are now represented as Home Assistant devices, which have battery level sensors where applicable.

This project needs your support.
Gardena equipments are expensive, and I need to buy them in order to add support. If you find this library useful and want to help me support more devices (or if you just want to reward me for my spent time), you are very welcome !
Your help is very much appreciated.

Here are the links if you want to show your support :
PayPal donate button

Installation

Requires Home Assistant 0.115.0 or newer.

Installation through HACS

If you have not yet installed HACS, go get it at https://hacs.xyz/ and walk through the installation and configuration.

Then find the Gardena Smart System integration in HACS and install it.

Restart Home Assistant!

Install the new integration through Configuration -> Integrations in HA (see below).

Manual installation

Copy the sub-path /hass-gardena-smart-system/custom_components/gardena_smart_system of this repo into the path /config/custom_components/gardena_smart_system of your HA installation.

Alternatively use the following commands within an SSH shell into your HA system.
Do NOT try to execute these commands directly your PC on a mounted HA file system. The resulting symlink would be broken for the HA file system.

cd /config
git clone https://github.com/py-smart-gardena/hass-gardena-smart-system.git

# if folder custom_components does not yet exist:
mkdir custom_components

cd custom_components
ln -s ../hass-gardena-smart-system/custom_components/gardena_smart_system

Configuration

Home Assistant

Setup under Integrations in Home Assistant, search for "Gardena Smart System". You need to enter your application key / client ID and your applications secret / client secret. See below for how to get your Gardena application key and secret.

After setting up the integration, you can adjust some options on the integration panel for it.

Even though this integration can be installed and configured via the Home Assistant GUI (uses config flow), you might have to restart Home Assistant to get it working.

Gardena Application Key / Client ID and Application secret / client secret

In order to use this integration you must get a client ID / Application Key from Gardena/Husqvarna.

  1. Go to https://developer.husqvarnagroup.cloud/

  2. Create an account if needed, otherwise sign in with your Gardena account.

  3. After signing in you will be automatically redirected to "Your applications". (Otherwise go to: https://developer.husqvarnagroup.cloud/applications)

  4. Create an new application, name it for example "My Home Assistant" (doesn't matter), leave the other fields empty.

  5. Click on "+Connect new API" and connect the Authentication API and the GARDENA smart system API.

  6. Copy your Application Key and Application secret, this is what you need when you add the integration in Home Assistant.

Supported devices

The following devices are supported :

  • Gardena Smart Irrigation Control (as switch)
  • Gardena Smart Mower (as vacuum)
  • Gardena Smart Sensor (as sensor)
  • Gardena Smart Water Control (as switch)
  • Gardena Smart Power Socket (as switch)

Services

Smart Irrigation Control services

[TODO: document services]

Smart Mower services

vacuum.start
Start the mower using the Gardena API command START_SECONDS_TO_OVERRIDE.
The mower switches to manual operation for a defined duration of time. The duration is taken from the integration option "Mower Duration (minutes)" (see Configuration -> Integrations in HA).

vacuum.stop
Stop the mower using the Gardena API command PARK_UNTIL_FURTHER_NOTICE.
The mower cancels the current operation, returns to charging station and ignores schedule.

vacuum.return_to_base
Stop the mower using Gardena API command PARK_UNTIL_NEXT_TASK.
The mower cancels the current operation and returns to charging station. It will reactivate with the next schedule.

Smart System general

binary_sensor.gardena_smart_system_connection Checks if service is connected or disconnected

Smart Power Socket services

[TODO: document services]

Smart Sensor services

sensor.sensor_light_intensity Read the light intensity of a smart sensor. Only V1 of the Smart Sensor supports this.

sensor.sensor_soil_humidity Read the soil humidity of a smart sensor. This can help automate your Water control / Irrigation Controller.

sensor.sensor_soil_temperature Read the soil tempature.

sensor.sensor_ambient_temperature Read the ambient tempature of a smart sensor.

sensor.sensor_battery_level Read the battery level of a smart sensor.

Smart Water Control services

[TODO: document services]

Smart Irigation Control services

switch.irrigation_control_valve_X Open or close a valve to start watering . Irrigation control can have up to 6 valves and inherits the original name of each valve from the Gardena app. If a valve is not connected, the service for the specific valve is unavailable.

Recipes

Some recips were made by the community. You can find them here.

Development

Debugging

To enable debug logging for this integration and related libraries you can control this in your Home Assistant configuration.yaml file. Example:

logger:
  default: info
  logs:
    custom_components.gardena_smart_system: debug
    custom_components.gardena_smart_system.mower : debug
    custom_components.gardena_smart_system.sensor : debug
    custom_components.gardena_smart_system.switch : debug
    custom_components.gardena_smart_system.config_flow : debug

    gardena: debug
    gardena.smart_system: debug
    websocket: debug

After a restart detailed log entries will appear in /config/home-assistant.log.

TODO

  • Do we need support for more than one location? Should we make it possible to configure it?

hass-gardena-smart-system's People

Contributors

grm avatar hwikene avatar jborup avatar jogge avatar johanbraeken avatar jpsy avatar marlor avatar misa1515 avatar northpower25 avatar odelma avatar osks avatar renenulschde avatar riemers avatar rwzdoorn avatar stephanu avatar stoufiler avatar timn avatar tobiasbayer avatar tobx2 avatar wijnandtop avatar zuper83 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hass-gardena-smart-system's Issues

Log spam in HA 0.111.0

After an upgrade to HA 0.111.0 the home-assistant.log gets filled with:

2020-06-10 20:57:05 INFO (Thread-6) [gardena.smart_system] Received MOWER message
2020-06-10 20:57:05 INFO (Thread-6) [gardena.smart_system] Received COMMON message
2020-06-10 20:57:34 INFO (Thread-6) [gardena.smart_system] Received MOWER message
2020-06-10 20:57:34 INFO (Thread-6) [gardena.smart_system] Received COMMON message
2020-06-10 20:58:05 INFO (Thread-6) [gardena.smart_system] Received MOWER message
2020-06-10 20:58:05 INFO (Thread-6) [gardena.smart_system] Received COMMON message
2020-06-10 20:58:05 INFO (Thread-6) [gardena.smart_system] Received MOWER message
2020-06-10 20:58:05 INFO (Thread-6) [gardena.smart_system] Received COMMON message
2020-06-10 20:59:04 INFO (Thread-6) [gardena.smart_system] Received MOWER message
2020-06-10 20:59:04 INFO (Thread-6) [gardena.smart_system] Received COMMON message
2020-06-10 20:59:35 INFO (Thread-6) [gardena.smart_system] Received MOWER message
2020-06-10 20:59:35 INFO (Thread-6) [gardena.smart_system] Received COMMON message
2020-06-10 21:00:08 INFO (Thread-6) [gardena.smart_system] Received MOWER message
2020-06-10 21:00:08 INFO (Thread-6) [gardena.smart_system] Received COMMON message
2020-06-10 21:00:08 INFO (Thread-6) [gardena.smart_system] Received MOWER message
2020-06-10 21:00:08 INFO (Thread-6) [gardena.smart_system] Received COMMON message
2020-06-10 21:00:08 INFO (Thread-6) [gardena.smart_system] Received MOWER message
2020-06-10 21:00:08 INFO (Thread-6) [gardena.smart_system] Received COMMON message
2020-06-10 21:00:35 INFO (Thread-6) [gardena.smart_system] Received MOWER message
2020-06-10 21:00:35 INFO (Thread-6) [gardena.smart_system] Received COMMON message

Update API Key

Hi,

integration is working fine so far but I need to update the API key. How can I do that without deleting the integration and installing it again?

Regards

Gardena not showing up under integrations?

I installed all needed files, in the correct (sub)folders.
I rebooted HASS.

I don't see the component appear under Integrations?

UPDATE: also tried installing via HACS; same issue...

Installation - Gardena does not appear to be in HACS

I could not find Gardena Smart System in HACS so tried the manual method.

All seemed to be OK until I then I got to the point where I looked in Integrations in Home Assistant and could not find it there either.

Is there an obvious mistake I could have made?

Mark Wingfield

Translation for the states of the mower

The gardena mower now has activity states like: "PARKED_PARK_SELECTED", "OK_LEAVING", ...
I was wondering is there a possiblity to work with a translation file and define these therms in English like "Parked until next scheduled mowing time", "Start leaving", ...
I'm willing to do then the dutch translation for the different options.

Clearify request, question and answer

Can you clarify in the Information if this integration can be used without internet? In other words: if it has local control in a good DHCP network, but without internet. Maybe internet only for setup? I'm asking because I have no internet in a rural area and want to buy this Garenda system.

Answer on your question
"TODO
Do we need support for more than one location? Should we make it
possible to configure it?"

I don't know that answer! But for the !Privacy First! and remote networks without internet in rural area. Make shure it works without internet if that's isn't the case please! ;-)

Way to official HA integration (HA v0.111.?)

After the HACS integration is complete successfully the question is how are the way to become an original HA integration for this great integration? Per now the HA Version 0.111 is in the beta test so that the question for me is It possible that we are ready for this or what is to do that we are prepared for this step?

Can not find integration

I have copied the files from "gardena_smart_system" to my custom components/gardena_smart_system, but can not find the integration under "configuration....integrations". I have searched but it does not show up. Any ideas what I do wrong?

Platforms switch and vacuum could not be set up

I installed through HACS, fixed app key from Husqvarna and added the integration from ui without problem. However, I get a error message that switch and vacuum entities could not be set up and also no entities for these. I have tried removing the integration and re-adding it without luck. Is there something else in the process of adding this integration that I have missed? Have made a couple of restarts including restart between installing component and adding integration. Running Core 0.107.4

Skärmavbild 2020-06-07 kl  20 24 49

Skärmavbild 2020-06-06 kl  23 43 19

Mower goes into "error" state when done mowing for the day

When the mower is finished with the daily mowing schedule and goes into the dock to wait for the next time to start, the state of the entity in HA goes to error.

I am using an automation to alert me of actual errors (because the official Gardena app doesn't do this) and this works, when I for example lift the mower, it goes into the error state and alerts me.

But now it also alerts me every night when it's done mowing because it also then goes into the error state.

This is a log of today's events. See how it starts to mow at 11, and goes back and forth to the dock to charge. When it's done for the day, the state of the entity (vacuum.xxx) goes to error, when the real state is PARKED_DAILY_LIMIT_REACHED:

log

state

No 'version' key in the manifest file for custom integration 'gardena_smart_system'

Hi
I'm getting the following error after upgrading HA yesterday. Is this being worked on?
2021-04-12 17:17:51 WARNING (MainThread) [homeassistant.loader] No 'version' key in the manifest file for custom integration 'gardena_smart_system'. As of Home Assistant 2021.6, this integration will no longer be loaded. Please report this to the maintainer of 'gardena_smart_system'

Hassio 0.115.0 breaks integration

Hi,

after I updated to 0.115.0 Gardena integration is not working anymore.

After restart of Hassio it says:
_The following integrations and platforms could not be set up:

gardena_smart_system.sensor
gardena_smart_system.switch
gardena_smart_system.vacuum

Please check your config._

Within the logs I found:

Logger: homeassistant.setup
Source: setup.py:280
First occurred: 19:47:29 (3 occurrences)
Last logged: 19:47:31

    Unable to prepare setup for platform gardena_smart_system.sensor: Platform not found (cannot import name 'UNIT_PERCENTAGE' from 'homeassistant.const' (/usr/src/homeassistant/homeassistant/const.py)).
    Unable to prepare setup for platform gardena_smart_system.switch: Platform not found (cannot import name 'UNIT_PERCENTAGE' from 'homeassistant.const' (/usr/src/homeassistant/homeassistant/const.py)).
    Unable to prepare setup for platform gardena_smart_system.vacuum: Platform not found (cannot import name 'UNIT_PERCENTAGE' from 'homeassistant.const' (/usr/src/homeassistant/homeassistant/const.py)).

Water Control - Dynamic Watering duration

Dear team

This is a feature request for dynamic watering duration for the Gardena Water control. It would be amazing if the duration could be set dynamically through the UI or automations. Is it possible to add this feature?

Thanks a lot,

gardena mower not available

Having the same issue? See #52 (comment) which solves it.

I had the gardena mower running really well with node red flows to only start it, when it is not rainy and stuff but now it does not work anymore at all:

Log:

Logger: homeassistant.config_entries
Source: custom_components/gardena_smart_system/__init__.py:88
First occurred: 13:13:49 (1 occurrences)
Last logged: 13:13:49
Error setting up entry for gardena_smart_system

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 231, in async_setup
    result = await component.async_setup_entry(hass, self)  # type: ignore
  File "/config/custom_components/gardena_smart_system/__init__.py", line 51, in async_setup_entry
    await hass.async_add_executor_job(gardena_system.start)
  File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/gardena_smart_system/__init__.py", line 88, in start
    self.smart_system.update_locations()
  File "/usr/local/lib/python3.8/site-packages/gardena/smart_system.py", line 209, in update_locations
    response_data = self.__call_smart_system_get(f"{self.SMART_HOST}/v1/locations")
  File "/usr/local/lib/python3.8/site-packages/gardena/smart_system.py", line 180, in __call_smart_system_get
    if self.__response_has_errors(response):
  File "/usr/local/lib/python3.8/site-packages/gardena/smart_system.py", line 159, in __response_has_errors
    r = response.json()
  File "/usr/local/lib/python3.8/site-packages/requests/models.py", line 898, in json
    return complexjson.loads(self.text, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/simplejson/__init__.py", line 525, in loads
    return _default_decoder.decode(s)
  File "/usr/local/lib/python3.8/site-packages/simplejson/decoder.py", line 370, in decode
    obj, end = self.raw_decode(s)
  File "/usr/local/lib/python3.8/site-packages/simplejson/decoder.py", line 400, in raw_decode
    return self.scan_once(s, idx=_w(s, idx).end())
simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

seems like something is not json but should be?

I see this error for at least a week now, thankfully the mower is on its standard plan.

No one else is it reporting here so chance is, it is a configuration error on my side?

START_DONT_OVERRIDE not available for mower

I can't find any vacuum service to issue a "resume schedule" command to the mower. Is this possible to add? I believe START_DONT_OVERRIDE is the API command. I used this command to resume scheduled operations after it has stopped raining, with help of IFTTT. IFTTT does not work anymore after adding this component (IFTTT gets logged out frequently) and therefore it would be great to find it in the component.

Usecase Gardena Sprinkler with NFC Tag

Normaly my Gardena Irrigation Control works per automations, but in a part of situations i have to start/stop it manualy (i.e. I will fill a pot with water) in this cases i have before use my Smartphone open the App search for the Watercontroll entity and start/stop this.

Now with the NFC tag integration from HomeAssistant thats is more easy than befor, now i’m scan with my Smartphone an tag on my Hose trolley and give the okay that the tag starts the HA App and the water control starts if it's off and stopps if it's on.

Steps for this.

  1. Buy an NFC tag like this one https://www.amazon.de/dp/B06Y1BLLD4?ref=ppx_pop_mob_ap_share

  2. Install the HA Companion App on your Smartphone (if you have't do this before)

  3. Write the NFC tag with the HA App
    28CB9BFE-3F41-4D96-91EA-34D6EEA1A0CF

1F0AF2E9-4E1B-4634-BB39-9C9A173125BD
6BA84B75-05BE-4730-8C35-BF274F7E2A82
217C9CD3-4F58-48DD-A7FB-EB1211C11F29
F53B6C62-1910-4871-A54F-FDA875E09B78
0E495C12-8DF9-4B79-8681-D9842C73815C

  1. Go to the NFC tag configuration in HA and give your NFC tag an readable name and create an Automation like this on

1B9A0B40-1FF8-4B37-8D69-1BA737A097EA
CEFDA1D6-094A-4C3F-AB9F-06465707CAFF
2C4047E5-7F17-4CF5-8D06-83361184C914
7F8A4DEA-49BA-4557-865D-7582D5E67C26
F2278990-D81C-4A01-86A9-8D85F9C95032
6CF720DC-4F9B-4B20-B1EF-DF169F405CE9
70A2AC60-AFFC-467C-B294-A0A93D253DBE

##########################################################################
# Control Watercontrol with NFC tag
##########################################################################

- id: '1600768999472'
  alias: 'NFC Tag Garden watering on/off is scanned if water is off'
  description: If the irrigation in the garden is off start watering
  trigger:
  - platform: tag
    tag_id: 9dc6d5b1-651d-4880-839c-19cdd798a5f8
  condition:
  - condition: device
    type: is_off
    device_id: eecdf62964f3494d877413f7bd7b2a45
    entity_id: switch.garten_water_control
    domain: switch
  action:
  - type: turn_on
    device_id: eecdf62964f3494d877413f7bd7b2a45
    entity_id: switch.garten_water_control
    domain: switch
  mode: single

- id: '1600769207834'
  alias: 'NFC Tag Garden watering on/off is scanned if water is on'
  description: If the irrigation in the garden is on stop watering
  trigger:
  - platform: tag
    tag_id: 9dc6d5b1-651d-4880-839c-19cdd798a5f8
  condition:
  - condition: device
    type: is_on
    device_id: eecdf62964f3494d877413f7bd7b2a45
    entity_id: switch.garten_water_control
    domain: switch
  action:
  - type: turn_off
    device_id: eecdf62964f3494d877413f7bd7b2a45
    entity_id: switch.garten_water_control
    domain: switch
  mode: single```


Symlinked custom component does not work

The docs contain a manual installation method that uses a symlink:

cd <path>/<to>/<your>/<config>
git clone https://github.com/py-smart-gardena/hass-gardena-smart-system.git
mkdir custom_components (if not exist)
cd custom_components
ln -s ../hass-gardena-smart-system/custom_components/gardena_smart_system

This can be very helpful as the cloned path can contain a full git repo to work on while the symlink in custom_components points to the sub-path that contains the actual component.

So I tried this setup today and found that HA does completely ignore any symlinked paths in custom_components.

Here is my current symlink setup (NOT working):

image

I also tried to install the component using HACS and then replaced the resulting sub-path in custom_components by a symlink. Same result: HA does not find the component after a restart.

If this should be true, we should update the docs and remove the symlink example.

Unable to prepare setup for platform gardena_smart_system.sensor

I try to install and use the component. But there ist always an error in the setup:
The following integrations and platforms could not be set up:
gardena_smart_system.sensor
gardena_smart_system.switch
gardena_smart_system.vacuum

In the log the following errors are shown:
2020-10-01 22:28:09 DEBUG (SyncWorker_3) [custom_components.gardena_smart_system] Using location: My Garden (2af0c106-ccce-426d-9e32-f277e3005f37)
2020-10-01 22:28:10 DEBUG (SyncWorker_3) [custom_components.gardena_smart_system] Starting GardenaSmartSystem websocket
2020-10-01 22:28:11 DEBUG (MainThread) [custom_components.gardena_smart_system] Gardena Smart System component setup finished
2020-10-01 22:28:11 ERROR (MainThread) [homeassistant.setup] Unable to prepare setup for platform gardena_smart_system.sensor: Platform not found (cannot import name 'PERCENTAGE' from 'homeassistant.const' (/usr/src/homeassistant/homeassistant/const.py)).
2020-10-01 22:28:11 ERROR (MainThread) [homeassistant.setup] Unable to prepare setup for platform gardena_smart_system.switch: Platform not found (cannot import name 'PERCENTAGE' from 'homeassistant.const' (/usr/src/homeassistant/homeassistant/const.py)).
2020-10-01 22:28:11 INFO (SyncWorker_14) [homeassistant.loader] Loaded vacuum from homeassistant.components.vacuum
2020-10-01 22:28:11 INFO (MainThread) [homeassistant.components.binary_sensor] Setting up binary_sensor.gardena_smart_system
2020-10-01 22:28:11 INFO (MainThread) [homeassistant.setup] Setting up vacuum
2020-10-01 22:28:11 INFO (MainThread) [homeassistant.setup] Setup of domain vacuum took 0.0 seconds.
2020-10-01 22:28:11 ERROR (MainThread) [homeassistant.setup] Unable to prepare setup for platform gardena_smart_system.vacuum: Platform not found (cannot import name 'PERCENTAGE' from 'homeassistant.const' (/usr/src/homeassistant/homeassistant/const.py)).
2020-10-01 22:28:12 INFO (Thread-3) [gardena.smart_system] Connected to Gardena API

Can you help?

Integration brokes with 0.117.0b3

After update to HA 0.117.0b3 the integration brokes and if i will delete an reactivate the integration i get the following error

Logger: custom_components.gardena_smart_system.config_flow
Source: custom_components/gardena_smart_system/config_flow.py:133
Integration: Gardena Smart System integration (documentation, issues)
First occurred: 13:01:48 (1 occurrences)
Last logged: 13:01:48

Unexpected exception
Traceback (most recent call last):
File "/config/custom_components/gardena_smart_system/config_flow.py", line 66, in async_step_user
await self.hass.async_add_executor_job(
File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/gardena_smart_system/config_flow.py", line 133, in try_connection
smart_system.update_locations()
File "/usr/local/lib/python3.8/site-packages/gardena/smart_system.py", line 209, in update_locations
response_data = self.__call_smart_system_get(f"{self.SMART_HOST}/v1/locations")
File "/usr/local/lib/python3.8/site-packages/gardena/smart_system.py", line 180, in __call_smart_system_get
if self.__response_has_errors(response):
File "/usr/local/lib/python3.8/site-packages/gardena/smart_system.py", line 159, in __response_has_errors
r = response.json()
File "/usr/local/lib/python3.8/site-packages/requests/models.py", line 898, in json
return complexjson.loads(self.text, **kwargs)
File "/usr/local/lib/python3.8/site-packages/simplejson/init.py", line 525, in loads
return _default_decoder.decode(s)
File "/usr/local/lib/python3.8/site-packages/simplejson/decoder.py", line 370, in decode
obj, end = self.raw_decode(s)
File "/usr/local/lib/python3.8/site-packages/simplejson/decoder.py", line 400, in raw_decode
return self.scan_once(s, idx=_w(s, idx).end())
simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Exception: 502 : error communicating with the backend, when hitting start

I can read all Attributes in HA. But when i want to start my Mover the above error shows up.
Environment:
HA Operating System 4.10
Home Assistant Core: 0.113.0
HACS Version: 1.2.2
Gardena Version 0.2.1
Running on a RaspPi 3b

Protokolldetails ( ERROR )
Logger: homeassistant.components.websocket_api.http.connection.1859044208
Source: custom_components/gardena_smart_system/vacuum.py:174
Integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 15:19:16 (1 occurrences)
Last logged: 15:19:16

502 : error communicating with the backend
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 125, in handle_call_service
await hass.services.async_call(
File "/usr/src/homeassistant/homeassistant/core.py", line 1250, in async_call
task.result()
File "/usr/src/homeassistant/homeassistant/core.py", line 1285, in _execute_service
await handler.func(service_call)
File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 208, in handle_service
await self.hass.helpers.service.entity_service_call(
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 454, in entity_service_call
future.result() # pop exception if have
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 595, in async_request_call
await coro
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 485, in _handle_entity_call
await result
File "/usr/src/homeassistant/homeassistant/components/vacuum/init.py", line 361, in async_start
await self.hass.async_add_executor_job(self.start)
File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/gardena_smart_system/vacuum.py", line 174, in start
self._device.start_seconds_to_override(duration)
File "/usr/local/lib/python3.8/site-packages/gardena/devices/mower.py", line 34, in start_seconds_to_override
self.smart_system.call_smart_system_service(self.id, data)
File "/usr/local/lib/python3.8/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

Smart Perssure Pump not working

I own a gardena smart perssure pump and would like to control it using HA.

The issue is that when I press the switch for the pump I get a 502 communication error.
But if I use the gardena app to switch on / off the pump the state is reportet correctly back to HA.

I also have a smart irrigation controller which is working nicely in combination with this integration.

Here is the log:
502 : error communicating with the backend
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 130, in handle_call_service
connection.context(msg),
File "/usr/src/homeassistant/homeassistant/core.py", line 1253, in async_call
task.result()
File "/usr/src/homeassistant/homeassistant/core.py", line 1288, in _execute_service
await handler.func(service_call)
File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 213, in handle_service
self._platforms.values(), func, call, required_features
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 454, in entity_service_call
future.result() # pop exception if have
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 597, in async_request_call
await coro
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 485, in _handle_entity_call
await result
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 622, in async_turn_on
await self.hass.async_add_executor_job(ft.partial(self.turn_on, **kwargs))
File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/gardena_smart_system/switch.py", line 142, in turn_on
self._device.start_seconds_to_override(duration)
File "/usr/local/lib/python3.7/site-packages/gardena/devices/water_control.py", line 33, in start_seconds_to_override
self.smart_system.call_smart_system_service(self.id, data)
File "/usr/local/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

Not working after 0.115

Hi,

My gardena robot mower doesn't work anymore.
I has been working perfectly until I updated HA.
I get the following error message in my log:

Invalid config
The following integrations and platforms could not be set up:

gardena_smart_system.sensor
gardena_smart_system.switch
gardena_smart_system.vacuum
Please check your config.

Websocket error.

ERROR (Thread-4) [websocket] error from callback <bound method Client.on_message of <gardena.smart_system.Client object at 0x6fffb100>>: on_message() takes 2 positional arguments but 3 were given

All sensors updates on startup, after that i receive this error.

Devices or Services for Smart Watering System

Hi,

First, thanks a lot for all your great work! It's soo great to be finally able to integrate HA with Gardena Smart system.

I've successfully activated the integration and it shows up in HA integrations. I have the smart watering system only (no mower, nor irrigation system). But the integration doesn't show any device nor entity. Also I was not able to find any service nor state related to the smart watering system.

Can you please help me on how to use this integration? I would like to see the current status and activate/disable watering using a switch.

Thanks,
D

Where is homekit code??

Hi all,

Have followed instructions and have api code etc, however am stuck on getting my homekit code - can't see it anywhere on the gardena hub or my smart watering system. Can't see it in the app either - anyone able to offer any pointers here??

Can't use actions in Home Assistant

Hi,
I am trying to setup som automations to vacuum.start and vacuum.stop.
But when i try to use the buttons on the entity card i get this error:

Logginformation (ERROR)
Logger: homeassistant.components.websocket_api.http.connection.140165153689232
Source: custom_components/gardena_smart_system/vacuum.py:170
Integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 11:29:02 (1 occurrences)
Last logged: 11:29:02

502 : error communicating with the backend
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 130, in handle_call_service
connection.context(msg),
File "/usr/src/homeassistant/homeassistant/core.py", line 1253, in async_call
task.result()
File "/usr/src/homeassistant/homeassistant/core.py", line 1288, in _execute_service
await handler.func(service_call)
File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 213, in handle_service
self._platforms.values(), func, call, required_features
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 454, in entity_service_call
future.result() # pop exception if have
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 597, in async_request_call
await coro
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 485, in _handle_entity_call
await result
File "/usr/src/homeassistant/homeassistant/components/vacuum/init.py", line 370, in async_start
await self.hass.async_add_executor_job(self.start)
File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/gardena_smart_system/vacuum.py", line 170, in start
self._device.start_seconds_to_override(duration)
File "/usr/local/lib/python3.7/site-packages/gardena/devices/mower.py", line 30, in start_seconds_to_override
self.smart_system.call_smart_system_service(self.id, data)
File "/usr/local/lib/python3.7/site-packages/gardena/smart_system.py", line 136, in call_smart_system_service
raise Exception(f"{r.status_code} : {response['errors'][0]['title']}")
Exception: 502 : error communicating with the backend
Misslyckades med att anropa tjänsten vacuum/start. 502 : error communicating with the backend

Might there be need for a port forward or something? Does anyone have any idea?
It works from the Gardena app, but not from Home assistant. And i have tried through automations, manual and developer tools. Sensors update fine, it's only sending commands that won't work.

Installed through HACS, and have done all configs according to installation notes.

Hope i have provided what is needed?

Thanks in advance for any help :)

Integration doesn't work

very same issue as reported by Johnyyy85 in the older repo. Integration doesn't work.

HACS installation done.
Husqvarna Application created and API linked
HA rebooted several times
When adding integration using Application Key, nothing happens.

Error message:

Logger: custom_components.gardena_smart_system.config_flow
Source: custom_components/gardena_smart_system/config_flow.py:133
Integration: Gardena Smart System (documentation)
First occurred: 13:17:42 (2 occurrences)
Last logged: 13:17:59

Unexpected exception
Traceback (most recent call last):
File "/config/custom_components/gardena_smart_system/config_flow.py", line 70, in async_step_user
user_input[CONF_CLIENT_ID])
File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/gardena_smart_system/config_flow.py", line 133, in try_connection
smart_system.update_locations()
File "/usr/local/lib/python3.7/site-packages/gardena/smart_system.py", line 157, in update_locations
if len(response_data["data"]) < 1:
KeyError: 'data'

No 'version' key in the manifest file for custom integration 'gardena_smart_system'. This will not be allowed in a future version of Home Assistant. Please report this to the maintainer of 'gardena_smart_system'

Custom integrations now require a version key in their manifest file, this also means that all custom integrations now require a manifest file.

If you are using a legacy custom integration like custom_components/awesome.py this now needs to move to custom_components/awesome/init.py so you can add custom_components/awesome/manifest.json to it.

For more information about integration, manifests have a look here: https://developers.home-assistant.io/docs/creating_integration_manifest

For now, this will create a warning on startup. But this will eventually be blocked from loading if it’s missing a version in the manifest.

If you see these warnings, please report the issue with the author of that custom integration.

home-assistant/core#45919

installation

Why asking username & password and not the application secret, is the password needed after installation ?

Water Control ambient temperature sensor

It seems that the Water Control unit in my garden has a secret ambient temperature sensor which does not show up in the Gardena App. I suspect this sensor is in the device to enable frost warnings.

When using the OpenHAB Gardena binding it is able to read and display the "Ambient Temperature" data.

Screenshot 2020-06-04 at 17 03 45

Not sure how the implementation of this integration for Home Assistant is different from the OpenHAB binding, but the same sensor does not show up.

Screenshot 2020-06-04 at 17 04 03

Perhaps this sensor could be added here too?

Websocket lost connection, no more updates

I noticed that my sensors had old values and found this in the Home Assistant log (developer tool GUI):

Logger: websocket
Source: util/thread.py:20
First occurred: May 31, 2020, 7:50:26 PM (1 occurrences)
Last logged: May 31, 2020, 7:50:26 PM

error from callback <bound method Client.on_close of <gardena.smart_system.Client object at 0x7f17043d5850>>: 403 Client Error: Forbidden for url: https://api.smart.gardena.dev/v1/websocket

The last sensor update was from around that time. It seems it doesn't restart the websocket after that error.

Translation dutch

When the mower is "mowing" the result state is in dutch "reinigen" . That means cleaning.
It should be "mowing'

Getting "not all required fields are filled in" when trying to set it up

Hey guys,
thanks for the effort getting this into Hacs!

I am trying to switch to this integration, coming from a custom Gardena integration. When trying to get it to work I get the error (see attached screenshot). Obviously all fields are filled when hitting "submit".

Any ideas? Running on Home assistant 0.111.4

Thanks!
image

With HA 0.116.1 the Sileno Mower breaks

After Update to HA 0.116.1 the Sileno Mower dosent work anymore with the integration. Everyelse (Sensors, Watering) work fine.

I see no errors in the logs.

9263E818-3A7A-45C2-9350-945839D788D1

Support Husqvarna mowers (via Automower Connect API)

I'm trying to get this to work with my mower, but the init fails because I have no locations registered. I have no gateway or any other Gardena smart system devices, only a Husquarna mower.

The API works as expected:

The component fails because it relies on the first call to return at least one location. This is not the case of only a mower and no other components. Can you make the component work with a setup where there is only a mower?

Full set of mower commands

This is an issue from the old repository (osks/hass-gardena-smart-system#10).

The status now is that the mapping between mower and vacuum commands is like this:

If in the end we would have to live with only 3 services, I would recommend the following mapping - which would provide the most important functions for automations:

  1. START_SECONDS_TO_OVERRIDE = vacuum.start
  2. PARK_UNTIL_NEXT_TASK = vacuum.return_to_base
  3. PARK_UNTIL_FURTHER_NOTICE = vacuum.stop

The idea is that the best mapping would be this:

  1. START_SECONDS_TO_OVERRIDE = vacuum.start
  2. START_DONT_OVERRIDE = vacuum.turn_on
  3. PARK_UNTIL_NEXT_TASK = vacuum.return_to_base
  4. PARK_UNTIL_FURTHER_NOTICE = vacuum.stop and vacuum.turn_off

But it seems that vacuum.turn_on and vacuum.turn_off doesn't work as expected.

TODO:
Check if there is a way to make vacuum.turn_on and vacuum.turn_off trigger the corresponding methods in vacuum.py.
If yes: Implement 4 command version.
If no: Stay with current version and close this issue.

HA / Gardena Integration doesn't work

Hi all,

I'm running HA 0.110.4 and installed HACS and Garden Integration today. I have configured everything as described in the guide.

Following errors coming up in HA log:

No. 1:

Logger: gardena.smart_system
Source: custom_components/gardena_smart_system/init.py:88
First occurred: 20:27:47 (1 occurrences)
Last logged: 20:27:47

403 : {'message': 'Forbidden'}

No. 2:

Logger: custom_components.gardena_smart_system
Source: custom_components/gardena_smart_system/init.py:91
Integration: Gardena Smart System (documentation)
First occurred: 20:27:47 (1 occurrences)
Last logged: 20:27:47

No locations found

No 3:

Logger: homeassistant.config_entries
Source: custom_components/gardena_smart_system/init.py:92
First occurred: 20:27:48 (1 occurrences)
Last logged: 20:27:48

Error setting up entry for gardena_smart_system
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 217, in async_setup
hass, self
File "/config/custom_components/gardena_smart_system/init.py", line 51, in async_setup_entry
await hass.async_add_executor_job(gardena_system.start)
File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/gardena_smart_system/init.py", line 92, in start
raise Exception("No locations found")
Exception: No locations found

Any idea why this isn't working? Do I need to configure something in edition in swagger options on Husqvarna API?

Thanks & regards

Where to enter Gardena API credentials - config_flow not working?

Hi,

I successfully installed the latest version of the integration on my HomeAssistant and restartet afterwards.

Versions:
Integration: 0.2.1
HACS: 1.3.3
HA: 0.113.3
HassOS: 4.12

Unfortunately I´m stuck at the configuration step. I´m missing the info where to enter the Gardena/Husquarna API credentials?
By clicking on the integration options I can´t find anything. Guess I´m just overlooking something?

Gardena_Integration

Might be the config_flow is not triggered? I just don´t get asked to enter API key etc.

I meanwhile also tried to install to install version 0.2.1.3b with same result.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.