Compare commits
21 Commits
03e79bc782
...
dev
Author | SHA1 | Date | |
---|---|---|---|
c75f865589 | |||
9412aac176 | |||
ae437a09f2 | |||
640a7544d7 | |||
f38236f721 | |||
517f033ccc | |||
03b2130625 | |||
90a561be10 | |||
69d7681a28 | |||
5e60969fc4 | |||
2d756e4aaa | |||
80147631d6 | |||
8b66df8407 | |||
fc3740fe9b | |||
03ad7e3fba | |||
dfea4716d3 | |||
f9661f6452 | |||
b41e583a9e | |||
5138e6b3b0 | |||
89bc35b1bd | |||
f14d34c1b4 |
155
CHANGELOG.md
155
CHANGELOG.md
@ -1,4 +1,155 @@
|
|||||||
### test: smartdevice variable wintermode initializied Bridge consolidiert wifi/ethernet (HEAD -> patch_mucki)
|
### fix: api call,rate limit (HEAD -> patch_login_autodisable_api)
|
||||||
|
>Tue, 21 May 2024 10:29:07 +0200
|
||||||
|
|
||||||
|
>Author: Sebastian (em@ail.tld)
|
||||||
|
|
||||||
|
>Commiter: Sebastian (em@ail.tld)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### docs: change copyright year
|
||||||
|
>Mon, 15 Apr 2024 15:45:33 +0200
|
||||||
|
|
||||||
|
>Author: Marko Oldenburg (fhemdevelopment@cooltux.net)
|
||||||
|
|
||||||
|
>Commiter: Marko Oldenburg (fhemdevelopment@cooltux.net)
|
||||||
|
|
||||||
|
Ticket: no
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### fix: version push (origin/patch_valve_hhhdg, patch_valve_hhhdg)
|
||||||
|
>Mon, 15 Apr 2024 09:38:16 +0200
|
||||||
|
|
||||||
|
>Author: Sebastian (em@ail.tld)
|
||||||
|
|
||||||
|
>Commiter: Sebastian (em@ail.tld)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### fix: patch code scheduling by hhhdg
|
||||||
|
>Mon, 15 Apr 2024 09:32:51 +0200
|
||||||
|
|
||||||
|
>Author: Sebastian (em@ail.tld)
|
||||||
|
|
||||||
|
>Commiter: Sebastian (em@ail.tld)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### docs: new CHANGELOG
|
||||||
|
>Thu, 28 Mar 2024 12:41:42 +0100
|
||||||
|
|
||||||
|
>Author: Marko Oldenburg (fhemdevelopment@cooltux.net)
|
||||||
|
|
||||||
|
>Commiter: Marko Oldenburg (fhemdevelopment@cooltux.net)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### controls_GardenaSmartDevice.txt aktualisiert
|
||||||
|
>Thu, 28 Mar 2024 06:05:59 +0100
|
||||||
|
|
||||||
|
>Author: Marko Oldenburg (marko@noreply@cooltux.net)
|
||||||
|
|
||||||
|
>Commiter: Marko Oldenburg (marko@noreply@cooltux.net)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### controls_GardenaSmartDevice.txt aktualisiert
|
||||||
|
>Thu, 28 Mar 2024 05:59:55 +0100
|
||||||
|
|
||||||
|
>Author: Marko Oldenburg (marko@noreply@cooltux.net)
|
||||||
|
|
||||||
|
>Commiter: Marko Oldenburg (marko@noreply@cooltux.net)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### fix: put to post (origin/patch_newstart_command, patch_newstart_command)
|
||||||
|
>Mon, 18 Mar 2024 10:15:25 +0100
|
||||||
|
|
||||||
|
>Author: Sebastian (em@ail.tld)
|
||||||
|
|
||||||
|
>Commiter: Sebastian (em@ail.tld)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### test: new api start cmd
|
||||||
|
>Sun, 17 Mar 2024 20:58:13 +0100
|
||||||
|
|
||||||
|
>Author: Sebastian (em@ail.tld)
|
||||||
|
|
||||||
|
>Commiter: Sebastian (em@ail.tld)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### test: catch null value (origin/patch_mucki_gwoffline, patch_mucki_gwoffline)
|
||||||
|
>Fri, 23 Feb 2024 22:52:25 +0100
|
||||||
|
|
||||||
|
>Author: Sebastian (em@ail.tld)
|
||||||
|
|
||||||
|
>Commiter: Sebastian (em@ail.tld)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### fix: fix
|
||||||
|
>Wed, 21 Feb 2024 22:00:02 +0100
|
||||||
|
|
||||||
|
>Author: Sebastian (em@ail.tld)
|
||||||
|
|
||||||
|
>Commiter: Sebastian (em@ail.tld)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### fix: push version
|
||||||
|
>Wed, 21 Feb 2024 21:58:05 +0100
|
||||||
|
|
||||||
|
>Author: Sebastian (em@ail.tld)
|
||||||
|
|
||||||
|
>Commiter: Sebastian (em@ail.tld)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### test: fix error spam
|
||||||
|
>Wed, 21 Feb 2024 21:56:14 +0100
|
||||||
|
|
||||||
|
>Author: Sebastian (em@ail.tld)
|
||||||
|
|
||||||
|
>Commiter: Sebastian (em@ail.tld)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### fix: closes #90
|
||||||
|
>Tue, 28 Nov 2023 08:52:33 +0100
|
||||||
|
|
||||||
|
>Author: Marko Oldenburg (fhemdevelopment@cooltux.net)
|
||||||
|
|
||||||
|
>Commiter: Marko Oldenburg (fhemdevelopment@cooltux.net)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### fix: missing tree (origin/patch_mucki, patch_mucki)
|
||||||
|
>Sun, 12 Nov 2023 19:47:49 +0100
|
||||||
|
|
||||||
|
>Author: Sebastian (em@ail.tld)
|
||||||
|
|
||||||
|
>Commiter: Sebastian (em@ail.tld)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### test: smartdevice variable wintermode initializied Bridge consolidiert wifi/ethernet
|
||||||
>Sun, 5 Nov 2023 21:52:24 +0100
|
>Sun, 5 Nov 2023 21:52:24 +0100
|
||||||
|
|
||||||
>Author: Sebastian (em@ail.tld)
|
>Author: Sebastian (em@ail.tld)
|
||||||
@ -8,7 +159,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
### test: fix initial variables (origin/patch_mucki)
|
### test: fix initial variables
|
||||||
>Wed, 1 Nov 2023 21:04:39 +0100
|
>Wed, 1 Nov 2023 21:04:39 +0100
|
||||||
|
|
||||||
>Author: Sebastian (em@ail.tld)
|
>Author: Sebastian (em@ail.tld)
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# Developed with VSCodium and richterger perl plugin.
|
# Developed with VSCodium and richterger perl plugin.
|
||||||
#
|
#
|
||||||
# (c) 2017-2022 Copyright: Marko Oldenburg (fhemdevelopment at cooltux dot net)
|
# (c) 2017-2024 Copyright: Marko Oldenburg (fhemdevelopment at cooltux dot net)
|
||||||
# All rights reserved
|
# All rights reserved
|
||||||
#
|
#
|
||||||
# Special thanks goes to comitters:
|
# Special thanks goes to comitters:
|
||||||
@ -75,9 +75,9 @@ eval { use IO::Socket::SSL; 1 }
|
|||||||
# try to use JSON::MaybeXS wrapper
|
# try to use JSON::MaybeXS wrapper
|
||||||
# for chance of better performance + open code
|
# for chance of better performance + open code
|
||||||
eval {
|
eval {
|
||||||
require JSON::MaybeXS;
|
require JSON::MaybeXS;
|
||||||
import JSON::MaybeXS qw( decode_json encode_json );
|
import JSON::MaybeXS qw( decode_json encode_json );
|
||||||
1;
|
1;
|
||||||
} or do {
|
} or do {
|
||||||
|
|
||||||
# try to use JSON wrapper
|
# try to use JSON wrapper
|
||||||
@ -205,6 +205,7 @@ sub Define {
|
|||||||
my $hash = shift // return;
|
my $hash = shift // return;
|
||||||
my $aArg = shift // return;
|
my $aArg = shift // return;
|
||||||
|
|
||||||
|
|
||||||
return $@ unless ( FHEM::Meta::SetInternals($hash) );
|
return $@ unless ( FHEM::Meta::SetInternals($hash) );
|
||||||
use version 0.60; our $VERSION = FHEM::Meta::Get( $hash, 'version' );
|
use version 0.60; our $VERSION = FHEM::Meta::Get( $hash, 'version' );
|
||||||
|
|
||||||
@ -221,8 +222,9 @@ sub Define {
|
|||||||
$hash->{URL} =
|
$hash->{URL} =
|
||||||
AttrVal( $name, 'gardenaBaseURL', 'https://smart.gardena.com' ) . '/v1';
|
AttrVal( $name, 'gardenaBaseURL', 'https://smart.gardena.com' ) . '/v1';
|
||||||
$hash->{VERSION} = version->parse($VERSION)->normal;
|
$hash->{VERSION} = version->parse($VERSION)->normal;
|
||||||
$hash->{INTERVAL} = 60;
|
$hash->{INTERVAL} = 180;
|
||||||
$hash->{NOTIFYDEV} = "global,$name";
|
$hash->{NOTIFYDEV} = "global,$name";
|
||||||
|
$hash->{helper}{gettoken_count} = 0;
|
||||||
|
|
||||||
CommandAttr( undef, $name . ' room GardenaSmart' )
|
CommandAttr( undef, $name . ' room GardenaSmart' )
|
||||||
if ( AttrVal( $name, 'room', 'none' ) eq 'none' );
|
if ( AttrVal( $name, 'room', 'none' ) eq 'none' );
|
||||||
@ -264,6 +266,8 @@ sub Attr {
|
|||||||
if ( $cmd eq 'set' && $attrVal eq '1' ) {
|
if ( $cmd eq 'set' && $attrVal eq '1' ) {
|
||||||
RemoveInternalTimer( $hash,
|
RemoveInternalTimer( $hash,
|
||||||
"FHEM::GardenaSmartBridge::getDevices" );
|
"FHEM::GardenaSmartBridge::getDevices" );
|
||||||
|
RemoveInternalTimer( $hash,
|
||||||
|
"FHEM::GardenaSmartBridge::getToken" );
|
||||||
readingsSingleUpdate( $hash, 'state', 'inactive', 1 );
|
readingsSingleUpdate( $hash, 'state', 'inactive', 1 );
|
||||||
Log3 $name, 3, "GardenaSmartBridge ($name) - disabled";
|
Log3 $name, 3, "GardenaSmartBridge ($name) - disabled";
|
||||||
}
|
}
|
||||||
@ -290,14 +294,14 @@ sub Attr {
|
|||||||
if ( $attrVal == 0 );
|
if ( $attrVal == 0 );
|
||||||
RemoveInternalTimer( $hash,
|
RemoveInternalTimer( $hash,
|
||||||
"FHEM::GardenaSmartBridge::getDevices" );
|
"FHEM::GardenaSmartBridge::getDevices" );
|
||||||
$hash->{INTERVAL} = $attrVal;
|
$hash->{INTERVAL} = $attrVal if $attrVal >= 180;
|
||||||
Log3 $name, 3,
|
Log3 $name, 3,
|
||||||
"GardenaSmartBridge ($name) - set interval: $attrVal";
|
"GardenaSmartBridge ($name) - set interval: $attrVal";
|
||||||
}
|
}
|
||||||
elsif ( $cmd eq 'del' ) {
|
elsif ( $cmd eq 'del' ) {
|
||||||
RemoveInternalTimer( $hash,
|
RemoveInternalTimer( $hash,
|
||||||
"FHEM::GardenaSmartBridge::getDevices" );
|
"FHEM::GardenaSmartBridge::getDevices" );
|
||||||
$hash->{INTERVAL} = 60;
|
$hash->{INTERVAL} = 180;
|
||||||
Log3 $name, 3,
|
Log3 $name, 3,
|
||||||
"GardenaSmartBridge ($name) - delete User interval and set default: 60";
|
"GardenaSmartBridge ($name) - delete User interval and set default: 60";
|
||||||
}
|
}
|
||||||
@ -629,31 +633,32 @@ sub ErrorHandling {
|
|||||||
if ($decode_json) {
|
if ($decode_json) {
|
||||||
if ( ref( $decode_json->{errors} ) eq "ARRAY"
|
if ( ref( $decode_json->{errors} ) eq "ARRAY"
|
||||||
&& exists( $decode_json->{errors} ) )
|
&& exists( $decode_json->{errors} ) )
|
||||||
# replace defined with exists
|
|
||||||
# && defined( $decode_json->{errors} ) )
|
# replace defined with exists
|
||||||
|
# && defined( $decode_json->{errors} ) )
|
||||||
{
|
{
|
||||||
# $decode_json->{errors} -> ARRAY
|
# $decode_json->{errors} -> ARRAY
|
||||||
# $decode_json->{errors}[0] -> HASH
|
# $decode_json->{errors}[0] -> HASH
|
||||||
if (exists ($decode_json->{errors}[0]{error}) ) {
|
if ( exists( $decode_json->{errors}[0]{error} ) ) {
|
||||||
readingsBulkUpdate(
|
readingsBulkUpdate(
|
||||||
$dhash,
|
$dhash,
|
||||||
"state",
|
"state",
|
||||||
$decode_json->{errors}[0]{error} . ' '
|
$decode_json->{errors}[0]{error} . ' '
|
||||||
. $decode_json->{errors}[0]{attribute},
|
. $decode_json->{errors}[0]{attribute},
|
||||||
1
|
1
|
||||||
);
|
);
|
||||||
readingsBulkUpdate(
|
readingsBulkUpdate(
|
||||||
$dhash,
|
$dhash,
|
||||||
"lastRequestState",
|
"lastRequestState",
|
||||||
$decode_json->{errors}[0]{error} . ' '
|
$decode_json->{errors}[0]{error} . ' '
|
||||||
. $decode_json->{errors}[0]{attribute},
|
. $decode_json->{errors}[0]{attribute},
|
||||||
1
|
1
|
||||||
);
|
);
|
||||||
Log3 $dname, 5,
|
Log3 $dname, 5,
|
||||||
"GardenaSmartBridge ($dname) - RequestERROR: "
|
"GardenaSmartBridge ($dname) - RequestERROR: "
|
||||||
. $decode_json->{errors}[0]{error} . " "
|
. $decode_json->{errors}[0]{error} . " "
|
||||||
. $decode_json->{errors}[0]{attribute};
|
. $decode_json->{errors}[0]{attribute};
|
||||||
} # fi exists error
|
} # fi exists error
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -690,6 +695,16 @@ sub ErrorHandling {
|
|||||||
"GardenaSmartBridge ($dname) - RequestERROR: check the ???";
|
"GardenaSmartBridge ($dname) - RequestERROR: check the ???";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
elsif ( $decode_json->{errors}[0]{code} eq "ratelimit.exceeded" ) {
|
||||||
|
Log3 $name, 5,
|
||||||
|
"GardenaSmartBridge ($name) - RequestERROR: error ratelimit.exceeded";
|
||||||
|
readingsBulkUpdate( $hash, "lastRequestState", "too many requests", 1 );
|
||||||
|
readingsBulkUpdate( $hash, "state", "inactive", 1 );
|
||||||
|
# remove all timer and disable bridge
|
||||||
|
RemoveInternalTimer( $hash );
|
||||||
|
|
||||||
|
return; # post request max.
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
|
|
||||||
Log3 $dname, 5,
|
Log3 $dname, 5,
|
||||||
@ -699,8 +714,18 @@ sub ErrorHandling {
|
|||||||
|
|
||||||
if ( !defined( $hash->{helper}{session_id} ) ) {
|
if ( !defined( $hash->{helper}{session_id} ) ) {
|
||||||
readingsSingleUpdate( $hash, 'token', 'none', 1 );
|
readingsSingleUpdate( $hash, 'token', 'none', 1 );
|
||||||
InternalTimer( gettimeofday() + 5,
|
Log3 $name, 3,
|
||||||
"FHEM::GardenaSmartBridge::getToken", $hash );
|
"GardenaSmartBridge ($name) - getToken limit: "
|
||||||
|
. $hash->{helper}{gettoken_count} ;
|
||||||
|
|
||||||
|
if ($hash->{helper}{gettoken_count} < 6) {
|
||||||
|
$hash->{helper}{gettoken_count}++;
|
||||||
|
InternalTimer( gettimeofday() + 5,
|
||||||
|
"FHEM::GardenaSmartBridge::getToken", $hash )
|
||||||
|
} else {
|
||||||
|
RemoveInternalTimer ($hash);
|
||||||
|
$hash->{helper}{gettoken_count} = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
readingsEndUpdate( $dhash, 1 );
|
readingsEndUpdate( $dhash, 1 );
|
||||||
|
|
||||||
@ -1059,12 +1084,18 @@ sub WriteReadings {
|
|||||||
if ( ref($v) eq 'ARRAY' );
|
if ( ref($v) eq 'ARRAY' );
|
||||||
|
|
||||||
#$v = encode_utf8($v);
|
#$v = encode_utf8($v);
|
||||||
$v = ' ' if (!defined $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]
|
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/ );
|
{name} !~ /ethernet_status|wifi_status/ );
|
||||||
Log3 $name, 4, "Gardena DEBUG DEBUG DEBUG stage 2".$t if ( $decode_json->{abilities}[0]{properties}[$properties]
|
Log3 $name, 4, "Gardena DEBUG DEBUG DEBUG stage 2" . $t
|
||||||
|
if ( $decode_json->{abilities}[0]{properties}[$properties]
|
||||||
{name} !~ /ethernet_status|wifi_status/ );
|
{name} !~ /ethernet_status|wifi_status/ );
|
||||||
Log3 $name, 4, "Gardena DEBUG DEBUG DEBUG stage 3".$v if ( $decode_json->{abilities}[0]{properties}[$properties]
|
Log3 $name, 4, "Gardena DEBUG DEBUG DEBUG stage 3" . $v
|
||||||
|
if ( $decode_json->{abilities}[0]{properties}[$properties]
|
||||||
{name} !~ /ethernet_status|wifi_status/ );
|
{name} !~ /ethernet_status|wifi_status/ );
|
||||||
|
|
||||||
readingsBulkUpdateIfChanged(
|
readingsBulkUpdateIfChanged(
|
||||||
@ -1084,16 +1115,22 @@ sub WriteReadings {
|
|||||||
)
|
)
|
||||||
&& ref($v) eq 'HASH'
|
&& ref($v) eq 'HASH'
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
if ($v->{is_connected} ) {
|
if ( $v->{is_connected} ) {
|
||||||
readingsBulkUpdateIfChanged( $hash,
|
readingsBulkUpdateIfChanged(
|
||||||
$decode_json->{abilities}[0]{properties}[$properties]{name}.'-ip', $v->{ip} )
|
$hash,
|
||||||
if ( ref( $v->{ip} ) ne 'HASH' );
|
$decode_json->{abilities}[0]{properties}
|
||||||
readingsBulkUpdateIfChanged( $hash,
|
[$properties]{name} . '-ip',
|
||||||
$decode_json->{abilities}[0]{properties}[$properties]{name}.'-isconnected', $v->{is_connected} )
|
$v->{ip}
|
||||||
if ( $v->{is_connected} );
|
) if ( ref( $v->{ip} ) ne 'HASH' );
|
||||||
|
readingsBulkUpdateIfChanged(
|
||||||
|
$hash,
|
||||||
|
$decode_json->{abilities}[0]{properties}
|
||||||
|
[$properties]{name} . '-isconnected',
|
||||||
|
$v->{is_connected}
|
||||||
|
) if ( $v->{is_connected} );
|
||||||
}
|
}
|
||||||
} # fi ethernet and wifi
|
} # fi ethernet and wifi
|
||||||
}
|
}
|
||||||
$properties--;
|
$properties--;
|
||||||
|
|
||||||
@ -1163,21 +1200,21 @@ sub getToken {
|
|||||||
|
|
||||||
Write(
|
Write(
|
||||||
$hash,
|
$hash,
|
||||||
'"data": {"type":"token", "attributes":{"username": "'
|
'"data":{"type":"token","attributes":{"username":"'
|
||||||
. AttrVal( $name, 'gardenaAccountEmail', 'none' )
|
. AttrVal( $name, 'gardenaAccountEmail', 'none' )
|
||||||
. '","password": "'
|
. '","password":"'
|
||||||
. ReadPassword( $hash, $name )
|
. ReadPassword( $hash, $name )
|
||||||
. '", "client_id":"smartgarden-jwt-client"}}',
|
. '","client_id":"smartgarden-jwt-client"}}',
|
||||||
undef,
|
undef,
|
||||||
undef
|
undef
|
||||||
);
|
);
|
||||||
|
|
||||||
Log3 $name, 4,
|
Log3 $name, 4,
|
||||||
'"data": {"type":"token", "attributes":{"username": "'
|
'"data": {"type":"token", "attributes":{"username":"'
|
||||||
. AttrVal( $name, 'gardenaAccountEmail', 'none' )
|
. AttrVal( $name, 'gardenaAccountEmail', 'none' )
|
||||||
. '","password": "'
|
. '","password":"'
|
||||||
. ReadPassword( $hash, $name )
|
. ReadPassword( $hash, $name )
|
||||||
. '", "client_id":"smartgarden-jwt-client"}}';
|
. '","client_id":"smartgarden-jwt-client"}}';
|
||||||
Log3 $name, 3,
|
Log3 $name, 3,
|
||||||
"GardenaSmartBridge ($name) - send credentials to fetch Token and locationId";
|
"GardenaSmartBridge ($name) - send credentials to fetch Token and locationId";
|
||||||
|
|
||||||
@ -1276,7 +1313,10 @@ sub createHttpValueStrings {
|
|||||||
my ( $hash, $payload, $deviceId, $abilities, $service_id ) = @_;
|
my ( $hash, $payload, $deviceId, $abilities, $service_id ) = @_;
|
||||||
|
|
||||||
my $session_id = $hash->{helper}{session_id};
|
my $session_id = $hash->{helper}{session_id};
|
||||||
my $header = "Content-Type: application/json";
|
my $header = 'Content-Type: application/json';
|
||||||
|
$header .= "\r\norigin: https://smart.gardena.com";
|
||||||
|
$header .= "\r\nuser-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36";
|
||||||
|
#my $header = "Content-Type: application/json; origin: https://smart.gardena.com";
|
||||||
my $uri = '';
|
my $uri = '';
|
||||||
my $method = 'POST';
|
my $method = 'POST';
|
||||||
$header .= "\r\nAuthorization: Bearer $session_id"
|
$header .= "\r\nAuthorization: Bearer $session_id"
|
||||||
@ -1326,7 +1366,7 @@ sub createHttpValueStrings {
|
|||||||
&& $abilities eq 'mower' )
|
&& $abilities eq 'mower' )
|
||||||
{
|
{
|
||||||
my $valve_id;
|
my $valve_id;
|
||||||
|
|
||||||
$uri .=
|
$uri .=
|
||||||
'/devices/'
|
'/devices/'
|
||||||
. $deviceId
|
. $deviceId
|
||||||
@ -1483,7 +1523,7 @@ sub DeletePassword {
|
|||||||
<ul>
|
<ul>
|
||||||
<li>debugJSON - </li>
|
<li>debugJSON - </li>
|
||||||
<li>disable - Disables the Bridge</li>
|
<li>disable - Disables the Bridge</li>
|
||||||
<li>interval - Interval in seconds (Default=60)</li>
|
<li>interval - Interval in seconds (Default=180)</li>
|
||||||
<li>gardenaAccountEmail - Email Adresse which was used in the GardenaAPP</li>
|
<li>gardenaAccountEmail - Email Adresse which was used in the GardenaAPP</li>
|
||||||
</ul>
|
</ul>
|
||||||
</ul>
|
</ul>
|
||||||
@ -1544,7 +1584,7 @@ sub DeletePassword {
|
|||||||
<ul>
|
<ul>
|
||||||
<li>debugJSON - JSON Fehlermeldungen</li>
|
<li>debugJSON - JSON Fehlermeldungen</li>
|
||||||
<li>disable - Schaltet die Datenübertragung der Bridge ab</li>
|
<li>disable - Schaltet die Datenübertragung der Bridge ab</li>
|
||||||
<li>interval - Abfrageinterval in Sekunden (default: 60)</li>
|
<li>interval - Abfrageinterval in Sekunden (default: 180)</li>
|
||||||
<li>gardenaAccountEmail - Email Adresse, die auch in der GardenaApp verwendet wurde</li>
|
<li>gardenaAccountEmail - Email Adresse, die auch in der GardenaApp verwendet wurde</li>
|
||||||
</ul>
|
</ul>
|
||||||
</ul>
|
</ul>
|
||||||
@ -1568,7 +1608,7 @@ sub DeletePassword {
|
|||||||
],
|
],
|
||||||
"release_status": "stable",
|
"release_status": "stable",
|
||||||
"license": "GPL_2",
|
"license": "GPL_2",
|
||||||
"version": "v2.6.2",
|
"version": "v2.6.3",
|
||||||
"author": [
|
"author": [
|
||||||
"Marko Oldenburg <fhemdevelopment@cooltux.net>"
|
"Marko Oldenburg <fhemdevelopment@cooltux.net>"
|
||||||
],
|
],
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# Developed with VSCodium and richterger perl plugin.
|
# Developed with VSCodium and richterger perl plugin.
|
||||||
#
|
#
|
||||||
# (c) 2017-2022 Copyright: Marko Oldenburg (fhemdevelopment at cooltux dot net)
|
# (c) 2017-2024 Copyright: Marko Oldenburg (fhemdevelopment at cooltux dot net)
|
||||||
# All rights reserved
|
# All rights reserved
|
||||||
#
|
#
|
||||||
# Special thanks goes to comitters:
|
# Special thanks goes to comitters:
|
||||||
@ -324,7 +324,8 @@ sub Set {
|
|||||||
elsif ( lc $cmd eq 'parkuntilnexttimer' ) {
|
elsif ( lc $cmd eq 'parkuntilnexttimer' ) {
|
||||||
$payload = '"name":"park_until_next_timer"';
|
$payload = '"name":"park_until_next_timer"';
|
||||||
if ( $mainboard_version > 10.30 ) {
|
if ( $mainboard_version > 10.30 ) {
|
||||||
$payload = '"mowerTimer":0,"startingPointDistance":null,"areaId":null';
|
$payload =
|
||||||
|
'"mowerTimer":0,"startingPointDistance":null,"areaId":null';
|
||||||
$abilities = 'mower';
|
$abilities = 'mower';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -339,12 +340,14 @@ sub Set {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
elsif ( lc $cmd eq 'startoverridetimer' ) {
|
elsif ( lc $cmd eq 'startoverridetimer' ) {
|
||||||
|
|
||||||
# $payload = '"name":"start_override_timer","parameters":{"duration":'
|
# $payload = '"name":"start_override_timer","parameters":{"duration":'
|
||||||
# . $aArg->[0] * 60 . '}';
|
# . $aArg->[0] * 60 . '}';
|
||||||
# if ( $mainboard_version > 10.30 ) {
|
# if ( $mainboard_version > 10.30 ) {
|
||||||
$payload = '"startingPointDistance":null,"areaId":null, "mowerTimer": '
|
$payload = '"startingPointDistance":null,"areaId":null, "mowerTimer": '
|
||||||
. $aArg->[0] * 60;
|
. $aArg->[0] * 60;
|
||||||
$abilities = 'mower';
|
$abilities = 'mower';
|
||||||
|
|
||||||
# } removed code < 10.30 api changes March 2024
|
# } removed code < 10.30 api changes March 2024
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -735,7 +738,8 @@ sub WriteReadings {
|
|||||||
. RigReadingsValue( $hash,
|
. RigReadingsValue( $hash,
|
||||||
$propertie->{value} ) # cast all data to string with ""
|
$propertie->{value} ) # cast all data to string with ""
|
||||||
)
|
)
|
||||||
if ( exists( $propertie->{value} )
|
if (
|
||||||
|
exists( $propertie->{value} )
|
||||||
&& $decode_json->{abilities}[$abilities]{name} . '-'
|
&& $decode_json->{abilities}[$abilities]{name} . '-'
|
||||||
. $propertie->{name} ne 'radio-quality'
|
. $propertie->{name} ne 'radio-quality'
|
||||||
&& $decode_json->{abilities}[$abilities]{name} . '-'
|
&& $decode_json->{abilities}[$abilities]{name} . '-'
|
||||||
@ -754,7 +758,10 @@ sub WriteReadings {
|
|||||||
. $propertie->{name} ne 'ic24-valves_connected'
|
. $propertie->{name} ne 'ic24-valves_connected'
|
||||||
&& $decode_json->{abilities}[$abilities]{name} . '-'
|
&& $decode_json->{abilities}[$abilities]{name} . '-'
|
||||||
. $propertie->{name} ne 'ic24-valves_master_config'
|
. $propertie->{name} ne 'ic24-valves_master_config'
|
||||||
&& ref( $propertie->{value} ) ne "HASH" );
|
&& ( $decode_json->{abilities}[$abilities]{name} . '-'
|
||||||
|
. $propertie->{name} ) !~ /scheduling-timeslot_state_\d/
|
||||||
|
&& ref( $propertie->{value} ) ne "HASH"
|
||||||
|
);
|
||||||
|
|
||||||
readingsBulkUpdateIfChanged(
|
readingsBulkUpdateIfChanged(
|
||||||
$hash,
|
$hash,
|
||||||
@ -851,7 +858,30 @@ sub WriteReadings {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# ic24 and other watering devices calc irrigation left in sec
|
# decode timeslot_state_N arrays code by hhhdg
|
||||||
|
if ( defined( $propertie->{value} )
|
||||||
|
&& $decode_json->{abilities}[$abilities]{name} . '-'
|
||||||
|
. $propertie->{name} =~ /scheduling-timeslot_state_\d/
|
||||||
|
&& ref( $propertie->{value} ) eq "ARRAY" )
|
||||||
|
{
|
||||||
|
while ( my ( $r, $v ) = each @{ $propertie->{value} } ) {
|
||||||
|
if ( ref($v) eq "HASH" ) {
|
||||||
|
my $entry = $r + 1;
|
||||||
|
while ( my ( $i_r, $i_v ) = each %{$v} ) {
|
||||||
|
readingsBulkUpdateIfChanged(
|
||||||
|
$hash,
|
||||||
|
$decode_json->{abilities}[$abilities]{name}
|
||||||
|
. '-'
|
||||||
|
. $propertie->{name} . '_'
|
||||||
|
. $entry . '_'
|
||||||
|
. $i_r,
|
||||||
|
RigReadingsValue( $hash, $i_v )
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} # fi defined
|
||||||
|
# ic24 and other watering devices calc irrigation left in sec
|
||||||
readingsBulkUpdateIfChanged(
|
readingsBulkUpdateIfChanged(
|
||||||
$hash,
|
$hash,
|
||||||
$decode_json->{abilities}[$abilities]{name} . '-'
|
$decode_json->{abilities}[$abilities]{name} . '-'
|
||||||
@ -907,15 +937,15 @@ sub WriteReadings {
|
|||||||
foreach my $dev_schedules ( sort keys %{ $hash->{READINGS} } ) {
|
foreach my $dev_schedules ( sort keys %{ $hash->{READINGS} } ) {
|
||||||
my $dev_reading = ReadingsVal( $name, $dev_schedules, "error" );
|
my $dev_reading = ReadingsVal( $name, $dev_schedules, "error" );
|
||||||
push @ist, $dev_reading
|
push @ist, $dev_reading
|
||||||
if $dev_schedules =~ /schedule.*\d_id/; # push reading _id
|
if $dev_schedules =~ /schedule.*\d+_id/; # push reading _id
|
||||||
push @ist, $1
|
push @ist, $1
|
||||||
if $dev_schedules =~
|
if $dev_schedules =~
|
||||||
/schedule.*_(\d)_id/; # push readigs d from x_id
|
/schedule.*_(\d+)_id/; # push readigs d from x_id
|
||||||
|
|
||||||
Log3 $name, 5,
|
Log3 $name, 5,
|
||||||
"[DEBUG] $name - Schedule - Key ist : $dev_schedules ";
|
"[DEBUG] $name - Schedule - Key ist : $dev_schedules ";
|
||||||
Log3 $name, 5, "[DEBUG] $name - Schedule - ID FOUND $dev_reading"
|
Log3 $name, 5, "[DEBUG] $name - Schedule - ID FOUND $dev_reading"
|
||||||
if $dev_schedules =~ /schedule.*_\d_id/; # cloud hat SOLL
|
if $dev_schedules =~ /schedule.*_\d+_id/; # cloud hat SOLL
|
||||||
}
|
}
|
||||||
|
|
||||||
#Log3 $name, 5, "[DEBUG] Cloud:".Dumper(@soll) . "- Internal:". Dumper(@ist);
|
#Log3 $name, 5, "[DEBUG] Cloud:".Dumper(@soll) . "- Internal:". Dumper(@ist);
|
||||||
@ -951,15 +981,13 @@ sub WriteReadings {
|
|||||||
&& scalar(@soll) != scalar( @ist / 2 ) )
|
&& scalar(@soll) != scalar( @ist / 2 ) )
|
||||||
{
|
{
|
||||||
while ( my $old_schedule_id = shift(@ist) ) {
|
while ( my $old_schedule_id = shift(@ist) ) {
|
||||||
if ( length($old_schedule_id) == 1 ) {
|
foreach ( keys %{ $hash->{READINGS} } ) {
|
||||||
foreach ( keys %{ $hash->{READINGS} } ) {
|
delete $hash->{READINGS}->{$_}
|
||||||
delete $hash->{READINGS}->{$_}
|
if ( $_ =~
|
||||||
if ( $_ =~
|
/scheduling-schedules_event_${old_schedule_id}_.*/ );
|
||||||
/scheduling-schedules_event_$old_schedule_id.*/ );
|
|
||||||
}
|
|
||||||
} # fi
|
} # fi
|
||||||
Log3 $name, 5,
|
Log3 $name, 5,
|
||||||
"[DEBUG] - $name : deletereading scheduling-schedules_event_$old_schedule_id.*"
|
"[DEBUG] - $name : deletereading scheduling-schedules_event_${old_schedule_id}_.*"
|
||||||
if length($old_schedule_id) == 1;
|
if length($old_schedule_id) == 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2684,7 +2712,7 @@ sub SetPredefinedStartPoints {
|
|||||||
],
|
],
|
||||||
"release_status": "stable",
|
"release_status": "stable",
|
||||||
"license": "GPL_2",
|
"license": "GPL_2",
|
||||||
"version": "v2.6.2",
|
"version": "v2.6.3",
|
||||||
"author": [
|
"author": [
|
||||||
"Marko Oldenburg <fhemdevelopment@cooltux.net>"
|
"Marko Oldenburg <fhemdevelopment@cooltux.net>"
|
||||||
],
|
],
|
||||||
|
@ -1,2 +1,2 @@
|
|||||||
UPD 2024-03-18_10:15:10 48866 FHEM/73_GardenaSmartBridge.pm
|
UPD 2024-05-22_18:46:22 51262 FHEM/73_GardenaSmartBridge.pm
|
||||||
UPD 2024-03-17_20:57:32 126450 FHEM/74_GardenaSmartDevice.pm
|
UPD 2024-05-21_09:01:54 127762 FHEM/74_GardenaSmartDevice.pm
|
||||||
|
Reference in New Issue
Block a user