From 897a3c7aef774deb47787195ba887d76472aa8b7 Mon Sep 17 00:00:00 2001 From: Marko Oldenburg Date: Tue, 28 Nov 2023 08:52:33 +0100 Subject: [PATCH 1/9] fix: closes #90 --- FHEM/74_GardenaSmartDevice.pm | 13 +++++++------ controls_GardenaSmartDevice.txt | 4 ++-- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/FHEM/74_GardenaSmartDevice.pm b/FHEM/74_GardenaSmartDevice.pm index 68f4a7d..7cff625 100644 --- a/FHEM/74_GardenaSmartDevice.pm +++ b/FHEM/74_GardenaSmartDevice.pm @@ -72,9 +72,9 @@ use SetExtensions; # try to use JSON::MaybeXS wrapper # for chance of better performance + open code eval { - require JSON::MaybeXS; - import JSON::MaybeXS qw( decode_json encode_json ); - 1; + require JSON::MaybeXS; + import JSON::MaybeXS qw( decode_json encode_json ); + 1; } or do { # try to use JSON wrapper @@ -617,7 +617,8 @@ sub Set { # all devices has abilitie to fall a sleep $list .= ' winter_mode:awake,hibernate'; - return SetExtensions($hash, $list, $name, $cmd, @$aArg); + return SetExtensions( $hash, $list, $name, $cmd, @$aArg ); + # return "Unknown argument $cmd, choose one of $list"; } @@ -1688,7 +1689,7 @@ sub SetPredefinedStartPoints { pump. Schedules can be disabled/enabled via fhem, defining or deleting them must be done via Gardena App or its web interface.

-
+
  • parkUntilFurtherNotice - park mower and disable schedule
  • parkUntilNextTimer - park mower until next schedule
  • @@ -2154,7 +2155,7 @@ sub SetPredefinedStartPoints { Steckdosen-Adapter und Pumpe. Zeitpläne können über fhem pausiert/aktiviert werden, das Anlegen oder Löschen erfolgt derzeit nur über die App oder deren Web-Frontend. -
    +
  • parkUntilFurtherNotice - Parken des Mähers und Aussetzen des Zeitplans
  • parkUntilNextTimer - Parken bis zum nächsten Start nach Zeitplan
  • diff --git a/controls_GardenaSmartDevice.txt b/controls_GardenaSmartDevice.txt index a0a0042..a83fba6 100644 --- a/controls_GardenaSmartDevice.txt +++ b/controls_GardenaSmartDevice.txt @@ -1,2 +1,2 @@ -UPD 2023-11-12_19:47:27 48890 FHEM/73_GardenaSmartBridge.pm -UPD 2023-11-05_21:51:38 126419 FHEM/74_GardenaSmartDevice.pm +UPD 2023-11-28_08:37:01 48890 FHEM/73_GardenaSmartBridge.pm +UPD 2023-11-28_08:49:14 126386 FHEM/74_GardenaSmartDevice.pm From 918f4dc6a3a85d70c151dc91cf1bb3524ff61fbf Mon Sep 17 00:00:00 2001 From: Sebastian Date: Wed, 21 Feb 2024 21:56:14 +0100 Subject: [PATCH 2/9] test: fix error spam --- FHEM/73_GardenaSmartBridge.pm | 7 +++++++ controls_GardenaSmartDevice.txt | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/FHEM/73_GardenaSmartBridge.pm b/FHEM/73_GardenaSmartBridge.pm index fe21726..dd1d589 100644 --- a/FHEM/73_GardenaSmartBridge.pm +++ b/FHEM/73_GardenaSmartBridge.pm @@ -1059,6 +1059,13 @@ sub WriteReadings { if ( ref($v) eq 'ARRAY' ); #$v = encode_utf8($v); + Log3 $name, 4, "Gardena DEBUG DEBUG DEBUG stage 1 ".$decode_json->{abilities}[0]{properties}[$properties{name} if ( $decode_json->{abilities}[0]{properties}[$properties] + {name} !~ /ethernet_status|wifi_status/ ); + Log3 $name, 4, "Gardena DEBUG DEBUG DEBUG stage 2".$t if ( $decode_json->{abilities}[0]{properties}[$properties] + {name} !~ /ethernet_status|wifi_status/ ); + Log3 $name, 4, "Gardena DEBUG DEBUG DEBUG stage 3".$v if ( $decode_json->{abilities}[0]{properties}[$properties] + {name} !~ /ethernet_status|wifi_status/ ); + readingsBulkUpdateIfChanged( $hash, $decode_json->{abilities}[0]{properties}[$properties] diff --git a/controls_GardenaSmartDevice.txt b/controls_GardenaSmartDevice.txt index a83fba6..03746be 100644 --- a/controls_GardenaSmartDevice.txt +++ b/controls_GardenaSmartDevice.txt @@ -1,2 +1,2 @@ -UPD 2023-11-28_08:37:01 48890 FHEM/73_GardenaSmartBridge.pm -UPD 2023-11-28_08:49:14 126386 FHEM/74_GardenaSmartDevice.pm +UPD 2024-02-21_21:54:03 49548 FHEM/73_GardenaSmartBridge.pm +UPD 2024-01-24_21:11:27 126386 FHEM/74_GardenaSmartDevice.pm From 2c94924e974fd08f872728872954287a3e920248 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Wed, 21 Feb 2024 21:58:05 +0100 Subject: [PATCH 3/9] fix: push version --- FHEM/73_GardenaSmartBridge.pm | 2 +- controls_GardenaSmartDevice.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/FHEM/73_GardenaSmartBridge.pm b/FHEM/73_GardenaSmartBridge.pm index dd1d589..cb62b67 100644 --- a/FHEM/73_GardenaSmartBridge.pm +++ b/FHEM/73_GardenaSmartBridge.pm @@ -1568,7 +1568,7 @@ sub DeletePassword { ], "release_status": "stable", "license": "GPL_2", - "version": "v2.6.1", + "version": "v2.6.2", "author": [ "Marko Oldenburg " ], diff --git a/controls_GardenaSmartDevice.txt b/controls_GardenaSmartDevice.txt index 03746be..987c56c 100644 --- a/controls_GardenaSmartDevice.txt +++ b/controls_GardenaSmartDevice.txt @@ -1,2 +1,2 @@ -UPD 2024-02-21_21:54:03 49548 FHEM/73_GardenaSmartBridge.pm +UPD 2024-02-21_21:57:50 49548 FHEM/73_GardenaSmartBridge.pm UPD 2024-01-24_21:11:27 126386 FHEM/74_GardenaSmartDevice.pm From 790d5206b6e3f622440a35109aa866ba1c175e75 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Wed, 21 Feb 2024 22:00:02 +0100 Subject: [PATCH 4/9] fix: fix --- FHEM/73_GardenaSmartBridge.pm | 2 +- controls_GardenaSmartDevice.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/FHEM/73_GardenaSmartBridge.pm b/FHEM/73_GardenaSmartBridge.pm index cb62b67..6c00470 100644 --- a/FHEM/73_GardenaSmartBridge.pm +++ b/FHEM/73_GardenaSmartBridge.pm @@ -1059,7 +1059,7 @@ sub WriteReadings { if ( ref($v) eq 'ARRAY' ); #$v = encode_utf8($v); - Log3 $name, 4, "Gardena DEBUG DEBUG DEBUG stage 1 ".$decode_json->{abilities}[0]{properties}[$properties{name} if ( $decode_json->{abilities}[0]{properties}[$properties] + Log3 $name, 4, "Gardena DEBUG DEBUG DEBUG stage 1 ".$decode_json->{abilities}[0]{properties}[$properties]{name} if ( $decode_json->{abilities}[0]{properties}[$properties] {name} !~ /ethernet_status|wifi_status/ ); Log3 $name, 4, "Gardena DEBUG DEBUG DEBUG stage 2".$t if ( $decode_json->{abilities}[0]{properties}[$properties] {name} !~ /ethernet_status|wifi_status/ ); diff --git a/controls_GardenaSmartDevice.txt b/controls_GardenaSmartDevice.txt index 987c56c..439d528 100644 --- a/controls_GardenaSmartDevice.txt +++ b/controls_GardenaSmartDevice.txt @@ -1,2 +1,2 @@ -UPD 2024-02-21_21:57:50 49548 FHEM/73_GardenaSmartBridge.pm +UPD 2024-02-21_21:59:56 49549 FHEM/73_GardenaSmartBridge.pm UPD 2024-01-24_21:11:27 126386 FHEM/74_GardenaSmartDevice.pm From 579f63299058a27c280a20509c3b7ef960c27a30 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Fri, 23 Feb 2024 22:52:25 +0100 Subject: [PATCH 5/9] test: catch null value --- FHEM/73_GardenaSmartBridge.pm | 1 + controls_GardenaSmartDevice.txt | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/FHEM/73_GardenaSmartBridge.pm b/FHEM/73_GardenaSmartBridge.pm index 6c00470..cd0d384 100644 --- a/FHEM/73_GardenaSmartBridge.pm +++ b/FHEM/73_GardenaSmartBridge.pm @@ -1059,6 +1059,7 @@ sub WriteReadings { if ( ref($v) eq 'ARRAY' ); #$v = encode_utf8($v); + $v = ' ' if (!defined $v); Log3 $name, 4, "Gardena DEBUG DEBUG DEBUG stage 1 ".$decode_json->{abilities}[0]{properties}[$properties]{name} if ( $decode_json->{abilities}[0]{properties}[$properties] {name} !~ /ethernet_status|wifi_status/ ); Log3 $name, 4, "Gardena DEBUG DEBUG DEBUG stage 2".$t if ( $decode_json->{abilities}[0]{properties}[$properties] diff --git a/controls_GardenaSmartDevice.txt b/controls_GardenaSmartDevice.txt index 439d528..de89374 100644 --- a/controls_GardenaSmartDevice.txt +++ b/controls_GardenaSmartDevice.txt @@ -1,2 +1,2 @@ -UPD 2024-02-21_21:59:56 49549 FHEM/73_GardenaSmartBridge.pm +UPD 2024-02-23_22:52:08 49596 FHEM/73_GardenaSmartBridge.pm UPD 2024-01-24_21:11:27 126386 FHEM/74_GardenaSmartDevice.pm From 68f66c84308d6a999933550c6a661d4b082cf3ab Mon Sep 17 00:00:00 2001 From: Sebastian Date: Sun, 17 Mar 2024 20:58:13 +0100 Subject: [PATCH 6/9] test: new api start cmd --- FHEM/73_GardenaSmartBridge.pm | 6 +++--- FHEM/74_GardenaSmartDevice.pm | 20 ++++++++++---------- controls_GardenaSmartDevice.txt | 4 ++-- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/FHEM/73_GardenaSmartBridge.pm b/FHEM/73_GardenaSmartBridge.pm index fe21726..87964c1 100644 --- a/FHEM/73_GardenaSmartBridge.pm +++ b/FHEM/73_GardenaSmartBridge.pm @@ -1315,7 +1315,7 @@ sub createHttpValueStrings { } # park until next schedules or override elsif (defined($abilities) && defined($payload) - && $abilities eq 'mower_timer' ) + && $abilities eq 'mower' ) { my $valve_id; $method = 'PUT'; @@ -1325,7 +1325,7 @@ sub createHttpValueStrings { . $deviceId . '/abilities/' . $abilities - . '/properties/mower_timer'; + . '/commands/manual_start'; } elsif (defined($abilities) @@ -1561,7 +1561,7 @@ sub DeletePassword { ], "release_status": "stable", "license": "GPL_2", - "version": "v2.6.1", + "version": "v2.6.2", "author": [ "Marko Oldenburg " ], diff --git a/FHEM/74_GardenaSmartDevice.pm b/FHEM/74_GardenaSmartDevice.pm index 7cff625..d80d4f2 100644 --- a/FHEM/74_GardenaSmartDevice.pm +++ b/FHEM/74_GardenaSmartDevice.pm @@ -324,8 +324,8 @@ sub Set { elsif ( lc $cmd eq 'parkuntilnexttimer' ) { $payload = '"name":"park_until_next_timer"'; if ( $mainboard_version > 10.30 ) { - $payload = '"properties":{"name":"mower_timer","value":0}'; - $abilities = 'mower_timer'; + $payload = '"mowerTimer":0,"startingPointDistance":null,"areaId":null'; + $abilities = 'mower'; } } elsif ( lc $cmd eq 'startresumeschedule' ) { @@ -339,13 +339,13 @@ sub Set { } } elsif ( lc $cmd eq 'startoverridetimer' ) { - $payload = '"name":"start_override_timer","parameters":{"duration":' - . $aArg->[0] * 60 . '}'; - if ( $mainboard_version > 10.30 ) { - $payload = '"properties":{"name":"mower_timer","value":' - . $aArg->[0] * 60 . '}'; - $abilities = 'mower_timer'; - } + # $payload = '"name":"start_override_timer","parameters":{"duration":' + # . $aArg->[0] * 60 . '}'; + # if ( $mainboard_version > 10.30 ) { + $payload = '"startingPointDistance":null,"areaId":null, "mowerTimer": ' + . $aArg->[0] * 60; + $abilities = 'mower'; + # } removed code < 10.30 api changes March 2024 } elsif ( lc $cmd eq 'startpoint' ) { @@ -2684,7 +2684,7 @@ sub SetPredefinedStartPoints { ], "release_status": "stable", "license": "GPL_2", - "version": "v2.6.1", + "version": "v2.6.2", "author": [ "Marko Oldenburg " ], diff --git a/controls_GardenaSmartDevice.txt b/controls_GardenaSmartDevice.txt index a83fba6..3c70c3a 100644 --- a/controls_GardenaSmartDevice.txt +++ b/controls_GardenaSmartDevice.txt @@ -1,2 +1,2 @@ -UPD 2023-11-28_08:37:01 48890 FHEM/73_GardenaSmartBridge.pm -UPD 2023-11-28_08:49:14 126386 FHEM/74_GardenaSmartDevice.pm +UPD 2024-03-17_20:57:21 48883 FHEM/73_GardenaSmartBridge.pm +UPD 2024-03-17_20:57:32 126450 FHEM/74_GardenaSmartDevice.pm From 72daa71dafb82aadacd75f29dac5e9b03eda506e Mon Sep 17 00:00:00 2001 From: Sebastian Date: Mon, 18 Mar 2024 10:15:25 +0100 Subject: [PATCH 7/9] fix: put to post --- FHEM/73_GardenaSmartBridge.pm | 3 +-- controls_GardenaSmartDevice.txt | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/FHEM/73_GardenaSmartBridge.pm b/FHEM/73_GardenaSmartBridge.pm index 87964c1..5894a88 100644 --- a/FHEM/73_GardenaSmartBridge.pm +++ b/FHEM/73_GardenaSmartBridge.pm @@ -1318,8 +1318,7 @@ sub createHttpValueStrings { && $abilities eq 'mower' ) { my $valve_id; - $method = 'PUT'; - + $uri .= '/devices/' . $deviceId diff --git a/controls_GardenaSmartDevice.txt b/controls_GardenaSmartDevice.txt index 3c70c3a..f85b761 100644 --- a/controls_GardenaSmartDevice.txt +++ b/controls_GardenaSmartDevice.txt @@ -1,2 +1,2 @@ -UPD 2024-03-17_20:57:21 48883 FHEM/73_GardenaSmartBridge.pm +UPD 2024-03-18_10:15:10 48866 FHEM/73_GardenaSmartBridge.pm UPD 2024-03-17_20:57:32 126450 FHEM/74_GardenaSmartDevice.pm From 443ecd777622369d970c0d17ddc89ac097e06e34 Mon Sep 17 00:00:00 2001 From: Marko Oldenburg Date: Thu, 28 Mar 2024 05:59:55 +0100 Subject: [PATCH 8/9] controls_GardenaSmartDevice.txt aktualisiert --- controls_GardenaSmartDevice.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/controls_GardenaSmartDevice.txt b/controls_GardenaSmartDevice.txt index de89374..a453629 100644 --- a/controls_GardenaSmartDevice.txt +++ b/controls_GardenaSmartDevice.txt @@ -1,2 +1,2 @@ -UPD 2024-02-23_22:52:08 49596 FHEM/73_GardenaSmartBridge.pm -UPD 2024-01-24_21:11:27 126386 FHEM/74_GardenaSmartDevice.pm +UPD 2024-03-18_10:15:10 48866 FHEM/73_GardenaSmartBridge.pm +UPD 2024-03-17_20:57:32 126450 FHEM/74_GardenaSmartDevice.pm \ No newline at end of file From 74635dfd0a2d3b74f828620bb74c85392615db5b Mon Sep 17 00:00:00 2001 From: Marko Oldenburg Date: Thu, 28 Mar 2024 06:05:59 +0100 Subject: [PATCH 9/9] controls_GardenaSmartDevice.txt aktualisiert --- controls_GardenaSmartDevice.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/controls_GardenaSmartDevice.txt b/controls_GardenaSmartDevice.txt index f85b761..a453629 100644 --- a/controls_GardenaSmartDevice.txt +++ b/controls_GardenaSmartDevice.txt @@ -1,2 +1,2 @@ UPD 2024-03-18_10:15:10 48866 FHEM/73_GardenaSmartBridge.pm -UPD 2024-03-17_20:57:32 126450 FHEM/74_GardenaSmartDevice.pm +UPD 2024-03-17_20:57:32 126450 FHEM/74_GardenaSmartDevice.pm \ No newline at end of file