34 Commits

Author SHA1 Message Date
dfea4716d3 Merge pull request 'fix: patch code scheduling by hhhdg' (#99) from patch_valve_hhhdg into dev
Reviewed-on: #99
2024-04-15 09:36:13 +02:00
f9661f6452 fix: patch code scheduling by hhhdg 2024-04-15 09:32:51 +02:00
03e79bc782 Merge pull request 'patch_mucki_gwoffline' (#96) from patch_mucki_gwoffline into dev
Reviewed-on: #96
2024-03-28 06:06:33 +01:00
74635dfd0a controls_GardenaSmartDevice.txt aktualisiert 2024-03-28 06:05:59 +01:00
443ecd7776 controls_GardenaSmartDevice.txt aktualisiert 2024-03-28 05:59:55 +01:00
bbb4be939c Merge pull request 'patch_newstart_command' (#94) from patch_newstart_command into dev
Reviewed-on: #94
2024-03-27 20:03:15 +01:00
72daa71daf fix: put to post 2024-03-18 10:15:25 +01:00
68f66c8430 test: new api start cmd 2024-03-17 20:58:13 +01:00
579f632990 test: catch null value 2024-02-23 22:52:25 +01:00
790d5206b6 fix: fix 2024-02-21 22:00:02 +01:00
2c94924e97 fix: push version 2024-02-21 21:58:05 +01:00
918f4dc6a3 test: fix error spam 2024-02-21 21:56:14 +01:00
274cb067cf Merge pull request 'patch-fix_div_with_attributes' (#91) from patch-fix_div_with_attributes into dev
Reviewed-on: #91
2023-11-28 08:54:09 +01:00
897a3c7aef fix: closes #90 2023-11-28 08:52:33 +01:00
232f82eafe Merge pull request 'testing' (#89) from testing into main
Reviewed-on: #89
2023-11-28 08:34:50 +01:00
9c49aa49b9 Merge pull request 'dev' (#88) from dev into testing
Reviewed-on: #88
2023-11-28 08:34:14 +01:00
24db680413 Merge pull request 'patch_mucki' (#87) from patch_mucki into dev
Reviewed-on: #87
Reviewed-by: Marko Oldenburg <marko@noreply@cooltux.net>
2023-11-20 20:43:36 +01:00
df1830a670 fix: missing tree 2023-11-12 19:47:49 +01:00
de58578a2d test: smartdevice variable wintermode initializied
Bridge consolidiert wifi/ethernet
2023-11-05 21:52:24 +01:00
e15a70ff0b test: fix initial variables 2023-11-01 21:04:39 +01:00
98b093bcba test: debug line 2023-10-28 18:02:17 +02:00
82907c73a3 test: cleanup initial error handling 2023-10-25 22:16:26 +02:00
13de67f570 test: fix wifi status if is_connected 2023-10-23 22:04:31 +02:00
7385959b38 test: changed published gateway informations 2023-10-21 20:21:31 +02:00
7dfa0b2dda test: gateway readings changed by gardena 2023-10-12 21:52:51 +02:00
abb325b448 test: versions pump 2023-10-03 22:40:58 +02:00
d7d5e4f843 Merge pull request 'dev' (#86) from dev into testing
Reviewed-on: #86
2023-03-15 18:17:18 +01:00
c0dec3d3fb Merge pull request 'patch_setExtention' (#85) from patch_setExtention into dev
Reviewed-on: #85
2023-03-15 18:15:48 +01:00
3e540471d5 feat: changelog 2023-03-02 11:58:58 +01:00
608719ba2f feat: add setextention 2023-03-02 11:58:29 +01:00
472fe88ac0 feat: test 2023-03-02 11:30:19 +01:00
682dea8bd1 Merge pull request 'testing' (#83) from testing into main
Reviewed-on: #83
2023-01-10 10:01:11 +01:00
fb3a690993 Merge pull request 'dev' (#82) from dev into testing
Reviewed-on: #82
2023-01-10 10:00:38 +01:00
2cae1812d8 Merge pull request 'patch-changeVersion' (#81) from patch-changeVersion into dev
Reviewed-on: #81
2023-01-10 10:00:15 +01:00
4 changed files with 231 additions and 92 deletions

View File

@ -1,4 +1,124 @@
### docs: change verson numbers (HEAD -> patch-changeVersion)
### test: smartdevice variable wintermode initializied Bridge consolidiert wifi/ethernet (HEAD -> patch_mucki)
>Sun, 5 Nov 2023 21:52:24 +0100
>Author: Sebastian (em@ail.tld)
>Commiter: Sebastian (em@ail.tld)
### test: fix initial variables (origin/patch_mucki)
>Wed, 1 Nov 2023 21:04:39 +0100
>Author: Sebastian (em@ail.tld)
>Commiter: Sebastian (em@ail.tld)
### test: debug line
>Sat, 28 Oct 2023 18:02:17 +0200
>Author: Sebastian (em@ail.tld)
>Commiter: Sebastian (em@ail.tld)
### test: cleanup initial error handling
>Wed, 25 Oct 2023 22:16:26 +0200
>Author: Sebastian (em@ail.tld)
>Commiter: Sebastian (em@ail.tld)
### test: fix wifi status if is_connected
>Mon, 23 Oct 2023 22:04:31 +0200
>Author: Sebastian (em@ail.tld)
>Commiter: Sebastian (em@ail.tld)
### test: changed published gateway informations
>Sat, 21 Oct 2023 20:21:31 +0200
>Author: Sebastian (em@ail.tld)
>Commiter: Sebastian (em@ail.tld)
### test: gateway readings changed by gardena
>Thu, 12 Oct 2023 21:52:51 +0200
>Author: Sebastian (em@ail.tld)
>Commiter: Sebastian (em@ail.tld)
### test: versions pump
>Tue, 3 Oct 2023 22:40:58 +0200
>Author: Sebastian (em@ail.tld)
>Commiter: Sebastian (em@ail.tld)
### feat: changelog (origin/patch_setExtention, patch_setExtention)
>Thu, 2 Mar 2023 11:58:58 +0100
>Author: Sebastian (em@ail.tld)
>Commiter: Sebastian (em@ail.tld)
### feat: add setextention
>Thu, 2 Mar 2023 11:58:29 +0100
>Author: Sebastian (em@ail.tld)
>Commiter: Sebastian (em@ail.tld)
### feat: test
>Thu, 2 Mar 2023 11:30:19 +0100
>Author: Sebastian (em@ail.tld)
>Commiter: Sebastian (em@ail.tld)
### docs: add changelog file (tag: v2.6.0, origin/patch-changeVersion)
>Tue, 10 Jan 2023 09:51:23 +0100
>Author: Marko Oldenburg (fhemdevelopment@cooltux.net)
>Commiter: Marko Oldenburg (fhemdevelopment@cooltux.net)
### docs: change verson numbers
>Tue, 10 Jan 2023 09:50:36 +0100
>Author: Marko Oldenburg (fhemdevelopment@cooltux.net)
@ -9,7 +129,7 @@ change modul versions
### test: add hooks (origin/patch-changeVersion)
### test: add hooks
>Tue, 10 Jan 2023 09:48:39 +0100
>Author: Marko Oldenburg (fhemdevelopment@cooltux.net)
@ -20,7 +140,7 @@ hooks for commit test and create changelog
### [translaten] - add commandref translation
### [translaten] - add commandref translation (origin/patch-fix_commandref_spell, patch-fix_commandref_spell)
>Sun, 18 Sep 2022 08:52:43 +0200
>Author: Sebastian (em@ail.tld)
@ -40,7 +160,7 @@ hooks for commit test and create changelog
### [enhancement] - commandref
### [enhancement] - commandref (origin/patch-wc_rest_valve_and_additinal_commandref, patch-wc_rest_valve_and_additinal_commandref)
>Tue, 6 Sep 2022 12:32:40 +0200
>Author: Sebastian (em@ail.tld)
@ -90,7 +210,7 @@ hooks for commit test and create changelog
### [fix] - upper/lower case
### [fix] - upper/lower case (origin/patch-offline_status_startup_undefined, patch-offline_status_startup_undefined)
>Thu, 11 Aug 2022 14:25:19 +0200
>Author: Sebastian (em@ail.tld)
@ -380,7 +500,7 @@ hooks for commit test and create changelog
### readd lost setter webinterface
### readd lost setter webinterface (origin/patch-dev_merge_failed_electronic_pressure_pump, patch-dev_merge_failed_electronic_pressure_pump)
>Wed, 13 Jul 2022 20:56:47 +0200
>Author: Sebastian (em@ail.tld)
@ -401,7 +521,7 @@ hooks for commit test and create changelog
### „FHEM/74_GardenaSmartDevice.pm“ ändern
### „FHEM/74_GardenaSmartDevice.pm“ ändern (origin/patch_electronic_pressure_pump_water_pump_name_mistake)
>Tue, 12 Jul 2022 20:09:33 +0200
>Author: Sebastian Schwaz (sebastianschwarz@noreply@cooltux.net)
@ -621,7 +741,7 @@ hooks for commit test and create changelog
### [fix] - setter procedure
### [fix] - setter procedure (origin/patch_pressure_pump_setlist, patch_pressure_pump_setlist)
>Wed, 29 Jun 2022 20:32:00 +0200
>Author: Sebastian (em@ail.tld)
@ -771,7 +891,7 @@ hooks for commit test and create changelog
### patch lono. eventuell recrusive readings einbauen. waterpump rechtschreibfehler mit fixed
### patch lono. eventuell recrusive readings einbauen. waterpump rechtschreibfehler mit fixed (origin/patch_lona, patch_lona)
>Sat, 25 Jun 2022 12:58:59 +0200
>Author: Sebastian (em@ail.tld)
@ -1151,7 +1271,7 @@ hooks for commit test and create changelog
### lona
### lona (origin/patch_waterpump, patch_waterpump)
>Tue, 17 May 2022 20:53:37 +0200
>Author: Sebastian (em@ail.tld)
@ -1541,7 +1661,7 @@ hooks for commit test and create changelog
### round minutes in irregation
### round minutes in irregation (origin/patch_water_control)
>Tue, 12 Apr 2022 08:40:40 +0200
>Author: Sebastian (em@ail.tld)
@ -1681,7 +1801,7 @@ hooks for commit test and create changelog
### fix state
### fix state (origin/patch_add_sensor2)
>Tue, 5 Apr 2022 09:23:34 +0200
>Author: Sebastian (em@ail.tld)
@ -1711,7 +1831,7 @@ hooks for commit test and create changelog
### fix ic24
### fix ic24 (origin/patch_ic24_schedule)
>Tue, 29 Mar 2022 16:35:58 +0200
>Author: Sebastian (em@ail.tld)

View File

@ -628,8 +628,13 @@ sub ErrorHandling {
if ( $param->{code} == 400 ) {
if ($decode_json) {
if ( ref( $decode_json->{errors} ) eq "ARRAY"
&& defined( $decode_json->{errors} ) )
&& exists( $decode_json->{errors} ) )
# replace defined with exists
# && defined( $decode_json->{errors} ) )
{
# $decode_json->{errors} -> ARRAY
# $decode_json->{errors}[0] -> HASH
if (exists ($decode_json->{errors}[0]{error}) ) {
readingsBulkUpdate(
$dhash,
"state",
@ -648,6 +653,7 @@ sub ErrorHandling {
"GardenaSmartBridge ($dname) - RequestERROR: "
. $decode_json->{errors}[0]{error} . " "
. $decode_json->{errors}[0]{attribute};
} # fi exists error
}
}
else {
@ -1053,6 +1059,14 @@ 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]
{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]
@ -1071,35 +1085,15 @@ sub WriteReadings {
&& ref($v) eq 'HASH'
)
{
if ( $decode_json->{abilities}[0]{properties}
[$properties]{name} eq 'ethernet_status' )
{
if ($v->{is_connected} ) {
readingsBulkUpdateIfChanged( $hash,
'ethernet_status-mac', $v->{mac} );
readingsBulkUpdateIfChanged( $hash,
'ethernet_status-ip', $v->{ip} )
$decode_json->{abilities}[0]{properties}[$properties]{name}.'-ip', $v->{ip} )
if ( ref( $v->{ip} ) ne 'HASH' );
readingsBulkUpdateIfChanged( $hash,
'ethernet_status-isconnected',
$v->{isConnected} );
}
elsif ( $decode_json->{abilities}[0]{properties}
[$properties]{name} eq 'wifi_status' )
{
readingsBulkUpdateIfChanged( $hash,
'wifi_status-ssid', $v->{ssid} )
if ( ref( $v->{ssid} ) ne 'HASH' );
readingsBulkUpdateIfChanged( $hash,
'wifi_status-mac', $v->{mac} );
readingsBulkUpdateIfChanged( $hash,
'wifi_status-ip', $v->{ip} )
if ( ref( $v->{ip} ) ne 'HASH' );
readingsBulkUpdateIfChanged( $hash,
'wifi_status-isconnected', $v->{isConnected} );
readingsBulkUpdateIfChanged( $hash,
'wifi_status-signal', $v->{signal} );
}
$decode_json->{abilities}[0]{properties}[$properties]{name}.'-isconnected', $v->{is_connected} )
if ( $v->{is_connected} );
}
} # fi ethernet and wifi
}
$properties--;
@ -1329,17 +1323,16 @@ 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';
$uri .=
'/devices/'
. $deviceId
. '/abilities/'
. $abilities
. '/properties/mower_timer';
. '/commands/manual_start';
}
elsif (defined($abilities)
@ -1575,7 +1568,7 @@ sub DeletePassword {
],
"release_status": "stable",
"license": "GPL_2",
"version": "v2.6.0",
"version": "v2.6.2",
"author": [
"Marko Oldenburg <fhemdevelopment@cooltux.net>"
],

View File

@ -67,6 +67,8 @@ use Time::Local;
use Time::Piece;
use Time::Seconds;
use SetExtensions;
# try to use JSON::MaybeXS wrapper
# for chance of better performance + open code
eval {
@ -142,7 +144,8 @@ BEGIN {
modules
IOWrite
defs
makeDeviceName)
makeDeviceName
SetExtensions)
);
}
@ -321,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' ) {
@ -336,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' ) {
@ -561,6 +564,7 @@ sub Set {
$abilities = 'winter_settings';
$service_id = $hash->{helper}->{'winter_mode_id'};
}
else {
my $list = '';
@ -613,7 +617,9 @@ sub Set {
# all devices has abilitie to fall a sleep
$list .= ' winter_mode:awake,hibernate';
return "Unknown argument $cmd, choose one of $list";
return SetExtensions( $hash, $list, $name, $cmd, @$aArg );
# return "Unknown argument $cmd, choose one of $list";
}
$hash->{helper}{deviceAction} = $payload;
@ -748,6 +754,8 @@ sub WriteReadings {
. $propertie->{name} ne 'ic24-valves_connected'
&& $decode_json->{abilities}[$abilities]{name} . '-'
. $propertie->{name} ne 'ic24-valves_master_config'
&& ($decode_json->{abilities}[$abilities]{name} . '-'
. $propertie->{name}) !~ /scheduling-timeslot_state_\d/
&& ref( $propertie->{value} ) ne "HASH" );
readingsBulkUpdateIfChanged(
@ -844,7 +852,28 @@ sub WriteReadings {
}
}
}
# 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(
$hash,
@ -901,15 +930,15 @@ sub WriteReadings {
foreach my $dev_schedules ( sort keys %{ $hash->{READINGS} } ) {
my $dev_reading = ReadingsVal( $name, $dev_schedules, "error" );
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
if $dev_schedules =~
/schedule.*_(\d)_id/; # push readigs d from x_id
/schedule.*_(\d+)_id/; # push readigs d from x_id
Log3 $name, 5,
"[DEBUG] $name - Schedule - Key ist : $dev_schedules ";
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);
@ -945,15 +974,12 @@ sub WriteReadings {
&& scalar(@soll) != scalar( @ist / 2 ) )
{
while ( my $old_schedule_id = shift(@ist) ) {
if ( length($old_schedule_id) == 1 ) {
foreach ( keys %{ $hash->{READINGS} } ) {
delete $hash->{READINGS}->{$_}
if ( $_ =~
/scheduling-schedules_event_$old_schedule_id.*/ );
}
if ( $_ =~ /scheduling-schedules_event_${old_schedule_id}_.*/ );
} # fi
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;
}
}
@ -987,7 +1013,7 @@ sub WriteReadings {
}
; # fi scheduled_events
my $winter_mode;
my $winter_mode = 'awake';
do {
#Log3 $name, 1, "Settings pro Device : ".$decode_json->{settings}[$settings]{name};
@ -1683,7 +1709,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.<br>
</ul>
<br>
<div style="display: none">
<div>
<a id="GardenaSmartDevice-set"></a>
<li><a id="GardenaSmartDevice-set-parkUntilFurtherNotice">parkUntilFurtherNotice</a> - park mower and disable schedule</li>
<li><a id="GardenaSmartDevice-set-parkUntilNextTimer">parkUntilNextTimer</a> - park mower until next schedule</li>
@ -2149,7 +2175,7 @@ sub SetPredefinedStartPoints {
Steckdosen-Adapter und Pumpe. Zeitpl&auml;ne k&ouml;nnen &uuml;ber fhem pausiert/aktiviert werden, das Anlegen oder L&ouml;schen erfolgt
derzeit nur &uuml;ber die App oder deren Web-Frontend.
</ul>
<div style="display: none">
<div>
<a id="GardenaSmartDevice-set"></a>
<li><a id="GardenaSmartDevice-set-parkUntilFurtherNotice">parkUntilFurtherNotice</a> - Parken des M&auml;hers und Aussetzen des Zeitplans</li>
<li><a id="GardenaSmartDevice-set-parkUntilNextTimer">parkUntilNextTimer</a> - Parken bis zum n&auml;chsten Start nach Zeitplan</li>
@ -2678,7 +2704,7 @@ sub SetPredefinedStartPoints {
],
"release_status": "stable",
"license": "GPL_2",
"version": "v2.6.0",
"version": "v2.6.2",
"author": [
"Marko Oldenburg <fhemdevelopment@cooltux.net>"
],

View File

@ -1,2 +1,2 @@
UPD 2023-01-10_09:49:28 49646 FHEM/73_GardenaSmartBridge.pm
UPD 2023-01-10_09:49:45 126305 FHEM/74_GardenaSmartDevice.pm
UPD 2024-04-15_09:21:58 49572 FHEM/73_GardenaSmartBridge.pm
UPD 2024-04-15_09:32:30 127663 FHEM/74_GardenaSmartDevice.pm