ich habe mittlerweile meinen Wemos D1 mini (PRO) mit externer WiFi-Antenne im Automower AC220 in Betrieb genommen. Angeschlossen ist der Wemos an der internen Pin-Leiste. Im Netzt gibt es genügend Erläuterungen welcher PIN wo steht. In Tasmota habe ich den Serial-Log komlpett ausgeschalten.
Das Gerät läuft seit gut 2 Wochen ohne Tadel. Anbindung an IP Symcon als Smarthome-Server über MQTT funktioniert mittlerweile auch zufriedenstellend.
Ich hatte zunächst etwas Probleme mit den MQTT Befehlen aus Symcon. Ich hatte einige Tage damit verbracht Scripte in Symcon zu testen, damit die Kommunikation aus IP Symcon auch entsprechend funktioniert.
Die Variable "Automower AutoHome" dient zur Rückmeldung an den Mower um die Befehle abzusetzen und reagiert auf eine Änderung der Variable "Auto_Home", die im Prinzip nur für die Anzeige im Webfront und das Schalten von dort benötigt wird. Es wird dann in den beiden Ereignissen entweder "AUTO" oder "HOME" an den Mower gesandt:
Hier noch das PHP-Skript zum Auslesen und weiterverarbeiten der Sensorwerte und Statusmeldungen (ich habe mich hier bei diversen Quellen im IP-Symcon Forum bedient und tlw. ergänzt):
<?php
//Automower Status auslesen und in Variablen schreiben
$content = getvalue(36926);
$json = json_decode($content, 1);
print_r($json);
//Werte aus Array auslesen
$time = $json['Time'];
$status = $json['status'];
$sstate = $json['sstate'];
$mow_time = $json['mow time'];
$time_since_chg = $json['time since chg'];
$batt_current = $json['batt current'];
$batt_charge_time = $json['batt charge time'];
$batt_charged = $json['batt charged'];
$batt_temp = $json['batt temp'];
$batt_used = $json['batt used'];
$batt_voltage = $json['batt voltage']/1000;
$batt_capacity = $json['batt capacity'];
$batt_rest = ($batt_used/$batt_capacity)*100;
// Werte in Variablen übergeben
setvalue(24390,$batt_capacity);
setvalue(44256,$batt_voltage);
setvalue(55661,$batt_temp);
setvalue(36339,$time);
setvalue(14269,$batt_current);
setvalue(19487,$time_since_chg);
setvalue(16315,$mow_time);
setvalue(34687,$batt_rest);
setvalue(54501,$status);
// Statusmeldungen
$statusArray = array(
array("Value" => 0, "Maehe" => 0, "Type" => "NOTIFICATION", "Text" => "Mode MAN quittiert"),
array("Value" => 1, "Maehe" => 0, "Type" => "NOTIFICATION", "Text" => "Mode AUTO quittiert"),
array("Value" => 3, "Maehe" => 0, "Type" => "NOTIFICATION", "Text" => "Mode HOME quittiert"),
array("Value" => 6, "Maehe" => 0, "Type" => "ALERT", "Text" => "Rad links blockiert"),
array("Value" => 10, "Maehe" => 0, "Type" => "ALERT", "Text" => "Befinde mich außerhalb"),
array("Value" => 12, "Maehe" => 0, "Type" => "ALERT", "Text" => "Kein Schleifensignal"),
array("Value" => 16, "Maehe" => 0, "Type" => "ALERT", "Text" => "Befinde mich außerhalb"),
array("Value" => 18, "Maehe" => 0, "Type" => "ALERT", "Text" => "Niedrige Batteriespannung"),
array("Value" => 26, "Maehe" => 0, "Type" => "ALERT", "Text" => "in Ladestation blockiert"),
array("Value" => 28, "Maehe" => 0, "Type" => "ALERT", "Text" => "Manuelles Laden erforderlich"),
array("Value" => 30, "Maehe" => 0, "Type" => "ALERT", "Text" => "Messer blockiert"),
array("Value" => 34, "Maehe" => 0, "Type" => "ALERT", "Text" => "Mäher hochgehoben"),
array("Value" => 52, "Maehe" => 0, "Type" => "ALERT", "Text" => "Kein Kontakt in Ladestation"),
array("Value" => 54, "Maehe" => 0, "Type" => "ALERT", "Text" => "PIN abgelaufen"),
array("Value" => 1000, "Maehe" => 0, "Type" => "WORKING", "Text" => "Ladestation verlassen"),
array("Value" => 1002, "Maehe" => 1, "Type" => "WORKING", "Text" => "Mähen"),
array("Value" => 1006, "Maehe" => 0, "Type" => "WORKING", "Text" => "Mähwerk starten"),
array("Value" => 1008, "Maehe" => 1, "Type" => "WORKING", "Text" => "Mähwerk gestartet"),
array("Value" => 1012, "Maehe" => 0, "Type" => "WORKING", "Text" => "Signal starte Mähwerk"),
array("Value" => 1014, "Maehe" => 0, "Type" => "WAITING", "Text" => "In Ladestation ladend"),
array("Value" => 1016, "Maehe" => 0, "Type" => "WAITING", "Text" => "In Ladestation wartend"),
array("Value" => 1024, "Maehe" => 0, "Type" => "WORKING", "Text" => "Aus Ladestation ausfahren"),
array("Value" => 1036, "Maehe" => 1, "Type" => "WORKING", "Text" => "Viereckmodus"),
array("Value" => 1038, "Maehe" => 0, "Type" => "ALERT", "Text" => "Festgefahren"),
array("Value" => 1040, "Maehe" => 1, "Type" => "WORKING", "Text" => "Kollission / Schleife erreicht"),
array("Value" => 1042, "Maehe" => 0, "Type" => "WORKING", "Text" => "Suche Ladestation"),
array("Value" => 1044, "Maehe" => 0, "Type" => "WAITING", "Text" => "Stop"),
array("Value" => 1048, "Maehe" => 0, "Type" => "WORKING", "Text" => "Andocken"),
array("Value" => 1050, "Maehe" => 0, "Type" => "WORKING", "Text" => "Aus Ladestation fahren"),
array("Value" => 1052, "Maehe" => 0, "Type" => "WAITING", "Text" => "Bitte Yes drücken"),
array("Value" => 1056, "Maehe" => 0, "Type" => "WAITING", "Text" => "Wartend (Manuell/Home)"),
array("Value" => 1058, "Maehe" => 0, "Type" => "WORKING", "Text" => "Bregrenzung folgend"),
array("Value" => 1060, "Maehe" => 0, "Type" => "WORKING", "Text" => "N-Signal gefunden"),
array("Value" => 1062, "Maehe" => 0, "Type" => "WORKING", "Text" => "Folge Schleife zur L/S"),
array("Value" => 1064, "Maehe" => 0, "Type" => "WORKING", "Text" => "Suche Ladestation"),
array("Value" => 1070, "Maehe" => 0, "Type" => "WORKING", "Text" => "Suchschleife folgen"),
array("Value" => 1072, "Maehe" => 0, "Type" => "WORKING", "Text" => "Schleife folgen")
);
print_r($statusArray);
echo $status;
for ($index = 0; $index < count($statusArray); $index++) {
if ($status == $statusArray[$index]["Value"]) {
break;
}
}
if ($index < count($statusArray)) {
echo " -> found index $index\n";
$statustext = $statusArray[$index]["Text"];
$type = $statusArray[$index]["Type"];
echo $statustext;
echo $type;
setvalue(24805, $statustext);
if ($type == "ALERT") {
WFC_PushNotification(24876, 'Automower ALARM', $statustext, 'alarm', 0);
SetValueBoolean(44848, true);
} else {
SetValueBoolean(44848, false);
}
} else {
echo "not found\n";
}
Alles anzeigen
Die jeweiligen Variablen sind entsprechend als Float, String oder Boolean anzulegen. Das sollte für Symcon Nutzer selbstredend sein