2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-01-31 06:39:11 +00:00

74_AutomowerConnect: new setter for synchronizing mower timestamp

git-svn-id: https://svn.fhem.de/fhem/trunk@29221 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
Ellert 2024-10-11 11:36:00 +00:00
parent 59223dc403
commit bffd121c72
3 changed files with 14 additions and 3 deletions

View File

@ -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

View File

@ -191,6 +191,10 @@ __END__
<code>set &lt;name&gt; Start &lt;number of minutes&gt;</code><br>
Starts immediately for &lt;number of minutes&gt;</li>
<li><a id='AutomowerConnect-set-dateTime'>dateTime</a><br>
<code>set &lt;name&gt; dateTime &lt;RTC and DST time corretion / h &gt;</code><br>
Syncronize the mower time. The proposal is for RTC = UTC and DST for CET(MEZ) </li>
<li><a id='AutomowerConnect-set-confirmError'>confirmError</a><br>
<code>set &lt;name&gt; confirmError</code><br>
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.</li>
@ -715,6 +719,10 @@ __END__
Testing: Schaltet stayOutZone ein oder aus, für die Id oder den Namen der Zone.<br>
Der Zonenname darf keine Leerzeichen beinhalten und muss mindestens einen Buchstaben enthalten.</li>
<li><a id='AutomowerConnect-set-dateTime'>dateTime</a><br>
<code>set &lt;name&gt; dateTime &lt;RTC and DST time corretion / h &gt;</code><br>
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).</li>
<li><a id='AutomowerConnect-set-confirmError'>confirmError</a><br>
<code>set &lt;name&gt; confirmError</code><br>
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.</li>

View File

@ -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} );
@ -1413,7 +1415,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";
if ($cmd[0] eq "ParkUntilFurtherNotice") { $json = '{"data":{"type":"'.$cmd[0].'"}}'; $post = 'actions' }
@ -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' }