diff --git a/FHEM/74_GardenaSmartDevice.pm b/FHEM/74_GardenaSmartDevice.pm index 1756705..2b9b35a 100644 --- a/FHEM/74_GardenaSmartDevice.pm +++ b/FHEM/74_GardenaSmartDevice.pm @@ -63,6 +63,8 @@ use warnings; use POSIX; use FHEM::Meta; use Time::Local; +use Time::Piece; +use Time::Seconds; # try to use JSON::MaybeXS wrapper # for chance of better performance + open code @@ -405,12 +407,14 @@ sub Set { } elsif ( $cmd =~ /.*ScheduleValve/ ){ my $valve_id = $aArg->[0]; + my $duration = (( defined($aArg->[1]) ? ( ((Time::Piece->new)+(ONE_HOUR * $aArg->[1]))->datetime ).'.000Z' : '2040-12-31T22:00:00.000Z')); + $abilities = 'irrigation_settings'; $service_id = $hash->{helper}->{'schedules_paused_until_'.$valve_id.'_id'}; $payload = '"settings":{"name":"schedules_paused_until_' . $valve_id . '", "value":"' - . ($cmd eq 'resumeScheduleValve' ? '' : '2040-12-31T22:00:00.000Z') + . ($cmd eq 'resumeScheduleValve' ? '' : $duration ) . '","device":"' . $hash->{DEVICEID} . '"}'; @@ -1130,6 +1134,10 @@ sub SetPredefinedStartPoints {
  • set NAME startpoint enable 1
  • set NAME startpoint disable 3 enable 1
  • + +
  • resumeScheduleValve - start schedule irrigation on valve n
  • +
  • stopScheduleValve - stop schedule irrigation on valve n (Default: 2040-12-31T22) | optional params hours (now + hours)
  • +
  • closeAllValves - close all valves
  • @@ -1274,6 +1282,9 @@ sub SetPredefinedStartPoints {
  • set NAME startpoint enable 1
  • set NAME startpoint disable 3 enable 1
  • +
  • resumeScheduleValve - Startet Bew&aauml;sserung am Ventil n nach Zeitplan
  • +
  • stopScheduleValve - Setzt Bew&aauml;sserung am Ventil n aus (Default: 2040-12-31T22) | Optionaler Parameter Stunden (Jetzt + Stunden)
  • +
  • closeAllValves - Stopt Bew&aauml;sserung an allen Ventilen
  • diff --git a/controls_GardenaSmartDevice.txt b/controls_GardenaSmartDevice.txt index 31d038e..0cc421c 100644 --- a/controls_GardenaSmartDevice.txt +++ b/controls_GardenaSmartDevice.txt @@ -1,2 +1,2 @@ UPD 2021-05-16_21:23:09 46133 FHEM/73_GardenaSmartBridge.pm -UPD 2021-05-17_18:30:20 50836 FHEM/74_GardenaSmartDevice.pm +UPD 2021-05-18_21:27:40 51588 FHEM/74_GardenaSmartDevice.pm