diff --git a/fhem/CHANGED b/fhem/CHANGED index dcbd6e64f..7c7d598a8 100644 --- a/fhem/CHANGED +++ b/fhem/CHANGED @@ -1,5 +1,6 @@ # Add changes at the top of the list. Keep it in ASCII, and 80-char wide. # Do not insert empty lines here, update check depends on it + - feature: 74_AutomowerConnect: new setter for synchronizing mower timestamp - bufgix: 72_FRITZBOX: kleinere Fehler bei zu alten FritzOS Versionen - feature: 72_FRITZBOX: Neue Readings box_pwr_... Aktivierbar über Attribut enableBoxReadings diff --git a/fhem/FHEM/74_AutomowerConnect.pm b/fhem/FHEM/74_AutomowerConnect.pm index d36903003..042793ce8 100644 --- a/fhem/FHEM/74_AutomowerConnect.pm +++ b/fhem/FHEM/74_AutomowerConnect.pm @@ -191,6 +191,10 @@ __END__ set <name> Start <number of minutes>
Starts immediately for <number of minutes> +
  • dateTime
    + set <name> dateTime <RTC and DST time corretion / h >
    + Syncronize the mower time. The proposal is for RTC = UTC and DST for CET(MEZ)
  • +
  • confirmError
    set <name> confirmError
    Testing: Confirm current error on the mower. Will only work if current error is considered confirmable by the mower. Available for models 405X, 415X, 435X AWD and 535 AWD. Also available on all Ceora, EPOS and NERA models.
  • @@ -715,6 +719,10 @@ __END__ Testing: Schaltet stayOutZone ein oder aus, für die Id oder den Namen der Zone.
    Der Zonenname darf keine Leerzeichen beinhalten und muss mindestens einen Buchstaben enthalten. +
  • dateTime
    + set <name> dateTime <RTC and DST time corretion / h >
    + Synchronisiert die Zeit im Mäher. Der im Auswahlfeld vorgeschlagene Korrekturwert geht davon aus, dass die RTC auf UTC eingestellt ist und berücksichtigt DST für CET(MEZ).
  • +
  • confirmError
    set <name> confirmError
    Testing: Bestätigt den letzten Fehler im Mäher, wenn der Mäher es zulässt. Verfügbar für 405X, 415X, 435X AWD and 535 AWD und alle Ceora, EPOS and NERA.
  • diff --git a/fhem/lib/FHEM/Devices/AMConnect/Common.pm b/fhem/lib/FHEM/Devices/AMConnect/Common.pm index 50e9736e4..2838c341c 100644 --- a/fhem/lib/FHEM/Devices/AMConnect/Common.pm +++ b/fhem/lib/FHEM/Devices/AMConnect/Common.pm @@ -1170,6 +1170,8 @@ sub Set { my $type = $hash->{TYPE}; my $name = $hash->{NAME}; my $iam = "$type $name Set:"; + my @ti = localtime(); + my $tcorr = ($ti[8] ? '2,1,0' : '1,2,0 '); return "$iam: needs at least one argument" if ( @val < 2 ); return "Unknown argument, $iam is disabled, choose one of none:noArg" if ( IsDisabled( $name ) ); @@ -1305,7 +1307,7 @@ sub Set { return undef; ########## - } elsif ( ReadingsVal( $name, 'device_state', 'defined' ) !~ /defined|initialized|authentification|authenticated|update/ && $setName eq "sendJsonScheduleToMower" ) { + } elsif ( ReadingsVal( $name, 'device_state', 'defined' ) !~ /defined|initialized|authentification|authenticated|update/ && $setName =~ /sendJsonScheduleToMower|dateTime/ ) { CMD($hash,$setName,$setVal); return undef; @@ -1353,7 +1355,7 @@ sub Set { } ########## - my $ret = " getNewAccessToken:noArg ParkUntilFurtherNotice:noArg ParkUntilNextSchedule:noArg Pause:noArg Start:selectnumbers,30,30,600,0,lin Park:selectnumbers,30,30,600,0,lin ResumeSchedule:noArg getUpdate:noArg client_secret "; + my $ret = " getNewAccessToken:noArg ParkUntilFurtherNotice:noArg ParkUntilNextSchedule:noArg Pause:noArg Start:selectnumbers,30,30,600,0,lin Park:selectnumbers,30,30,600,0,lin ResumeSchedule:noArg getUpdate:noArg client_secret dateTime:$tcorr "; $ret .= "mowerScheduleToAttribute:noArg sendScheduleFromAttributeToMower:noArg "; $ret .= "cuttingHeight:1,2,3,4,5,6,7,8,9 " if ( defined $hash->{helper}{mower}{attributes}{settings}{cuttingHeight} ); $ret .= "defaultDesignAttributesToAttribute:noArg mapZonesTemplateToAttribute:noArg chargingStationPositionToAttribute:noArg " if ( $hash->{helper}{mower}{attributes}{capabilities}{position} ); @@ -1412,7 +1414,6 @@ sub CMD { my $json = ''; my $post = ''; - my $header = "Accept: application/vnd.api+json\r\nX-Api-Key: ".$client_id."\r\nAuthorization: Bearer " . $token . "\r\nAuthorization-Provider: " . $provider . "\r\nContent-Type: application/vnd.api+json"; @@ -1429,6 +1430,7 @@ my $header = "Accept: application/vnd.api+json\r\nX-Api-Key: ".$client_id."\r\nA elsif ($cmd[0] eq "StartInWorkArea" && !$cmd[2]) { $json = '{"data": {"type":"'.$cmd[0].'","attributes":{"workAreaId":'.$cmd[1].'}}}'; $post = 'actions' } elsif ($cmd[0] eq "headlight") { $json = '{"data": {"type":"settings","attributes":{"'.$cmd[0].'": {"mode": "'.$cmd[1].'"}}}}'; $post = 'settings' } + elsif ($cmd[0] eq "dateTime") { $json = '{"data": {"type":"settings","attributes":{"'.$cmd[0].'": '.int(time + $cmd[1] * 3600).'}}}'; $post = 'settings' } elsif ($cmd[0] eq "cuttingHeight") { $json = '{"data": {"type":"settings","attributes":{"'.$cmd[0].'": '.$cmd[1].'}}}'; $post = 'settings' } elsif ($cmd[0] eq "stayOutZone") { $json = '{"data": {"type":"stayOutZone","id":"'.$cmd[1].'","attributes":{"enable": '.$cmd[2].'}}}'; $post = 'stayOutZones/' . $cmd[1]; $method = 'PATCH' } elsif ($cmd[0] eq "confirmError") { $json = '{}'; $post = 'errors/confirm' }