Giter Club home page Giter Club logo

iobroker.smartgarden's Introduction

Logo

ioBroker.smartgarden

Installed NPM version Downloads Build Status Stable

NPM

ioBroker smartgarden adapter for GARDENA smart system

An adapter for GARDENA smart system using official GARDENA smart system API and service.

The adapter allows the development of an application (e.g. with VIS) that can be used in parallel with the official GARDENA app. The adapter and its additional features do not affect any of the basic functions of the GARDENA app and vice versa.

The adapter is not a complete replacement for the GARDENA app, but an addition to integrate the GARDENA devices into a smart home with ioBroker. The most important actions can be carried out with the adapter. It also offers the opportunity to implement your own ideas that are not possible with the GARDENA app.

Supported devices

  • GARDENA smart SILENO robotic lawnmowers
  • GARDENA smart Irrigation Control
  • GARDENA smart Pressure Pump
  • GARDENA smart Water Control
  • GARDENA smart Power Adapter
  • GARDENA smart Sensor

For more information about the devices see at GARDENA German website and here in English.

Requirements

To use this adapter you need the following things:

  1. an GARDENA smart system account
  2. an GARDENA application key
  3. an GARDENA application secret

To get those things please go to Husqvarna Developer Portal at https://developer.husqvarnagroup.cloud/.

Please Sign up or Log in if you already have an account and create a new application to get your application key and application secret.

Currently the site looks like in the following screenshots.


myapplications

Press button NEW APPLICATION


createnewapplication

Edit form with your own data. Currently the field Redirect URLs is not used. That's why you can currently enter any value. Press button CREATE


mysmartgardenapplication

At the next page you get the application key and application secret. You will need those values for your adapter instance configuration. And you have to connect the APIs

  • Authentication API and
  • GARDENA smart system API.

For this press button CONNECT NEW API and select the first API. And repeat for the second API.


Note:

  • If you already have a Husqvarna Automower® Connect or a GARDENA smart system account, you can Sign In with that account and continue with Create application to get the application key and application secret.


    And it's almost certain that you have an account. Please use the same account as for the GARDENA app in which your GARDENA devices are registered. Otherwise you will not get access to your devices.


  • Make sure that you've connected the application to the API's

    • Authentication API and
    • GARDENA smart system API.

And of course you need a running ioBroker installation (at least using admin5 UI) and you should own at least one working GARDENA smart device.

Table of Contents

Installation

Adapter is available

Setup adapter

  1. Install the adapter

  2. Create an instance of the adapter

  3. Check and complete instance configuration

    If you change any value of those settings please restart your adapter.

    3.1 Edit application key and application secret and/or optional username, password in main instance configuration

    Parameter Description
    mandatory
    Application key Application key (API key), e.g. under Requirements
    either application secret
    or username and password *) **)
    recommended
    Application secret *) application secret, e.g. under Requirements - only if username and password are empty (new in v2.0.0)*
    not recommended
    username *) **) username for GARDENA smart system - only if application secret is empty
    password *) **) corresponding password - only if username is specified

    NOTES:
    *)

    • From release v2.0.0 the preferred login procedure is using application key and application secret as the former login procedure with username and password isn't supported by Gardena anymore, but nevertheless it's still working for many users. For this reason it is still available here, but in the event of an error, there is no longer any support for it. So it's recommended to use application key and applicaton secret!

    • Application key, application secret and password are encrypted and stored within the adapter and become just decrypted for authentication with the GARDENA application host.

    **)

    • parameter is discontinued and may no longer be available in a future version

    3.2 Verify default values of miscellaneous settings and switch on/off options in instance configuration. For most users the default values will be ok.

    Parameter Description
    forecast use forecast for charging time and mower remaining time; switch forecast charging and mowing time of mower on/off; default: off; (new in v0.5.0)
    cycles number of MOWER history cycles; you can use any number from 3 (minimum), but 10 (default) seems to be a good value; only relevant if the above 'forecast' is on; (new in v0.5.0)
    irrigation check use the check whether irrigation is allowed while mowing; switch on/off; default: off; (new in v0.6.0)
    monitor limit use monitoring for the rate limits of Gardena smart system API; switch on/off; default: off; (new in v1.0.2)

    3.3 Verify default values of systems settings and switch on/off options in instance configuration. Most users will not have to change anything on this tab.

    Parameter Description
    Loglevel Loglevel: 0 = no log entries, 1 = some log entries, 2 = some more log entries, 3 = all log entries; default: 0 - no log entries
    beautify log make state ids shorter in log; switch on/off; default: on; (new in v1.0.5)
    connection retry interval interval for retry to connect to Gardena Webservice in case of an error (in seconds); default: 300, minimum: 60; (new in v1.0.3)
    ping interval Interval for sending Ping's to Gardena Webservice (in seconds); default: 150, minimum: 1, maximum: 300
    auth factor Factor for validity of authentication token; default: 0.999
    Auth-URL Authentication host URL; default: https://api.authentication.husqvarnagroup.dev
    Base-URL Webservice Base-URL; default: https://api.smart.gardena.dev

Getting support

To get help read this README and the FAQ carefully. If you need further support please join the ioBroker forum thread.

Data points of the adapter

The adapter is designed to monitor and control GARDENA smart system devices. For this there will be one LOCATION and one or many DEVICE's. For each DEVICE there will be

  • one SERVICE_COMMON_<id> and
  • one or more SERVICE_<servicelink_type>_<id>.

Where <servicelink_type> is a type description for the device, for example MOWER or VALVE and <id> is a (encoded) GARDENA device id used by the API. See description for ServiceLink at https://developer.husqvarnagroup.cloud/apis/GARDENA+smart+system+API#/swagger.

Controlling/monitoring for each device is possible via the SERVICE_<servicelink_type> listed in the following table. The SERVICE_COMMON provides general information about the device.

device SERVICE_<servicelink_type>
smart SILENO robotic lawnmower SERVICE_MOWER and SERVICE_COMMON
smart Irrigation Control SERVICE_VALVE_SET, SERVICE_VALVE and SERVICE_COMMON
smart Pressure Pump SERVICE_VALVE and SERVICE_COMMON
smart Water Control SERVICE_VALVE and SERVICE_COMMON
smart Power Adapter SERVICE_POWER_SOCKET and SERVICE_COMMON
smart Sensor SERVICE_SENSOR and SERVICE_COMMON

If you need more information about the data points please have a look at https://developer.husqvarnagroup.cloud/apis/GARDENA+smart+system+API#/swagger. There you'll find a description for every data point; except for those which are marked as data points of the adapter and not of the GARDENA smart system API.

The adapter creates its own data points for various features / options when the feature is selected. These data points are not automatically deleted when the feature is deselected. If you no longer need these data points, they can be deleted manually.

General things to know about data points

The adapter doesn't change any values transmitted by the GARDENA smart system API. The only thing that is done (from version 1.0.0) is to check the type of timestamps and numbers.

check for description
timestamps all timestamps are given in UTC; if a received timestamp is not a valid timestamp, 01 Jan 1970 00:00:00Z (Unix time zero) is used instead. So if you see this date/time please report.
numbers if a number is not a valid number, -1 is used instead. So if you see this number please report.

Requests to control a device will succeed as soon as the command was accepted by the smart Gateway. A successful execution of the command on the device itself can be observed by a respective state change. Example: sending a command to start the VALVE service of a smart Water Control will result in the activity_value data point of the service to be changed after the device processed the command.

Notes:

For SERVICE_MOWER

Controlling

To control the device use data point

  • activity_control_i: type string

    This data point is generated by the adapter and is not required due to the GARDENA smart system API.

    Change this data point to start the mower.

    • To start for a defined time set the value to the planned duration in seconds (please use multiples of 60; minimum is 60); consider the data type string
    • for automatic operation set string START_DONT_OVERRIDE
    • to cancel the current operation and return to charging station use string PARK_UNTIL_NEXT_TASK
    • to cancel the current operation, return to charging station and ignore schedule use string PARK_UNTIL_FURTHER_NOTICE

    Note: The mower only starts with a fully charged battery.

Monitoring

All other data points are just for monitoring and information.

Special data points:

  • activity_mowing_i

    This data point is generated by the adapter and is not required due to the GARDENA smart system API.

    This data point shows two different states for the mower:

    • true: mowing or
    • false: not mowing.

    This data point can be used for further actions where it is important to know whether the mower is safely on the lawn or not.

    Depending on the value of data point activity_value this data point is set. Please see following table for details.

    activity_value activity_mowing_i
    OK_CHARGING The mower has to be mowing but insufficient charge level keeps it in the charging station. false
    PARKED_TIMER The mower is parked according to timer, will start again at configured time. false
    PARKED_PARK_SELECTED The mower is parked until further notice. false
    PARKED_AUTOTIMER The mower skips mowing because of insufficient grass height. false
    PAUSED The mower is in a waiting state with hatch closed. false
    OK_CUTTING The mower is cutting in AUTO mode (schedule). true
    OK_CUTTING_TIMER_OVERRIDDEN The mower is cutting outside schedule. true
    OK_SEARCHING The mower is searching for the charging station. true
    OK_LEAVING The mower is leaving charging station. true
    NONE No activity is happening, perhaps due to an error. true
    all other values true
  • batteryState_chargingTime_remain_i (under SERVICE_COMMON...) and
    activity_mowingTime_remain_i (under SERVICE_MOWER...)

    Both data points are generated by the adapter and are not required due to the GARDENA smart system API.

    Those data points show an forecast for remaining charging and mowing time in seconds of the mower. They are only created when the function is selected in the instance configuration.

    To forecast a value an history of the last few charging and mowing cycles is saved in two states info.saveMowingHistory and info.saveChargingHistory.

    This feature can be switched on/off in adapter instance configuration along with the number of saved charging and mowing cycles in history.

    To put this function into operation, please make sure that at least one cycle of mowing and charging runs without errors (e.g. not interrupted manually or sensor control). It is better if at least three runs are completed without errors. This function tries to recognize the normal case and initially assumes that the next process is a normal case. If this is faulty, then this faulty run is regarded as a normal case and the runs that then pass through normally as a fault case. If there is an error during the run, please stop the adapter, delete the two data points and start again.

    For more information about general forecasting mechanisms see FORECAST.md.

    Notes:

    1. Forecast values are only available if at least one complete charging and mowing cycle is saved in history.

    2. The history is saved under info so that if the LOCATION needs to be deleted, e.g. in the event of a future update, it is not lost.

    3. If you disconnect your mower from the GARDENA smart system and reconnect it again the history is lost, because your mower get's a new id within the GARDENA smart system. This means that the adapter cannot recognize the mower as the previous mower - may be it's a second one. In this case it is recommended to delete these two data points and to restart the adapter so that the previous (now old) history sets are not constantly read and written. The adapter then begins to build a new history.

    4. This function should work for more than one mower, but it is not tested (I can't do that, because I've only one mower). If you have more than one mower please test and report errors and of course report if it works as intended. Thanks in advance for that.

  • lastErrorCode_value

    Please pay special attention to data point lastErrorCode_value. A description of possible values can be found at https://developer.husqvarnagroup.cloud/apis/GARDENA+smart+system+API#/swagger, see "MowerService - lastErrorCode"

For SERVICE_VALVE_SET

Controlling

To control the device use data point

  • stop_all_valves_i: type string

    This data point is generated by the adapter and is not required due to the GARDENA smart system API.

    Change this data point to stop all valves.

    • To stop all valves immediately use string STOP_UNTIL_NEXT_TASK

    Note: Do not display the value of this data point in your application, as the value is mostly undefined. Furthermore, this data point cannot serve as a trigger for your own actions, because it is just set to value null after the command was triggered.

Monitoring

All other data points are just for monitoring and information.

For SERVICE_VALVE

Controlling

To control the device use data point

  • duration_value: type string

    Change this data point to start the valve.

    • To start for a defined time set the value to the value in seconds (please use multiples of 60; minimum is 60); consider the data type string.

      Note: There are some limitations for the allowed values. Please report if you see other limitations.

      device limit
      GARDENA smart Irrigation Control 5400 seconds (90 minutes)
      GARDENA smart Pump 36000 (10 hours)
      GARDENA smart Water Control 36000 (10 hours)
    • To cancel the current watering and continue with the schedule use string STOP_UNTIL_NEXT_TASK

    • To skip automatic operation until specified time, the currently active operation might or might not be cancelled (depends on device model) use string PAUSE_<number_of_seconds>, e.g. PAUSE_86400 to pause for 24 hours (please use multiples of 60; minimum is 60)

    • To restore automatic operation if it was paused use string UNPAUSE

  • irrigationWhileMowing_allowed_i and irrigationWhileMowing_mowerDefinition_i

    This data points are generated by the adapter and are not required due to the GARDENA smart system API.

    Those data points give control over the feature Irrigation not allowed while mowing. They are only created when the function is selected in the instance configuration. For description of this feature see chapter Irrigation not allowed while mowing.

Monitoring

All other data points are just for monitoring and information.

Special data point:

  • duration_leftover_i

    This data point is generated by the adapter and is not required due to the GARDENA smart system API.

    The value describes the number of minutes till the valve is closed and watering stops.

    • An integer, one (1) or more.
    • null if undefined

For SERVICE_POWER_SOCKET

Controlling

To control the device use data point

  • duration_value: type string

    Change this data point to start the power socket.

    • To start for a defined time set the value to the value in seconds (please use multiples of 60; minimum is 60); consider the data type string
    • To switch on the device forever please use the string START_OVERRIDE.
    • To stop the device use STOP_UNTIL_NEXT_TASK.
    • To skip automatic operation until specified time. The currently active operation will NOT be cancelled. Use string PAUSE_<number_of_seconds>, e.g. PAUSE_86400 to pause for 24 hours (please use multiples of 60; minimum is 60)
    • To restore automatic operation if it was paused use string UNPAUSE

Monitoring

All other data points are just for monitoring and information.

Special data point:

  • duration_leftover_i

    This data point is generated by the adapter and is not required due to the GARDENA smart system API.

    The value describes the number of minutes till the power socket is shut off.

    • An integer, one (1) or more.
    • null if undefined

For SERVICE_SENSOR

Controlling

No control functions available.

Monitoring

All data points are just for monitoring and information.

For SERVICE_COMMON

The SERVICE_COMMON provides general information about the device. Description is integrated into description of other SERVICE_... where necessary.

Rate Limits

There are some limits you shoud be aware of. Please see chapter Rate Limits in README of GARDENA smart system API description.

To help you to see if you hit those rate limits you can switch on monitoring in instance configuration with parameter monitoring Rate Limits.

If you've enabled monitoring state info.RateLimitCounter gets actualized with every request. This state saves a data structure with the number of requests per month, day, hour and for the last 30 and 31 days.

The structure is in JSON and looks like

{
  "2020": {                          <<< year
    "2020-08": {                     <<< month
      "count": 21,                   <<< number of requests for month
      "2020-08-27": {                <<< day
        "11": {                      <<< hour
          "count": 3                 <<< number of requests for hour
        },
        "12": {                      <<< hour   
          "count": 13                <<< number of requests for hour
        },
        "count": 16                  <<< number of requests for day
      },
      "2020-08-28": {                <<< day
        "14": {                      <<< hour
          "count": 5                 <<< number of requests for hour 
        },
        "count": 5                   <<< number of requests for day
      }
    }
  },
     ...
  "last30days": {                     
    "count": 2021                    <<< number of requests in last 30 days
  },
  "last31days": {
    "count": 2098                    <<< number of requests in last 31 days
  }
}

Note:

  • That hour is hour of time in UTC
  • That the actual number of requests may be higher. Especially as long as the respective period is not fully covered by the monitoring.
  • That this structure becomes very large and is never deleted by the adapter. So please delete it manually from time to time or switch off monitoring - at least if you don't have any issues with the rate limits.

Irrigation not allowed while mowing

What's the problem?

If you have both a mower and an irrigation system with pop-up sprinklers, there is a risk that your mower will run into a pop-up sprinkler while the irrigation is running and damage it or cause damage itself.

To prevent this, the irrigation system or better individual valves should be switched off when the mower is mowing.

What is being done?

With this function it is possible to stop irrigation when the mower is on the lawn. This can be defined separately for each valve.

One or more mowers can be defined for each valve, for which the valve is not allowed to be open while the mower is mowing. Basically, the mower has priority over irrigation, i.e. if the conflict arises that the mower is mowing and a valve is open, the valve is closed and a corresponding warning is set.

Additionally it is possible to define that a valve should never open regardless of a mower. E.g. can be used if a valve or the pipe behind it is damaged.

The whole check can be switched on or off in instance configuration with parameter irrigation check.

There are three data points available for each SERVICE_VALVE. They are used for configuration and for reporting warnings.

data point writeable Description of data points
irrigationWhileMowing_allowed_i yes set to false if it should be checked if irrigation is allowed while the mower is mowing on the lawn, true otherwise
irrigationWhileMowing_mowerDefinition_i yes one or more id's of SERVICE_MOWER which get checked. Format of mower id see below. There is a special code IRRIGATION_FORBIDDEN meaning that the valve is always closed regardless of a mower. If more than one id should be set then separate them by semicolon (;).
irrigationWhileMowing_warningCode_i no warning code is set if valve opens. Possible warning codes see next table. If more than one warning is set, codes are concatenated with + (e.g. STOPPED+UNKNOWN_MOWER).
  • mower id format

    smartgarden.0.LOCATION_xxxxxxxx-xxxxxx-xxxxxx-xxxxxx-xxxxxxxxxxxxxx.DEVICE_xxxxxxxx-xxxxxx-xxxxxx-xxxxxx-xxxxxxxxxxxxxx.SERVICE_MOWER_xxxxxxxx-xxxxxx-xxxxxx-xxxxxxxxxxxxxxxxxxxxx

    You can copy this mower id from the objects tab of ioBroker, see red arrow in the following picture.

    mower id

  • warning codes

    warning code description
    NO_WARNING no warning, valve opened
    UNKNOWN_MOWER wrong mower id in irrigationWhileMowing_mowerDefinition_i
    STOPPED valve automatically closed because mower is mowing
    FORBIDDEN valve closed because special code IRRIGATION_FORBIDDEN is set in data point irrigationWhileMowing_mowerDefinition_i

This function is runnig every time when

  • a valve becomes opened or
  • a mower starts mowing

It doesn't run when you change the values in the data points listed above. That means: if there is a conflict situation and you change irrigationWhileMowing_allowed_i from true to false, the conflict is not recognized and the conflict will continue. The same behaviour applies to a change of irrigationWhileMowing_mowerDefinition_i.

Basic behaviour -- WARNING

This feature cannot prevent a valve from opening while the mower is mowing. E.g. this can be done manually through the GARDENA app or automatically through a schedule.

This function can only close the valve as quickly as possible in the event of a conflict. And a conflict may not be recognized either. So it can happen that water is let through. E.g. it cannot be prevented that the pop-up sprinklers extend and that the mower hits the pop-up sprinklers, but the likelihood that this will happen has been minimized. So it is up to your application to make sure that this conflict will never happen.

Wishes for data points

This adapter reports every value as a data point that is supplied via the GARDENA smart system API. If someone wants more values, please contact GARDENA and inform them that this value will also be included in the API. To do this, please go to Contact us & Leave feedback in the footer on the GARDENA Developer Portal.

Note

This is a private project. I am not in any association with GARDENA or Husqvarna.

Changelog

2.0.0

  • (jpgorganizer) 2022-Jun-13
    • support for new login procedure to Gardena webservice: using Application secret and Application key instead of username and password. Issue 47

      Procedure with username and password is still available, as it's still working for some users.

      TODO for all existing users: please re-enter your login data, even if you will still use username and password!

    • support for admin4 UI removed; at least admin5 is needed!

    • new configuration page

    • function and configuration parameter pre-define states removed. All Gardena data points get deleted and created again.

    • documentation has been adjusted

1.0.6

  • (jpgorganizer) 2022-May-04
    • some minor changes in documentation, including Issue 41 and new limit for SERVICE_VALVE (just smart Irrigation Control)
    • bug fix in error handling
    • changes due to new Gardena API v1.1.0
    • necessary changes due to changed behavior Gardena Service Issue 43
    • tests against js-controller 4.x, Issue 40

1.0.5

  • (jpgorganizer) 2021-May-13
    • necessary adjustments due to js-controller v3.3; e.g. Issue 29
      • nearly all data points get deleted and created again with intended role/unit
      • data types for following data points changed from string to number:
        • for all devices: rfLinkLevel_value
        • for mower: batteryLevel_value, operatingHours_value
        • for sensor: batteryLevel_value, soilHumidity_value, soilTemperature_value, lightIntensity_value, ambientTemperature_value
    • compatibility test with node.js v14 and node.js v16 and added to Travis CI test; compatibility test with the upcoming Admin 5 React UI; e.g. Issue 30
    • new parameter beautify log in instance configuration; makes state ids a little bit shorter in log if switched on

1.0.4

  • (jpgorganizer) 2021-Feb-22
    • necessary adjustments due to js-controller v3.2
    • option useTestVariable in adapter/instance configuration removed

1.0.3

  • (jpgorganizer) 2021-Jan-26
    • improved error handling
    • new parameter connection retry interval
    • axios vulnerability solved, using version >=0.21.1

1.0.2

  • (jpgorganizer) 2020-Aug-30

1.0.1

  • (jpgorganizer) 2020-Aug-17
    • better reconnection to GARDENA smart system server in case of your internet connection was broken
    • textual changes in io-package.json
    • improved README and FAQ

1.0.0

  • (jpgorganizer) 2020-Jun-13
    • code rework, no functional change expected
    • support PAUSE for SERVICE_VALVE, SERVICE_POWER_SOCKET. e.g. Issue 14
    • internal representation for all timestamps changed from format like 2020-05-26T05:03:47.613+0000 to 2020-05-26T05:03:47.613Z to support Safari browser e.g. Issue 12.
    • support forecast values for mower id's in format with suffix, e.g. d8a1faef-2ee3-421d-a3f8-f8ed577c2ad3:suffix, e.g. Issue 12
    • making the adapter more fault tolerant at startup, e.g. trimming whitespaces from username, etc.
    • README: new chapter Getting support,
    • README: chapter Known Errors deleted, should be resolved by GARDENA
    • README: links to GARDENA/Husqvarna developer portal adjusted to the new address

0.6.0

  • (jpgorganizer) 2020-May-03

0.5.1

  • (jpgorganizer) 2020-Apr-26
    • some corrections (sensor, typo)
    • integration of travis-ci

0.5.0

  • (jpgorganizer) 2020-Apr-25
    • MOWER: forecast for remaining charging time and remaining mowing time integrated, e.g. Issue 1

    • IMPORTANT CHANGE for existing users: the id for LOCATION, all DEVICE's and all SERVICE's has changed due to support of History adapter. (History adapter cannot handle id's with % (percent) character within id's, although the % is not forbidden in id's in ioBroker), e.g. Issue 8.

      So you must delete all states of the adapter instance to install this release and please check your application carefully for necessary adjustments regarding the change of the id names.

    • devices Water Control and Smart Pump tested (many thanks to user gammler2003 and xengosam at ioBroker Forum for testing)

    • some code rework and improvement of documentation

    • dependency corrected, important for js-controller v3, e.g. Issue 7

    • adapter now available at npm

0.4.2

  • (jpgorganizer) 2020-Apr-01
    • error missing SENSOR data fixed (many thanks to user dslraser and muckel at ioBroker Forum for testing)

0.4.1

  • (jpgorganizer) 2020-Mar-31
    • Dependency get's resolved now

0.4.0

  • (jpgorganizer) 2020-Mar-31
    • NOTE: with this version an additional dependency is necessary at runtime. If it does not get installed together with the installation of this adapter, please install seperately with npm install https://github.com/jpgorganizer/ioBroker.utils or npm i @jpgorganizer/utils
    • NOTE: you must delete all states of the adapter instance to install this release and please check your application carefully for necessary adjustments regarding type/role changes (see below)
    • data types of (nearly) all data points adjusted for compliance with ioBroker guidance:
      • states now have special ioBroker type and role instead of former string/text where applicable, e.g. number/value.battery for batteryLevel_value, see Issue 3
    • data point activity_value_i replaced by activity_mowing_i with type/role boolean/indicator.working: true means mowing, false means not mowing
    • possibility to pre-define states integrated, see new switch PreDefine States in adapter/instance configuration, see Issue 2
    • states are readonly now; except states for commands, see Issue 4
    • input field for useTestVariable in adapter/instance configuration switched to a checkbox (former: text); please check your settings
    • error in command stop_all_valves_i in VALVE_SET fixed

0.3.0

  • (jpgorganizer) 2020-Mar-25
    • create all states read/write
    • error TypeError: Cannot read property 'val' of null with useTestVariable fixed

0.2.0

  • (jpgorganizer) 2020-Mar-24
    • IMPORTANT : data point for MOWER control (command) changed from
      duration_value to activity_control_i
    • rework leftovertimer
    • improved error handling
    • improved logging (see loglevel in adapter configurations)

0.0.1

  • (jpgorganizer) 2020-Mar-01
    • initial release

Credits

Many thanks to GARDENA/Husqvarna for providing this public API and special thanks to your support team for providing very good and very fast support.

smartgarden logo: http://www.freepik.com Designed by Freepik

License

Copyright (c) 2020 - 2023 jpgorganizer, https://github.com/jpgorganizer

smartgarden by jpgorganizer is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License (CC-BY-NC-SA-4.0) Based on a work at https://github.com/jpgorganizer/ioBroker.smartgarden.

iobroker.smartgarden's People

Contributors

apollon77 avatar jpgorganizer avatar

Stargazers

 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

iobroker.smartgarden's Issues

API nach 2-3 Tage ungültig

Hallo jpgorganizer,

toller Adapter. Dankeschön dafür.

Leider habe ich seit Anfang an Probleme mit der Verbindung. Die generierte API funktioniert nur für 2-3 Tage, danach findet keine Kommunikation mehr statt. Der Adapter geht auf gelb. Generiere ich nun eine eine API mit der gleichen Konfiguration, funktioniert es wieder. Das Problem wiederholt sich im beschriebenen.

Freue mich auf Hilfe.

Mein Log im Anhang.
iobroker.2020-08-25.webarchive.zip

Vielen Dank im Voraus.

Grüße,
Stefan

State für Error-Code anlegen

Der State lastErrorCode_value existiert scheinbar nur, wenn er das erste Mal von der API gesendet wurde. Vielleicht kannst du den vorab schon anlegen, damit er von anderen Skripten "subscribed" werden kann, auch wenn noch kein Fehler aufgetreten ist.
Ggf. trifft das auch für andere States zu, das kann ich aber mangels genauer Kenntnis der Api nicht sagen.

GET_LOCATIONS

Hello,

i have checked using the API on API-Website and it works well with my application key.

I installed the adapter and entered my mail-address, ma password and the application key and set log level to highest.
I have an Water Control running.
When i start the instance i unfortunately get no data, see log.

Do you have any idea, why this /LOCATIONS does not work in the adapter?

Thank you in advance,
Peter

Log ioBroker when starting instance:

smartgarden.0 2020-07-16 09:32:23.317 info (17014) 3/ ---> State change by device
smartgarden.0 2020-07-16 09:32:23.317 info (17014) 3/ state smartgarden.0.info.connection changed: false (ack = true)
smartgarden.0 2020-07-16 09:32:23.315 error (17014) Error: getlocations: no data
smartgarden.0 2020-07-16 09:32:23.119 info (17014) 3/ ---> State change by device
smartgarden.0 2020-07-16 09:32:23.119 info (17014) 3/ state smartgarden.0.info.connection changed: true (ack = true)
smartgarden.0 2020-07-16 09:32:23.118 info (17014) 3/ ---> State change by device
smartgarden.0 2020-07-16 09:32:23.118 info (17014) 3/ state smartgarden.0.info.connection changed: true (ack = true)
smartgarden.0 2020-07-16 09:32:23.113 info (17014) 3/ get_locations ...
smartgarden.0 2020-07-16 09:32:23.113 info (17014) 3/ connected ... auth_data=eyJhXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
smartgarden.0 2020-07-16 09:32:23.112 info (17014) 3/ sgSetState: info.connection value=true ack=true
smartgarden.0 2020-07-16 09:32:23.112 info (17014) 3/ Connection: successful: response.statusCode / statusMessage=200 / OK
smartgarden.0 2020-07-16 09:32:22.817 info (17014) 3/ ---> Command should be sent to device
smartgarden.0 2020-07-16 09:32:22.817 info (17014) 3/ state smartgarden.0.testVariable changed: true (ack = false)
smartgarden.0 2020-07-16 09:32:22.817 info (17014) 3/ ---> State change by device
smartgarden.0 2020-07-16 09:32:22.817 info (17014) 3/ state smartgarden.0.info.revision changed: Main: 2160 / API: 2167 (ack = true)
smartgarden.0 2020-07-16 09:32:22.817 info (17014) 3/ ---> State change by device
smartgarden.0 2020-07-16 09:32:22.817 info (17014) 3/ state smartgarden.0.info.connection changed: false (ack = true)
smartgarden.0 2020-07-16 09:32:22.789 info (17014) 3/ Gardena Smart System Service hosts at: smart_host: https://api.smart.gardena.dev authentication_host: https://api.authentication.husqvarnagroup.dev
smartgarden.0 2020-07-16 09:32:22.788 info (17014) 3/ sgSetState: info.revision value=Main: 2160 / API: 2167 ack=true
smartgarden.0 2020-07-16 09:32:22.773 info (17014) starting. Version 1.0.0 in /opt/iobroker/node_modules/iobroker.smartgarden, node: v10.21.0, js-controller: 3.1.4
smartgarden.0 2020-07-16 09:32:20.438 info (15390) Terminated (ADAPTER_REQUESTED_TERMINATION): Without reason
smartgarden.0 2020-07-16 09:32:20.438 info (15390) terminating
smartgarden.0 2020-07-16 09:32:20.438 info (15390) 3/ cleaned everything up...
smartgarden.0 2020-07-16 09:32:20.437 info (15390) Got terminate signal TERMINATE_YOURSELF

Verbindungsprobleme

Seit ein paar Tagen hat der Adapter Verbindungsprobleme. Ca. einmal am Tag ist bei "Verbunden mit Gerät oder Dienst" ein rotes Kreuz. Nach dem Reboot des Adapter funktioniert er wieder für einen Tag. Kann das mit der Änderung der API zusammenhängen die Husqvarna vor ein paar Tagen vorgenommen hat?
Ich hab den Log Level mal auf 3 gesetzt. Sobald ich da was im LOG hab melde ich mich.

Adapter v1.0.5

2021-08-24 13:29:22.032  - �[32minfo�[39m: smartgarden.0 (17259) State value to set for "smartgarden.0.LOCATION_***.DEVICE_***.SERVICE_MOWER_***.activity_mowingTime_remain_i" has to be type "number" but received type "string" 
2021-08-24 13:44:12.737  - �[32minfo�[39m: smartgarden.0 (18772) State value to set for "smartgarden.0.LOCATION_***.DEVICE_***.SERVICE_COMMON_***.batteryState_chargingTime_remain_i" has to be type "number" but received type "string" 

No reaction on changing activity_control_i

Hi,

thanks for the greate adapter! I just switched from openHAB to ioBroker and I cannot get any reaction if I change the activity_control_i state. (With openHAB this was working so I know API key etc. are correct.)

It does not matter if i put a number or one of the defined commands from the readme into the state - no reaction from the mower. Log shows, that the state change was received successfully.

If I start/stop the mower from the Gardena app, I can see that activity_mowing_i and the other status states are changing within seconds.

So the adapter works in general for me but only for the status states and not for activity_control_i

Adapter version is 1.0.4

Stop schedule of valve(s)

Hi,

I'm wonderung how to stop the schedule.

In documentation I've found:
"

For SERVICE_VALVE

Controlling

To control the device use data point

  • duration_value

    Change this data point to start the valve.

    • To start for a defined time set the value to the value in seconds (please use multiples of 60).

      Note: There are some limitations for the allowed values. Please report if you see other limitations.

      device limit
      GARDENA smart Irrigation Control 5400 seconds (90 minutes)
      GARDENA smart Pump 36000 (10 hours)
      GARDENA smart Water Control 36000 (10 hours)
    • To cancel the current watering and continue with the schedule use string STOP_UNTIL_NEXT_TASK

    • To skip automatic operation until specified time, the currently active operation might or might not be cancelled (depends on device model) use string PAUSE_<number_of_seconds>, e.g. PAUSE_86400 to pause for 24 hours (please use multiples of 60)

    • To restore automatic operation if it was paused use string UNPAUSE

So if I'd like to pause the schedule for let's say two days I'm supposed to add "PAUSE_172800" in "duration_value"?
This means this object "duration_value" is a string where I can put seconds & complete commands???

Second question: What to do to pause until further action? If I'm getting the documentation right the "Pause" command always should be used with seconds?

Anzeige von Kollisionen und anderen Datenpunkten

Hallo,

super Arbeit, funktioniert einwandfrei. Bei dem alten Adapter, den ich genutz habe, wurde die Anzahl der Kollisionen des Mähers angezeigt ("collisions"). Könnte das von diesem Adapter auch als Datenpunkt geliefert werden?

Auch einige andere Datenpunkte würde ich mir wieder wünschen (weil meine Visualisierung darauf aufbaut):

  • Status des Empfangs (z.B. "good")

Viele Grüße und Danke
Stefan

wrong api key

After a few weeks I have to generate a new gardena api key, else the old one is wrong

LOG Error: request returned 403 Forbidden

I have requested API key, and entered my username (email adress) and password to adapter, but I have Error: request returned 403 Forbidden in my log and Can't connect to device or service. Can you please explain what is the issue? I changed auth url to https://api.authentication.husqvarnagroup.dev/v1 and base url to https://api.smart.gardena.dev/v1 . Password is correct. i have no Secret key field as in your documentation, just user and password fields. Thank you!

Restart nach Verbindungsabbruch

Nach einem Abbruch der Internetverbindung und Wiederherstellung sollte automatisch die Verbindung zu Gardena wieder hergestellt werden.

Speicherung historischer Daten für Ventile nicht möglich

Aus mir unerfindlichen Gründen ist es nicht möglich mit dem SQL-Adapter historische Daten für Ventile zu speichern. Egal welchen Datenpunkt ich unter einem der Ventile auswähle, ich kann dort nicht das Speichern in SQL aktivieren.
Eine Fehlermeldung ist mir nicht aufgefallen.

keine Bewässerung wenn gemäht wird

Es sollte verhindert werden, dass die Bewässerung läuft, solange der Mäher mäht.

Sinnvoll weil der Mäher ggfs. gegen Versenkregner fährt und dabei Schäden am Regner wie auch am Mäher entstehen können.

Der Mäher hat Vorrang vor der Bewässerung, da er auch am Mäher selbst gestartet werden kann. Eine evtl. laufende Bewässerung wird dann abgebrochen.

Konfiguration pro Ventil erforderlich, da es Regnerkreise geben kann, die vom Mäher nicht beeinträchtigt sind.

Compatibility check and testing for Node.js 14 and 16

Dear Adapter develop,

Node.js 14 is now available for a year and Node.js 16 was release just some days ago and will become LTS by October 2021. We plan to update the ioBroker Node.js recommendation (currently 12.x) to 14.x later this year.

Please check your adapter with Node.js 14 especially, and ideally also directly with Node.js 16

Please add both versions to the adapter testing which is executed on commits.

If your adapter requires a certain minimum version of Node.js please set the 'engine' setting in package.json accordingly! Please also do this if the adapter is not able to work in certain Node.js versions, so that ioBroker can prevent users from installing te adapter if not compatible!

On questions please talk to us at ioBroker/ioBroker.js-controller#1138

Please close the issue after you checked it.

Thank you very much for your support!

Gardena Apps time schedules doesn´t update data points of power socket

gardena power socket
The data points state_timestamp and activity_timestamp are not getting updated when my power sockets (19095-20) are switched by the time schedule funktion of my gardena app (version 3.4.1)
this leads to wrong activity_value
Only if I turn the device off or on manually without (time schedules) they´re getting updated.

Could you please check?

Question - SERVICE_SENSOR controlling options

Although the documentation states that there are no controlling options for SERVICE_SENSOR, would it be possible to trigger an update for the values?

The values, espescially for soil humidity, are only update every now and then. Under certain circumstances, it would be good to manually initate an update to make sure, that the values aren't out of date.

Since this is possible from within the smartphone app, I guess the Gardena API is supporting it as well.

Zeitplan in Adapter übernehmen

hallo ist es möglich den Zeitplan den man per Gardena Smart App einstellt mit in den Objekten anzeigen zu lassen? dann könnte man per VIS einen eigenen Zeitplan erstellen. habe gesehen das es beim Worx Adapter möglich is.

Error Mesage since Update JS-Controller to 3.1.4

Hi, i Updated my JS-Controller to 3.1.4, since then i got the following Error Mesage:
startInstance system.adapter.smartgarden.0: required adapter "@jpgorganizer/utils" not found!

after that i tried to uninstall it, and manually install the jporganizer...
npm install https://github.com/jpgorganizer/ioBroker.utils
but i get Warnings and nothing works...

npm WARN saveError ENOENT: no such file or directory, open '/home/pi/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/home/pi/package.json'
npm WARN pi No description
npm WARN pi No repository field.
npm WARN pi No README data
npm WARN pi No license field.

then i tried to install the newst smartgarden again... (0.6.0

But i got the same Warn-Messages...
npm WARN saveError ENOENT: no such file or directory, open '/home/pi/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/home/pi/package.json'
npm WARN pi No description
npm WARN pi No repository field.
npm WARN pi No README data
npm WARN pi No license field.

please help me... before it workd like charm...

The adapter is yellow

Hello,
Since 1 or 2 days the adapter is yellow. If I restart it I get the massage "(32233) Error: request returned 401 Unauthorized "

Regards
Hartmut

Get Location error

Since three days I get the following error in ioBroker.

(18138) Error: getlocations: no data

I didn’t change anything and it was stable for months now.

error 403

Hallo,
bei mir kommt immer error 403. jemand eine Idee das das sein kann?
DANKE
Bildschirmfoto 2020-05-29 um 09 50 09

Mäher Manuell los schicken

moin moin,
erstmal super arbeit, was den adapter angeht!

gibt es eine möglichkeit, den datenpunkt activity_control_i mit einem befehl zu beschreiben das der Mäher sofort losfährt bzw. zurück fährt ohne das er auf den zeitplan von gardena achtet

Werte Aktualisieren von Sensoren

Hallo zusammen,

eine Frage ... gibt es die Möglichkeit das man ein Update der Sensorwerte Triggern kann ?
ich habe bislang einen veralteten Adapter (Gardena Smart System) genutzt und da ging so etwas..
Würde ihn aber gern einstellen und Komplett auf diesen hier umsteigen da er aktueller ist ;)

Vielen Dank schonmal.

Service SERVICE_VALVE - PAUSE Command

Zum steuern der Ventile wird der Wert in "duration_value" gesetzt. Laut Beschreibung kann mit "PAUSE" der Zeitplan für eine bestimmte Zeit ausgesetzt werden (z.B. Regen etc.)

"to skip automatic operation until specified time, the currently active operation might or might not be cancelled (depends on device model) use string PAUSE"

Der String "PAUSE" alleine reicht hier aber nicht und hat keine Auswirkung. Irgendwo müsste noch die Dauer der Pause spezifiziert werden? Das ist aktuell nicht möglich?
VALVE

Question - SmartSensor

First of all: Thank you for this adapter. So handy and usefull and even a nice documentation! Well done.

I plan to buy the new SmartSensor to make my sprinkler system even more smart.

I read in #15 the values are pushed in random intervals by the sensor. For my implentation this should be no problem. It depends on the interval range. So the question:

How many value updates the sensor sends to the adapter per day (mean)?

Compatibility check to js-controller 3.3 and Admin5 React UI

Dear Adapter developer,

with js-controller 3.2 and js-controller 3.3 some additional checks were added to make sure that created objects match to the specifications and also written state values match to the object definition.

If something is not correct this is logged as 'warning' or 'info' log.

Please take the time to verify your adapter by ideally starting with a fresh instance and do some actions and verify the log. If you see a warn log there from these checks please adjust the adapter and fix the relevant cases.

For questions please refer to ioBroker/ioBroker.js-controller#1301

Additionally we are preparing Admin 5 which will have a completely rewritten UI. Please install Admin 5, activate that new UI and verify that the configuration of you adapter works as expected also there.

More informations on Admin 5 can be found in Forum https://forum.iobroker.net/topic/44282/test-adapter-admin-5-0-x-alpha-der-neuen-ui

Please close the issue after you checked it.

Thank you very much for your support!

Json Probleme

Seit gestern meldet der smartgarden-Adapter den foglenden Fehler:

smartgarden.0 2020-10-24 11:37:26.211 error at endReadableNT (_stream_readable.js:1145:12)
smartgarden.0 2020-10-24 11:37:26.211 error at IncomingMessage.emit (events.js:203:15)
smartgarden.0 2020-10-24 11:37:26.211 error at Object.onceWrapper (events.js:286:20)
smartgarden.0 2020-10-24 11:37:26.211 error at IncomingMessage. (/opt/iobroker/node_modules/request/request.js:1076:12)
smartgarden.0 2020-10-24 11:37:26.211 error at Request.emit (events.js:198:13)
smartgarden.0 2020-10-24 11:37:26.211 error at Request. (/opt/iobroker/node_modules/request/request.js:1154:10)
smartgarden.0 2020-10-24 11:37:26.211 error at Request.emit (events.js:198:13)
smartgarden.0 2020-10-24 11:37:26.211 error at Request.self.callback (/opt/iobroker/node_modules/request/request.js:185:22)
smartgarden.0 2020-10-24 11:37:26.211 error at Request._callback (/opt/iobroker/node_modules/iobroker.smartgarden/lib/api.js:2830:29)
smartgarden.0 2020-10-24 11:37:26.211 error at JSON.parse ()
smartgarden.0 2020-10-24 11:37:26.211 error (3901) SyntaxError: Unexpected end of JSON input
smartgarden.0 2020-10-24 11:37:26.209 error (3901) uncaught exception: Unexpected end of JSON input
Den API-Key habe ich heute verifiziert.
DIe Ampel für den Adapter steht auf rot.

Was ist zu tun?

Verbindung zu Gardena aber Unexpected end of JSON input at JSON.parse

Neuerdings geht der Adapter leider auf gelb bzw. rot. Ich habe den Adapter mal gelöshct und wieder installiert. Zusätzlich die Optionen auf der 3. Adapter-Seite angehakt... Reboot war auch erfolglos.
Doe Verbindung zu Gardena steht/ ist vorhanden aber folgende Fehler tauchen im Log auf:

`

host.ioBroker 2020-10-25 18:43:15.700 info Restart adapter system.adapter.smartgarden.0 because enabled
host.ioBroker 2020-10-25 18:43:15.699 info instance system.adapter.smartgarden.0 terminated with code 0 (NO_ERROR)
smartgarden.0 2020-10-25 18:43:15.180 info (27806) Terminated (NO_ERROR): Without reason
smartgarden.0 2020-10-25 18:43:15.180 info (27806) terminating
smartgarden.0 2020-10-25 18:43:15.133 info (27806) 3/ cleaned everything up...
smartgarden.0 2020-10-25 18:43:15.132 error (27806) SyntaxError: Unexpected end of JSON input at JSON.parse () at Request._callback (/opt/iobroker/node_modules/iobroker.smartgarden/lib/api.js:2830:29) at Request.self.call
smartgarden.0 2020-10-25 18:43:15.130 error (27806) uncaught exception: Unexpected end of JSON input
smartgarden.0 2020-10-25 18:43:14.788 info (27806) 3/ ---> State change by device
smartgarden.0 2020-10-25 18:43:14.787 info (27806) 3/ state smartgarden.0.info.RateLimitCounter changed: {"2020":{"2020-10":{"count":4,"2020-10-25":{"17":{"count":4},"count":4}}},"last30days":{"count":4},"last31days":{"count":4}} (ack = true)
smartgarden.0 2020-10-25 18:43:14.785 info (27806) 3/ ---> State change by device
smartgarden.0 2020-10-25 18:43:14.785 info (27806) 3/ state smartgarden.0.info.connection changed: true (ack = true)
smartgarden.0 2020-10-25 18:43:14.784 info (27806) 3/ ---> State change by device
smartgarden.0 2020-10-25 18:43:14.784 info (27806) 3/ state smartgarden.0.info.connection changed: true (ack = true)
smartgarden.0 2020-10-25 18:43:14.768 info (27806) 3/ incrementLimitCounter: new counters : y2020 / m2020-10: 4 / d2020-10-25: 4 / hr17: 4 / last30days: 4 / last31days: 4
smartgarden.0 2020-10-25 18:43:14.767 info (27806) 3/ get_locations ...
smartgarden.0 2020-10-25 18:43:14.766 info (27806) 3/ connected ... auth_data=eyJhXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
smartgarden.0 2020-10-25 18:43:14.765 info (27806) 3/ sgSetState: info.connection value=true ack=true
smartgarden.0 2020-10-25 18:43:14.764 info (27806) 3/ Connection: successful: response.statusCode / statusMessage=200 / OK
smartgarden.0 2020-10-25 18:43:14.290 info (27806) 3/ ---> State change by device
smartgarden.0 2020-10-25 18:43:14.289 info (27806) 3/ state smartgarden.0.info.RateLimitCounter changed: {"2020":{"2020-10":{"count":3,"2020-10-25":{"17":{"count":3},"count":3}}},"last30days":{"count":3},"last31days":{"count":3}} (ack = true)
smartgarden.0 2020-10-25 18:43:14.283 info (27806) 3/ ---> Command should be sent to device
smartgarden.0 2020-10-25 18:43:14.282 info (27806) 3/ state smartgarden.0.testVariable changed: true (ack = false)
smartgarden.0 2020-10-25 18:43:14.282 info (27806) 3/ ---> State change by device
smartgarden.0 2020-10-25 18:43:14.281 info (27806) 3/ state smartgarden.0.info.revision changed: Main: 2160 / API: 2250 (ack = true)
smartgarden.0 2020-10-25 18:43:14.280 info (27806) 3/ ---> State change by device
smartgarden.0 2020-10-25 18:43:14.280 info (27806) 3/ state smartgarden.0.info.connection changed: false (ack = true)
smartgarden.0 2020-10-25 18:43:14.270 info (27806) 3/ incrementLimitCounter: new counters : y2020 / m2020-10: 3 / d2020-10-25: 3 / hr17: 3 / last30days: 3 / last31days: 3
smartgarden.0 2020-10-25 18:43:14.218 info (27806) 3/ Gardena Smart System Service hosts at: smart_host: https://api.smart.gardena.dev authentication_host: https://api.authentication.husqvarnagroup.dev
smartgarden.0 2020-10-25 18:43:14.215 info (27806) 3/ sgSetState: info.revision value=Main: 2160 / API: 2250 ack=true
smartgarden.0 2020-10-25 18:43:14.179 info (27806) starting. Version 1.0.2 in /opt/iobroker/node_modules/iobroker.smartgarden, node: v12.19.0, js-controller: 3.1.6
host.ioBroker 2020-10-25 18:43:12.556 info instance system.adapter.smartgarden.0 started with pid 27806
smartgarden.0 2020-10-25 18:32:33.965 info (15834) Terminated (NO_ERROR): Without reason
smartgarden.0 2020-10-25 18:32:33.964 info (15834) terminating
smartgarden.0 2020-10-25 18:32:33.919 error (15834) SyntaxError: Unexpected end of JSON input at JSON.parse () at Request._callback (/opt/iobroker/node_modules/iobroker.smartgarden/lib/api.js:2830:29) at Request.self.call
smartgarden.0 2020-10-25 18:32:33.917 error (15834) uncaught exception: Unexpected end of JSON input
smartgarden.0 2020-10-25 18:32:01.331 info (15243) Terminated (NO_ERROR): Without reason
smartgarden.0 2020-10-25 18:32:01.329 info (15243) terminating
smartgarden.0 2020-10-25 18:32:01.284 error at endReadableNT (_stream_readable.js:1223:12)
smartgarden.0 2020-10-25 18:32:01.284 error at IncomingMessage.emit (events.js:326:22)
smartgarden.0 2020-10-25 18:32:01.284 error at Object.onceWrapper (events.js:420:28)
smartgarden.0 2020-10-25 18:32:01.284 error at IncomingMessage. (/opt/iobroker/node_modules/request/request.js:1076:12)
smartgarden.0 2020-10-25 18:32:01.284 error at Request.emit (events.js:314:20)
smartgarden.0 2020-10-25 18:32:01.284 error at Request. (/opt/iobroker/node_modules/request/request.js:1154:10)
smartgarden.0 2020-10-25 18:32:01.284 error at Request.emit (events.js:314:20)
smartgarden.0 2020-10-25 18:32:01.284 error at Request.self.callback (/opt/iobroker/node_modules/request/request.js:185:22)
smartgarden.0 2020-10-25 18:32:01.284 error at Request._callback (/opt/iobroker/node_modules/iobroker.smartgarden/lib/api.js:2830:29)
smartgarden.0 2020-10-25 18:32:01.284 error at JSON.parse ()
smartgarden.0 2020-10-25 18:32:01.284 error (15243) SyntaxError: Unexpected end of JSON input
smartgarden.0 2020-10-25 18:32:01.280 error (15243) uncaught exception: Unexpected end of JSON input
smartgarden.0 2020-10-25 18:32:00.718 info (15243) starting. Version 1.0.2 in /opt/iobroker/node_modules/iobroker.smartgarden, node: v12.19.0, js-controller: 3.1.6

`

get location

The adapter is not able to start. i get always an error
"Error: getlocations: no data"

Adapter loses connection to service/device

The adapter basically works as desigend. But after a few hours of being connected it losses the connection to the service/device and traffic light turns yellow. Only a restart of the adapter will fix this issue. The debug log does not show any entries why loosing connection.

My configuration is as follows
Adapter version 1.0.5
JS-Controller: 4.0.23
NPM: 6.14.16

I already tried to set up a new instance with a new API. But the result was the same.
Does anybody has a clue?

No connection to Gardena Cloud

Since a few days (4 or 5) the adapter is not able to connect to the Garden cloud giving the following error in the log:
(37362) Error: request returned 403 Forbidden

Does anybody has the same behaviour and know how to solve?

Objekte mit passendem Typ und Rolle anlegen

Aktuell sind alle Objekte vom Typ "State" und haben den Datentyp "String" mit Rolle "Text".

Dies sollte geändert werden, sodass die Objekte dem Datenschema von ioBroker folgen.

Beispiele: rfLinkLevel_value hätte den Datentyp "number" und die Rolle "value". rfLinkLevel_timestamp hätte den Datentyp "number" und die Rolle "date" (Unix Timestamp).

Siehe hier: https://github.com/ioBroker/ioBroker.docs/blob/master/docs/en/dev/stateroles.md
und hier: https://github.com/ioBroker/ioBroker.docs/blob/master/docs/en/dev/objectsschema.md

Zudem sollen nur echte "States" den Objekttyp "state" haben. DEVICE sollte den Objekttyp "device" haben, es darf aber kein Stateinhalt gesetzt werden (aktuell "DEVICE").
Die Punkte SERVICE_COMMON / SERVICE_XXXX sollten vom Objekttyp "channel" sein und ebenfalls keine Werte im State haben.

Der Datenpunkt activity_value_i hat den Wert "MOWING" oder "NOT_MOWING". In meinen Augen wäre hier ein State vom Typ boolean mit der Rolle indicator besser. Das könnte man dann auch in der Visualisierung gut verwenden.

WARN: batteryLevel_value has been written without ack-flag

2021-09-17 19:40:04.071 - �[33mwarn�[39m: socketio.0 (15241) Read-only state "smartgarden.0.LOCATION_XXX.DEVICE_XXX.SERVICE_COMMON_XXX.batteryLevel_value" has been written without ack-flag with value "9"

It's a smart water control.

Error: request returned 404 Not Found

Hi, after installing the Adapter in version 2.0.0 from Github or Installing the current version from ioBroker i get this error message

smartgarden.0 15054 2022-06-16 16:05:02.891 info 3/ ---> State change by device: state sg.0.info.connection changed: false (ack = true)
smartgarden.0 15054 2022-06-16 16:05:02.886 info 3/ ---> State change by device: state sg.0.info.connection changed: false (ack = true)
smartgarden.0 15054 2022-06-16 16:05:02.867 info 3/ getConnection: trying to connect again in 300 seconds
smartgarden.0 15054 2022-06-16 16:05:02.866 info 3/ getConnection: returned connection error: request returned 404 Not Found
smartgarden.0 15054 2022-06-16 16:05:02.865 info 3/ sgSetState: info.connection value=false ack=true
smartgarden.0 15054 2022-06-16 16:05:02.863 error Error: request returned 404 Not Found
smartgarden.0 15054 2022-06-16 16:05:02.862 info 3/ get_locations failure:..return with error
smartgarden.0 15054 2022-06-16 16:05:02.860 info 3/ get_locations failure: response.statusCode/Message=404/Not Found
smartgarden.0 15054 2022-06-16 16:05:02.858 info 3/ sgSetState: info.connection value=false ack=true
smartgarden.0 15054 2022-06-16 16:04:57.597 info 3/ get_locations ...
smartgarden.0 15054 2022-06-16 16:04:57.595 info 3/ connected ... auth_data=eyJhXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX-XXX
smartgarden.0 15054 2022-06-16 16:04:57.593 info 3/ Connection: expires_in/timeout/factor:86399 / 86313 / 0.999
smartgarden.0 15054 2022-06-16 16:04:57.591 info 3/ Connection: successful: response.statusCode / statusMessage=200 / OK
smartgarden.0 15054 2022-06-16 16:04:51.376 info 3/ ---> State change by device: state sg.0.info.adapterversion changed: 2.0.0 (ack = true)
smartgarden.0 15054 2022-06-16 16:04:51.373 info 3/ ---> State change by device: state sg.0.info.revision changed: Main: 2831 / API: 2831 (ack = true)
smartgarden.0 15054 2022-06-16 16:04:51.368 info 3/ ---> State change by device: state sg.0.info.connection changed: false (ack = true)
smartgarden.0 15054 2022-06-16 16:04:51.364 info 3/ ---> State change by device: state sg.0.info.connection changed: false (ack = true)
smartgarden.0 15054 2022-06-16 16:04:51.353 info 3/ sgSetState: info.revision value=Main: 2831 / API: 2831 ack=true
smartgarden.0 15054 2022-06-16 16:04:51.296 info 3/ connect ... using client credentials grant
smartgarden.0 15054 2022-06-16 16:04:51.295 info 3/ connect ... empty password
smartgarden.0 15054 2022-06-16 16:04:51.294 info 3/ connect ... empty username
smartgarden.0 15054 2022-06-16 16:04:51.294 info 3/ Gardena Smart System Service hosts at: smart_host: https://api.smart.gardena.dev authentication_host: https://api.authentication.husqvarnagroup.dev
smartgarden.0 15054 2022-06-16 16:04:51.293 info 3/ connecting to Gardena Smart System Service ...
smartgarden.0 15054 2022-06-16 16:04:51.292 info 3/ sgSetState: info.connection value=false ack=true
smartgarden.0 15054 2022-06-16 16:04:51.289 info 3/ connectToGardena...
smartgarden.0 15054 2022-06-16 16:04:51.288 info 3/ getConnection...
smartgarden.0 15054 2022-06-16 16:04:51.234 info starting. Version 2.0.0 in /opt/iobroker/node_modules/iobroker.smartgarden, node: v14.19.3, js-controller: 4.0.23
host.raspberrypi   2022-06-16 16:04:49.683 info instance system.adapter.smartgarden.0 started with pid 15054
host.raspberrypi   2022-06-16 16:04:49.600 info "system.adapter.smartgarden.0" enabled

My Instance Settings
image

My Husqvarna Setting
image

I reinstalled the Adapter a couple times, and i also created a new Application in the API.

Can someone help me?

Thanks
Torsten

API V1

With the basic setting:
https://api.authentication.husqvarnagroup.dev and https://api.smart.gardena.dev
I get the error message:
smartgarden.0 2022-03-10 20:31:39.815 error Error: request returned 401 Unauthorized

I change the setting as shown in my Gardenaaccount to:
https://api.authentication.husqvarnagroup.dev/v1 and https://api.smart.gardena.dev/v1
I get the error message:
smartgarden.0 2022-03-10 20:37:53.689 error Error: request returned 403 Forbidden

So it no longer works with both variants. Am I doing something wrong? It used to work (last summer) but now I've noticed that it doesn't work anymore.

ERR! syscall accessnpm ERR! path /opt/iobroker/node_modules/canvasnpm ERR! errno -40

Hallo,

wollte gerade auf die neue Version Updaten, nun bekomme ich diesen Fehler:

$ ./iobroker upgrade smartgarden
Update smartgarden from @1.0.4 to @1.0.5
NPM version: 6.14.12
npm install [email protected] --loglevel error --prefix "/opt/iobroker" (System call)
npm ERR! code ELOOP
npm ERR! syscall accessnpm ERR! path /opt/iobroker/node_modules/canvasnpm ERR! errno -40
npm ERR! ELOOP: too many symbolic links encountered, access '/opt/iobroker/node_modules/canvas'
npm ERR! A complete log of this run can be found in:npm ERR! /home/iobroker/.npm/_logs/2021-05-21T09_44_04_995Z-debug.log
ERROR: host.iobroker-master Cannot install [email protected]: 216
ERROR: process exited with code 25

2021-05-21T09_44_04_995Z-debug.log:

58 silly saveTree ├── [email protected]
58 silly saveTree └── [email protected]
59 warn @date-io/[email protected] requires a peer of date-fns@^2.0.0 but none is installed. You must install peer dependencies yourself.
60 warn @material-ui/[email protected] requires a peer of @material-ui/core@^4.0.0 but none is installed. You must install peer dependencies yourself.
61 warn @material-ui/[email protected] requires a peer of react@^16.8.0 || ^17.0.0 but none is installed. You must install peer dependencies yourself.
62 warn @material-ui/[email protected] requires a peer of react-dom@^16.8.0 || ^17.0.0 but none is installed. You must install peer dependencies yours$
63 warn [email protected] requires a peer of react@>=16.6.0 but none is installed. You must install peer dependencies yourself.
64 warn [email protected] requires a peer of react-dom@>=16.6.0 but none is installed. You must install peer dependencies yourself.
65 warn [email protected] requires a peer of react@>=16.8 but none is installed. You must install peer dependencies yourself.
66 verbose stack Error: ELOOP: too many symbolic links encountered, access '/opt/iobroker/node_modules/canvas'
67 verbose cwd /opt/iobroker
68 verbose Linux 4.19.0-14-amd64
69 verbose argv "/usr/bin/node" "/usr/bin/npm" "install" "[email protected]" "--loglevel" "error" "--prefix" "/opt/iobroker"
70 verbose node v12.22.1
71 verbose npm v6.14.12
72 error code ELOOP
73 error syscall access
74 error path /opt/iobroker/node_modules/canvas
75 error errno -40
76 error ELOOP: too many symbolic links encountered, access '/opt/iobroker/node_modules/canvas'
77 verbose exit [ -40, true ]

Kann mir jemand einen Tipp geben was ich machen muss? :-)
Gruß
Tom

Think about to fix the issues found by adapter checker

I am an automatic service that looks for possible errors in ioBroker and creates an issue for it. The link below leads directly to the test:

https://adapter-check.iobroker.in/?q=https://raw.githubusercontent.com/jpgorganizer/ioBroker.smartgarden

  • [E605] No actual year found in copyright. Please add "Copyright (c) 2022 jpgorganizer" at the end of README.md

Thanks,
your automatic adapter checker.

P.S.: There is a community in Github, which supports the maintenance and further development of adapters. There you will find many experienced developers who are always ready to assist anyone. New developers are always welcome there. For more informations visit: https://github.com/iobroker-community-adapters/info

Compatibility check to js-controller 4.0

Dear Adapter developer,

with js-controller 4.0 object definitions are now also checked that min/max in only provided for number/mixed objects and that the type of the default value matches to the object type.

If something is not correct this is logged as 'warning' or 'info' log.

Please also make sure to update to the lastest @iobroker/testing dependency 2.5.4 or to accept the PR from Apollon77 for legacy testing!

Please spent some time to verify your adapter by ideally starting with a fresh instance and do some actions and verify the log. If you see a warn or info log there from these checks please adjust the adapter and fix the relevant cases.

For questions please refer to ioBroker/ioBroker.js-controller#1749

Please close the issue after you checked it.

Thank you very much for your support to get the best experience for the growing numbers of ioBroker users!

3027) Error: request returned 429

Hallo zusammen, ich muss ca 2 mal im Monat den API Code auf der Gardena Webseite neu erstellen lassen und dann im Adapter eintragen, damit es wieder geht, ansonsten kommt der obige Fehler.

Mit freundlichen Grüßen
Alexander

Manuelles Mähen startet Zeitplan

An dieser Stelle erstmal vielen Dank für den Adapter

Mir ist ein Problem aufgefallen:

Hat man den Zeitplan deaktiviert und startet den Mäher manuell per setzen von activity_control_i wird der Zeitplan aktiviert. Das passiert allerdings nur, wenn man den manuellen Start in einem Zeitfenster aktiviert, zu dem es einen Zeitplan gibt. Startet man den Mäher manuell außerhalb dieses Zeitfensters, bleibt auch der Zeitplan deaktiviert.

Führt man einen manuellen Start über die App aus, bleibt der Zeitplan immer deaktiviert.

Ist das ein Fehler auf meiner Seite, im Adapter oder in der API?

400 Bad Request

Hallo,

leider funktioniert seit ungefähr zwei Wochen die Verbindung nicht mehr:

smartgarden.0 2022-05-09 15:15:03.531 info 1/ getConnection: trying to connect again in 300 seconds
smartgarden.0 2022-05-09 15:15:03.531 info 1/ getConnection: returned connection error: request returned 400 Bad Request
smartgarden.0 2022-05-09 15:15:03.530 error Error: request returned 400 Bad Request
smartgarden.0 2022-05-09 15:15:03.523 info 1/ Connection failure:..return with error
smartgarden.0 2022-05-09 15:15:03.521 info 1/ Connection failure.response.statusCode/Message=400/Bad Request
smartgarden.0 2022-05-09 15:15:02.213 info 1/ Gardena Smart System Service hosts at: smart_host: https://api.smart.gardena.dev authentication_host: https://api.authentication.husqvarnagroup.dev
smartgarden.0 2022-05-09 15:15:02.213 info 1/ connecting to Gardena Smart System Service ...
smartgarden.0 2022-05-09 15:15:02.210 info 1/ connectToGardena...
smartgarden.0 2022-05-09 15:15:02.209 info 1/ getConnection...
smartgarden.0 2022-05-09 15:15:01.987 info starting. Version 1.0.5 in /opt/iobroker/node_modules/iobroker.smartgarden, node: v14.19.1, js-controller: 4.0.23

Kann mir jemand einen Tipp geben?

Danke :-)

403 Forbidden - Adapter funktioniert nicht mehr seit 09.06.2022

403 Forbidden - Adapter funktioniert nicht mehr seit 09.06.2022

Habe mich eben mal eingeloggt auf: https://developer.husqvarnagroup.cloud/ und meine Applications waren einfach nicht mehr vorhanden !!

Habe dann eine neue angelegt und den Token kann ich per Terminal auch holen. Was mir aber aufgefallen ist, dass man sich nicht mehr per Username & Passwort authentifizieren kann sondern nur noch mittels Application UND Secret Key.

Keine Ahnung ob das neu ist und hier etwas geändert wurde. Wenn ja dann muss sicher der Adapter hier entsprechend angepasst werden.

Vorhersagen der Mähdauer und nächster Start

Voraussichtlicher nächster Start des Mähers

Das müsste ja prognostizierbar sein, indem man misst, wie schnell die Batterieladung voranschreitet, solange er auf OK_CHARGING steht. Dann könnte man die Restladedauer bis 100% schätzen. Natürlich funktioniert das nur, solange das Mähen laut Timer gerade aktiv ist und nicht in den Ruhephasen. Da liefert die API leider keinen Wert der Schedules.

Voraussichtliche Rest-Mähdauer

Das müsste auch wieder anhand der Restbatterieladung ermittelbar sein, indem man historisch misst und speichert, bei welcher Restladung der Mäher in die Station fährt und wie lange es bis zu dieser Restladung dauert.

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.