add commandref, more language setup options

This commit is contained in:
Marko Oldenburg 2017-08-23 21:56:43 +02:00
parent 22610db354
commit dff4eb28dc
2 changed files with 400 additions and 13 deletions

View File

@ -5,6 +5,11 @@
# (c) 2017 Copyright: Marko Oldenburg (leongaultier at gmail dot com)
# All rights reserved
#
# Special thanks goes to comitters:
# - Michael (mbrak) Thanks for Commandref
# - Matthias (Kenneth) Thanks for Wiki entry
#
#
# This script is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
@ -65,7 +70,7 @@ eval "use IO::Socket::SSL;1" or $missingModul .= "IO::Socket::SSL ";
###todo Hier fehlt noch Modulabfrage für ssl
my $version = "0.0.58";
my $version = "0.1.0";
@ -746,17 +751,128 @@ sub GardenaSmartBridge_ParseJSON($$) {
=pod
=item device
=item summary Gardena Smart
=item summary_DE Gardena Smart
=item summary Modul to communicate with the GardenaCloud
=item summary_DE Modul zur Datenübertragung zur GardenaCloud
=begin html
<a name="GardenaSmartBridge"></a>
<h3>GardenaSmartBridge</h3>
<ul>
<u><b>Prerequisite</b></u>
<br><br>
<li>In combination with GardenaSmartDevice this FHEM Module controls the communication between the GardenaCloud and connected Devices like Mover, Watering_Computer, Temperature_Sensors</li>
<li>Installation of the following packages: apt-get install libio-socket-ssl-perl</li>
<li>The Gardena-Gateway and all connected Devices must be correctly installed in the GardenaAPP</li>
</ul>
<br>
<a name="GardenaSmartBridgedefine"></a>
<b>Define</b>
<ul><br>
<code>define &lt;name&gt; GardenaSmartBridge &lt;Account-EMail&gt; &lt;Account-Passwort&gt;</code>
<br><br>
Beispiel:
<ul><br>
<code>define Gardena_Bridge GardenaSmartBridge me@email.me secret</code><br>
</ul>
<br>
&lt;Account-EMail&gt; Email Adresse which was used in the GardenaAPP<br>
&lt;Account-Passwort&gt; Passwort which was used in the GardenaAPP<br>
The GardenaSmartBridge device is created in the room GardenaSmart, then the devices of Your system are recognized automatically and created in FHEM. From now on the devices can be controlled and changes in the GardenaAPP are synchronized with the state and readings of the devices.
<br><br>
<a name="GardenaSmartBridgereadings"></a>
<br><br>
<b>Readings</b>
<ul>
<li>address - your Adress (Longversion)</li>
<li>authorized_user_ids - </li>
<li>city - Zip, City</li>
<li>devices - Number of Devices in the Cloud (Gateway included)</li>
<li>lastRequestState - Last Status Result</li>
<li>latitude - Breitengrad des Grundstücks</li>
<li>longitude - Längengrad des Grundstücks</li>
<li>name - Name of your Garden Default My Garden</li>
<li>state - State of the Bridge</li>
<li>token - SessionID</li>
<li>zones - </li>
</ul>
<br><br>
<a name="GardenaSmartBridgeset"></a>
<b>set</b>
<ul>
<li>getDeviceState - Starts a Datarequest</li>
<li>getToken - Gets a new Session-ID</li>
</ul>
<br><br>
<a name="GardenaSmartBridgeattributes"></a>
<b>Attributes</b>
<ul>
<li>debugJSON - </li>
<li>disable - Disables the Bridge</li>
<li>interval - Interval in Minutes (Default=5)</li>
</ul>
</ul>
=end html
=begin html_DE
<a name="GardenaSmartBridge"></a>
<h3>GardenaSmartBridge</h3>
<ul>
<u><b>Voraussetzungen</b></u>
<br><br>
<li>Zusammen mit dem Device GardenaSmartDevice stellt dieses FHEM Modul die Kommunikation zwischen der GardenaCloud und Fhem her. Es k&ouml;nnen damit Rasenm&auml;her, Bew&auml;sserungscomputer und Bodensensoren überwacht und gesteuert werden</li>
<li>Das Perl-Modul "SSL Packet" wird ben&ouml;tigt.</li>
<li>Unter Debian (basierten) System, kann dies mittels "apt-get install libio-socket-ssl-perl" installiert werden.</li>
<li>Das Gardena-Gateway und alle damit verbundenen Ger&auml;te und Sensoren m&uuml;ssen vorab in der GardenaApp eingerichtet sein.</li>
</ul>
<br>
<a name="GardenaSmartBridgedefine"></a>
<b>Define</b>
<ul><br>
<code>define &lt;name&gt; GardenaSmartBridge &lt;Account-EMail&gt; &lt;Account-Passwort&gt;</code>
<br><br>
Beispiel:
<ul><br>
<code>define Gardena_Bridge GardenaSmartBridge me@email.me secret</code><br>
</ul>
<br>
&lt;Account-EMail&gt; Email Adresse, die auch in der GardenaApp verwendet wurde<br>
&lt;Account-Passwort&gt; Passwort, welches in der GardenaApp verwendet wurde<br>
Das Bridge Device wird im Raum GardenaSmart angelegt und danach erfolgt das Einlesen und automatische Anlegen der Ger&auml;te. Von nun an k&ouml;nnen die eingebundenen Ger&auml;te gesteuert werden. &Auml;nderungen in der APP werden mit den Readings und dem Status syncronisiert.
<br><br>
<a name="GardenaSmartBridgereadings"></a>
<br><br>
<b>Readings</b>
<ul>
<li>address - Adresse, welche in der App eingetragen wurde (Langversion)</li>
<li>authorized_user_ids - </li>
<li>city - PLZ, Stadt</li>
<li>devices - Anzahl der Ger&auml;te, welche in der GardenaCloud angemeldet sind (Gateway z&auml;hlt mit)</li>
<li>lastRequestState - Letzter abgefragter Status der Bridge</li>
<li>latitude - Breitengrad des Grundst&uuml;cks</li>
<li>longitude - Längengrad des Grundst&uuml;cks</li>
<li>name - Name für das Grundst&uuml;ck Default My Garden</li>
<li>state - Status der Bridge</li>
<li>token - SessionID</li>
<li>zones - </li>
</ul>
<br><br>
<a name="GardenaSmartBridgeset"></a>
<b>set</b>
<ul>
<li>getDeviceState - Startet eine Abfrage der Daten.</li>
<li>getToken - Holt eine neue Session-ID</li>
</ul>
<br><br>
<a name="GardenaSmartBridgeattributes"></a>
<b>Attribute</b>
<ul>
<li>debugJSON - JSON Fehlermeldungen</li>
<li>disable - Schaltet die Daten&uuml;bertragung der Bridge ab</li>
<li>interval - Abfrageinterval in Sekunden (default: 300)</li>
</ul>
</ul>
=end html_DE
=cut

View File

@ -5,6 +5,11 @@
# (c) 2017 Copyright: Marko Oldenburg (leongaultier at gmail dot com)
# All rights reserved
#
# Special thanks goes to comitters:
# - Michael (mbrak) Thanks for Commandref
# - Matthias (Kenneth) Thanks for Wiki entry
#
#
# This script is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
@ -63,7 +68,7 @@ eval "use Encode qw(encode encode_utf8 decode_utf8);1" or $missingModul .= "Enco
eval "use JSON;1" or $missingModul .= "JSON ";
my $version = "0.0.58";
my $version = "0.1.0";
@ -95,8 +100,7 @@ sub GardenaSmartDevice_Initialize($) {
$hash->{ParseFn} = "GardenaSmartDevice_Parse";
$hash->{AttrFn} = "GardenaSmartDevice_Attr";
$hash->{AttrList} = "disable:1 ".
"readingValueLanguage:de ".
$hash->{AttrList} = "readingValueLanguage:de,en ".
"model ".
$readingFnAttributes;
@ -470,7 +474,7 @@ sub GardenaSmartDevice_ReadingLangGerman($$) {
'inactive' => 'nicht aktiv'
);
if( defined($langGermanMapp{$readingValue}) and (AttrVal('global','language','none') eq 'DE' or AttrVal($name,'readingValueLanguage','none') eq 'de') ) {
if( defined($langGermanMapp{$readingValue}) and (AttrVal('global','language','none') eq 'DE' or AttrVal($name,'readingValueLanguage','none') eq 'de') and AttrVal($name,'readingValueLanguage','none') ne 'en') {
return $langGermanMapp{$readingValue};
} else {
return $readingValue;
@ -520,17 +524,284 @@ sub GardenaSmartDevice_Zulu2LocalString($) {
=pod
=item device
=item summary Gardena Smart
=item summary_DE Gardena Smart
=item summary Modul to control GardenaSmart Devices
=item summary_DE Modul zur Steuerung von GardenaSmartger&aumlten
=begin html
<a name="GardenaSmartDevice"></a>
<h3>GardenaSmartDevice</h3>
<ul>
In combination with GardenaSmartBridge this FHEM Module controls the GardenaSmart Device using the GardenaCloud
<br><br>
Once the Bridge device is created, the connected devices are automatically recognized and created in FHEM. <br>
From now on the devices can be controlled and changes in the GardenaAPP are synchronized with the state and readings of the devices.
<a name="GardenaSmartDevicereadings"></a>
<br><br><br>
<b>Readings</b>
<ul>
<li>battery-charging - Indicator if the Battery is charged (0/1) or with newer Firmware (false/true)</li>
<li>battery-level - load percentage of the Battery</li>
<li>battery-rechargeable_battery_status - healthyness of the battery (out_of_operation/replace_now/low/ok)</li>
<li>device_info-category - category of device (mower/watering_computer)</li>
<li>device_info-last_time_online - timestamp of last radio contact</li>
<li>device_info-manufacturer - manufacturer</li>
<li>device_info-product - product type</li>
<li>device_info-serial_number - serial number</li>
<li>device_info-sgtin - </li>
<li>device_info-version - firmware version</li>
<li>firmware-firmware_command - firmware command (idle/firmware_cancel/firmware_upload/unsupported)</li>
<li>firmware-firmware_status - firmware status </li>
<li>firmware-firmware_update_start - indicator when a firmwareupload is started</li>
<li>firmware-firmware_upload_progress - progress indicator of firmware update</li>
<li>firmware-inclusion_status - inclusion status</li>
<li>internal_temperature-temperature - internal device temperature</li>
<li>mower-error - actual error message
<ul>
<li>no_message</li>
<li>outside_working_area</li>
<li>no_loop_signal</li>
<li>wrong_loop_signal</li>
<li>loop_sensor_problem_front</li>
<li>loop_sensor_problem_rear</li>
<li>trapped</li>
<li>upside_down</li>
<li>low_battery</li>
<li>empty_battery</li>
<li>no_drive</li>
<li>lifted</li>
<li>stuck_in_charging_station</li>
<li>charging_station_blocked</li>
<li>collision_sensor_problem_rear</li>
<li>collision_sensor_problem_front</li>
<li>wheel_motor_blocked_right</li>
<li>wheel_motor_blocked_left</li>
<li>wheel_drive_problem_right</li>
<li>wheel_drive_problem_left</li>
<li>cutting_system_blocked</li>
<li>invalid_sub_device_combination</li>
<li>settings_restored</li>
<li>electronic_problem</li>
<li>charging_system_problem</li>
<li>tilt_sensor_problem</li>
<li>wheel_motor_overloaded_right</li>
<li>wheel_motor_overloaded_left</li>
<li>charging_current_too_high</li>
<li>temporary_problem</li>
<li>guide_1_not_found</li>
<li>guide_2_not_found</li>
<li>guide_3_not_found</li>
<li>difficult_finding_home</li>
<li>guide_calibration_accomplished</li>
<li>guide_calibration_failed</li>
<li>temporary_battery_problem</li>
<li>battery_problem</li>
<li>alarm_mower_switched_off</li>
<li>alarm_mower_stopped</li>
<li>alarm_mower_lifted</li>
<li>alarm_mower_tilted</li>
<li>connection_changed</li>
<li>connection_not_changed</li>
<li>com_board_not_available</li>
<li>slipped</li>
</ul>
</li>
<li>mower-manual_operation - (0/1) or with newer Firmware (false/true)</li>
<li>mower-override_end_time - manual override end time</li>
<li>mower-source_for_next_start - source for the next start
<ul>
<li>no_source</li>
<li>mower_charging</li>
<li>completed_cutting_autotimer</li>
<li>week_timer</li>
<li>countdown_timer</li>
<li>undefined</li>
</ul>
</li>
<li>mower-status - mower state (see state)</li>
<li>mower-timestamp_next_start - timestamp of next scheduled start</li>
<li>radio-connection_status - state of connection</li>
<li>radio-quality - percentage of the radio quality</li>
<li>radio-state - radio state (bad/poor/good/undefined)</li>
<li>state - state of the mower
<ul>
<li>paused</li>
<li>ok_cutting</li>
<li>ok_searching</li>
<li>ok_charging</li>
<li>ok_leaving</li>
<li>wait_updating</li>
<li>wait_power_up</li>
<li>parked_timer</li>
<li>parked_park_selected</li>
<li>off_disabled</li>
<li>off_hatch_open</li>
<li>unknown</li>
<li>error</li>
<li>error_at_power_up</li>
<li>off_hatch_closed</li>
<li>ok_cutting_timer_overridden</li>
<li>parked_autotimer</li>
<li>parked_daily_limit_reached</li>
</ul>
</li>
</ul>
<br><br>
<a name="GardenaSmartDeviceattributes"></a>
<b>Attributes</b>
<ul>
<li>readingValueLanguage - Change the Language of Readings (de,en/if not set the default is english and the global language is not set at german) </li>
<li>model - </li>
</ul>
<br><br>
<a name="GardenaSmartDeviceset"></a>
<b>set</b>
<ul>
<li>parkUntilFurtherNotice</li>
<li>parkUntilNextTimer</li>
<li>startOverrideTimer - 0 to 59 Minutes</li>
<li>startResumeSchedule</li>
</ul>
</ul>
=end html
=begin html_DE
<a name="GardenaSmartDevice"></a>
<h3>GardenaSmartDevice</h3>
<ul>
Zusammen mit dem Device GardenaSmartDevice stellt dieses FHEM Modul die Kommunikation zwischen der GardenaCloud und Fhem her.
<br><br>
Wenn das GardenaSmartBridge Device erzeugt wurde, werden verbundene Ger&auml;te automatisch erkannt und in Fhem angelegt.<br>
Von nun an k&ouml;nnen die eingebundenen Ger&auml;te gesteuert werden. &Auml;nderungen in der APP werden mit den Readings und dem Status syncronisiert.
<a name="GardenaSmartDevicereadings"></a>
</ul>
<br>
<ul>
<b>Readings</b>
<ul>
<li>battery-charging - Ladeindikator (0/1) oder mit neuerer Firmware (false/true)</li>
<li>battery-level - Ladezustand der Batterie in Prozent</li>
<li>battery-rechargeable_battery_status - Zustand der Batterie (Ausser Betrieb/Kritischer Batteriestand, wechseln Sie jetzt/Niedrig/oK)</li>
<li>device_info-category - Eigenschaft des Ger&Auml;tes (M&auml;her/Bew&auml;sserungscomputer/Bodensensor)</li>
<li>device_info-last_time_online - Zeitpunkt der letzten Funk&uuml;bertragung</li>
<li>device_info-manufacturer - Hersteller</li>
<li>device_info-product - Produkttyp</li>
<li>device_info-serial_number - Seriennummer</li>
<li>device_info-sgtin - </li>
<li>device_info-version - Firmware Version</li>
<li>firmware-firmware_command - Firmware Kommando (Nichts zu tun/Firmwareupload unterbrochen/Firmwareupload/nicht unterst&uuml;tzt)</li>
<li>firmware-firmware_status - Firmware Status </li>
<li>firmware-firmware_update_start - Firmwareupdate (0/1) oder mit neuerer Firmware (false/true)</li>
<li>firmware-firmware_upload_progress - Firmwareupdatestatus in Prozent</li>
<li>firmware-inclusion_status - Einbindungsstatus</li>
<li>internal_temperature-temperature - Interne Ger&auml;te Temperatur</li>
<li>mower-error - Aktuelle Fehler Meldung
<ul>
<li>Kein Fehler</li>
<li>Au&szl;igerhalb des Arbeitsbereichs</li>
<li>Kein Schleifensignal</li>
<li>Falsches Schleifensignal</li>
<li>Problem Schleifensensor, vorne</li>
<li>Problem Schleifensensor, hinten</li>
<li>Eingeschlossen</li>
<li>Steht auf dem Kopf</li>
<li>Niedriger Batteriestand</li>
<li>Batterie ist leer</li>
<li>Kein Antrieb</li>
<li>Angehoben</li>
<li>Eingeklemmt in Ladestation</li>
<li>Ladestation blockiert</li>
<li>Problem Sto&szl;igsensor hinten</li>
<li>Problem Sto&szl;igsensor vorne</li>
<li>Radmotor rechts blockiert</li>
<li>Radmotor links blockiert</li>
<li>Problem Antrieb, rechts</li>
<li>Problem Antrieb, links</li>
<li>Schneidsystem blockiert</li>
<li>Fehlerhafte Verbindung</li>
<li>Standardeinstellungen</li>
<li>Elektronisches Problem</li>
<li>Problem Ladesystem</li>
<li>Kippsensorproblem</li>
<li>Rechter Radmotor &uuml;berlastet</li>
<li>Linker Radmotor &uuml;berlastet</li>
<li>Ladestrom zu hoch</li>
<li>Vor&uuml;bergehendes Problem</li>
<li>SK 1 nicht gefunden</li>
<li>SK 2 nicht gefunden</li>
<li>SK 3 nicht gefunden</li>
<li>Problem die Ladestation zu finden</li>
<li>Kalibration des Suchkabels beendet</li>
<li>Kalibration des Suchkabels fehlgeschlagen</li>
<li>Kurzzeitiges Batterieproblem</li>
<li>Batterieproblem</li>
<li>Alarm! M&auml;her ausgeschalten</li>
<li>Alarm! M&auml;her gestoppt</li>
<li>Alarm! M&auml;her angehoben</li>
<li>Alarm! M&auml;her gekippt</li>
<li>Verbindung geändert</li>
<li>Verbindung nicht ge&auml;ndert</li>
<li>COM board nicht verf&uuml;gbar</li>
<li>Rutscht</li>
</ul>
</li>
<li>mower-manual_operation - Manueller Betrieb (0/1) oder mit neuerer Firmware (false/true)</li>
<li>mower-override_end_time - Zeitpunkt wann der manuelle Betrieb beendet ist</li>
<li>mower-source_for_next_start - Grudn f&uuml;r den n&auml;chsten Start
<ul>
<li>Kein Grund</li>
<li>M&auml;her wurde geladen</li>
<li>SensorControl erreicht</li>
<li>Wochentimer erreicht</li>
<li>Stoppuhr Timer</li>
<li>Undefiniert</li>
</ul>
</li>
<li>mower-status - M&auml;her Status (siehe state</li>
<li>mower-timestamp_next_start - Zeitpunkt des n&auml;chsten geplanten Starts</li>
<li>radio-connection_status - Status der Funkverbindung</li>
<li>radio-quality - Indikator f&uuml;r die Funkverbindung in Prozent</li>
<li>radio-state - radio state (schlecht/schwach/gut/Undefiniert)</li>
<li>state - Staus des M&auml;hers
<ul>
<li>Pausiert</li>
<li>M&auml;hen</li>
<li>Suche Ladestation</li>
<li>L&auml;dt</li>
<li>M&auml;hen</li>
<li>Wird aktualisiert ...</li>
<li>Wird eingeschaltet ...</li>
<li>Geparkt nach Zeitplan</li>
<li>Geparkt</li>
<li>Der M&auml;her ist ausgeschaltet</li>
<li>Deaktiviert. Abdeckung ist offen oder PIN-Code erforderlich</li>
<li>Unbekannter Status</li>
<li>Fehler</li>
<li>Neustart ...</li>
<li>Deaktiviert. Manueller Start erforderlich</li>
<li>Manuelles M&auml;hen</li>
<li>Geparkt durch SensorControl</li>
<li>Abgeschlossen</li>
</ul>
</li>
</ul>
<br><br>
<a name="GardenaSmartDeviceattributes"></a>
<b>Attribute</b>
<ul>
<li>readingValueLanguage - &Auml;nderung der Sprache der Readings (de,en/wenn nichts gesetzt ist, dann Englisch es sei denn deutsch ist als globale Sprache gesetzt) </li>
<li>model - </li>
</ul>
<a name="GardenaSmartDeviceset"></a>
<b>set</b>
<ul>
<li>parkUntilFurtherNotice - Parken des M&auml;hers unter Umgehung des Zeitplans</li>
<li>parkUntilNextTimer - Parken bis zum n&auml;chsten Zeitplan</li>
<li>startOverrideTimer - Manuelles m&auml;hen (0 bis 59 Minuten)</li>
<li>startResumeSchedule - Weiterf&uuml;hrung des Zeitplans</li>
</ul>
</ul>
=end html_DE
=cut