ready for final, add englisch Commandref

This commit is contained in:
Marko Oldenburg 2017-07-24 10:57:33 +02:00
parent 3a17f698c5
commit 3c66d2a94d
3 changed files with 4841 additions and 10 deletions

View File

@ -70,8 +70,8 @@ eval "use Encode qw(encode encode_utf8);1" or $missingModul .= "Encode ";
eval "use JSON;1" or $missingModul .= "JSON "; eval "use JSON;1" or $missingModul .= "JSON ";
my $modulversion = "3.9.80"; my $modulversion = "4.0.0";
my $flowsetversion = "3.9.76"; my $flowsetversion = "4.0.0";
@ -979,7 +979,61 @@ sub AMADCommBridge_ParseMsg($$) {
<a name="AMADCommBridge"></a> <a name="AMADCommBridge"></a>
<h3>AMADCommBridge</h3> <h3>AMADCommBridge</h3>
comming soon <ul>
<u><b>AMAD - Automagic Android Device</b></u></p>
<b>AMADCommBridge - Communication bridge for all AMAD devices</b>
</br>
This module is the central point for the successful integration of Android devices in FHEM. It also provides a link level between AMAD supported devices and FHEM. All communication between AMAD Android and FHEM runs through this interface.</br>
Therefore, the initial setup of an AMAD device is also performed exactly via this module instance.
</br></br>
In order to successfully establish an Android device in FHEM, an AMADCommBridge device must be created in the first step.
<br><br>
<a name="AMADCommBridgedefine"></a>
<b>Define</b>
<ul><br>
<code>define &lt;name&gt; AMADCommBridge</code>
<br><br>
Example:
<ul><br>
<code>define AMADBridge AMADCommBridge</code><br>
</ul>
<br>
This statement creates a new AMADCommBridge device named AMADBridge.
</ul></br>
In the following, only the Flowset has to be installed on the Android device and the Flow 'First Run Assistant' run. (Simply press the Homebutton)</br>
The wizard then guides you through the setup of your AMAD device and ensures that at the end of the installation process the Android device is created as an AMAD device in FHEM.
</ul>
<br><br>
<a name="AMADCommBridgereadings"></a>
<b>Readings</b>
<ul><br>
<li>JSON_ERROR - JSON Error message reported by Perl</li>
<li>JSON_ERROR_STRING - The string that caused the JSON error message</li>
<li>fhemServerIP - The IP address of the FHEM server, is set by the module based on the JSON string from the installation wizard. Can also be set by user using set command</li>
<li>receiveFhemCommand - is set the fhemControlMode attribute to trigger, the reading is set as soon as an FHEM command is sent. A notification can then be triggered.</br>
If set instead of trigger setControl as value for fhemControlMode, the reading is not executed but the set command executed immediately.</li>
<li>receiveVoiceCommand - The speech control is activated by AMAD (set DEVICE activateVoiceInput), the last recognized voice command is written into this reading.</li>
<li>receiveVoiceDevice - Name of the device from where the last recognized voice command was sent</li>
<li>state - state of the Bridge, open, closed</li>
</ul>
<br><br>
<a name="AMADCommBridgeattribute"></a>
<b>Attributes</b>
<ul><br>
<li>allowFrom - Regexp the allowed IP addresses or hostnames. If this attribute is set, only connections from these addresses are accepted.</br>
Attention: If allowfrom is not set, and no kind allowed instance is defined, and the remote has a non-local address, then the connection is rejected. The following addresses are considered local:</br>
IPV4: 127/8, 10/8, 192.168/16, 172.16/10, 169.254/16</br>
IPV6: ::1, fe80/10</li>
<li>debugJSON - If set to 1, JSON error messages are written in readings. See JSON_ERROR * under Readings</li>
<li>fhemControlMode - Controls the permissible type of control of FHEM devices. You can control the bridge in two ways FHEM devices. Either by direct FHEM command from a flow, or as a voice command by means of voice control (set DEVICE activateVoiceInput)
<ul><li>trigger - If the value trigger is set, all FHEM set commands sent to the bridge are written to the reading receiveFhemCommand and can be executed using notify. Voice control is possible; readings receiveVoice * are set. On the Android device several voice commands can be linked by means of "and". Example: turn on the light scene in the evening and turn on the TV</li>
<li>setControl - All set commands sent via the flow are automatically executed. The triggering of a reading is not necessary. The control by means of language behaves like the value trigger</li>
<li>thirdPartControl - Behaves as triggered, but in the case of voice control, a series of voice commands by means of "and" is not possible. Used for voice control via modules of other module authors ((z.B. 39_TEERKO.pm)</li></ul>
</li>
</ul>
</br></br>
If you have problems with the wizard, an Android device can also be applied manually, you will find in the Commandref to the AMADDevice module.
</ul>
=end html =end html
=begin html_DE =begin html_DE
@ -1007,8 +1061,8 @@ comming soon
<br> <br>
Diese Anweisung erstellt ein neues AMADCommBridge Device Namens AMADBridge. Diese Anweisung erstellt ein neues AMADCommBridge Device Namens AMADBridge.
</ul></br> </ul></br>
Im folgenden mu&szlig; lediglich das Flowset auf dem Android Ger&auml;t installiert werden und der Flow 'First Run Assistant' ausgef&uuml;hrt werden. (einfach den Homebutton drücken)</br> Im folgenden mu&szlig; lediglich das Flowset auf dem Android Ger&auml;t installiert werden und der Flow 'First Run Assistent' ausgef&uuml;hrt werden. (einfach den Homebutton drücken)</br>
Der Assistant geleitet Dich dann durch die Einrichtung Deines AMAD Ger&auml;tes und sorgt daf&uuml;r das am Ende des Installationsprozess das Androidger&auml;t als AMAD Device in FHEM angelegt wird. Der Assistent geleitet Dich dann durch die Einrichtung Deines AMAD Ger&auml;tes und sorgt daf&uuml;r das am Ende des Installationsprozess das Androidger&auml;t als AMAD Device in FHEM angelegt wird.
</ul> </ul>
<br><br> <br><br>
<a name="AMADCommBridgereadings"></a> <a name="AMADCommBridgereadings"></a>
@ -1018,7 +1072,7 @@ comming soon
<li>JSON_ERROR_STRING - der String welcher die JSON Fehlermeldung verursacht hat</li> <li>JSON_ERROR_STRING - der String welcher die JSON Fehlermeldung verursacht hat</li>
<li>fhemServerIP - die Ip-Adresse des FHEM Servers, wird vom Modul auf Basis des JSON Strings vom Installationsassistenten gesetzt. Kann aber auch mittels set Befehles vom User gesetzt werden</li> <li>fhemServerIP - die Ip-Adresse des FHEM Servers, wird vom Modul auf Basis des JSON Strings vom Installationsassistenten gesetzt. Kann aber auch mittels set Befehles vom User gesetzt werden</li>
<li>receiveFhemCommand - ist das Attribut fhemControlMode auf trigger gestellt, wird das Reading gesetzt sobald ein FHEM Befehl übersendet wird. Hierauf kann dann ein Notify triggern.</br> <li>receiveFhemCommand - ist das Attribut fhemControlMode auf trigger gestellt, wird das Reading gesetzt sobald ein FHEM Befehl übersendet wird. Hierauf kann dann ein Notify triggern.</br>
Wird anstelle von trigger setControl als Wert für fhemControlMode eingestellt, wird das Reading nicht gestzt sondern der set Behel sofort ausgeführt.</li> Wird anstelle von trigger setControl als Wert für fhemControlMode eingestellt, wird das Reading nicht gestzt sondern der set Befehl sofort ausgeführt.</li>
<li>receiveVoiceCommand - wird die Sprachsteuerung von AMAD aktiviert (set DEVICE activateVoiceInput) so wird der letzte erkannten Sprachbefehle in dieses Reading geschrieben.</li> <li>receiveVoiceCommand - wird die Sprachsteuerung von AMAD aktiviert (set DEVICE activateVoiceInput) so wird der letzte erkannten Sprachbefehle in dieses Reading geschrieben.</li>
<li>receiveVoiceDevice - Name des Devices von wo aus der letzte erkannte Sprachbefehl gesendet wurde</li> <li>receiveVoiceDevice - Name des Devices von wo aus der letzte erkannte Sprachbefehl gesendet wurde</li>
<li>state - Status der Bridge, open, closed</li> <li>state - Status der Bridge, open, closed</li>
@ -1039,7 +1093,7 @@ comming soon
</li> </li>
</ul> </ul>
</br></br> </br></br>
Wie man bei Problemen mit dem Assistenten ein Androidger&auml;t auch von Hand anlegen kann, erf&auml;rst Du in der Commandref zum AMADDevice Modul. Wie man bei Problemen mit dem Assistenten ein Androidger&auml;t auch von Hand anlegen kann, erf&auml;hrst Du in der Commandref zum AMADDevice Modul.
</ul> </ul>
=end html_DE =end html_DE

View File

@ -54,8 +54,8 @@ eval "use Encode qw(encode encode_utf8);1" or $missingModul .= "Encode ";
eval "use JSON;1" or $missingModul .= "JSON "; eval "use JSON;1" or $missingModul .= "JSON ";
my $modulversion = "3.9.80"; my $modulversion = "4.0.0";
my $flowsetversion = "3.9.76"; my $flowsetversion = "4.0.0";
@ -881,7 +881,166 @@ sub AMADDevice_decrypt($) {
<a name="AMADDevice"></a> <a name="AMADDevice"></a>
<h3>AMADDevice</h3> <h3>AMADDevice</h3>
<ul>
<u><b>AMAD - Automagic Android Device</b></u>
<br>
This module integrates Android devices into FHEM and displays several settings <b><u>using the Android app "Automagic"</u></b>.
Automagic is comparable to the "Tasker" app for automating tasks and configuration settings. But Automagic is more user-friendly. The "Automagic Premium" app currently costs EUR 2.90.
<br>
Any information retrievable by Automagic can be displayed in FHEM by this module. Just define your own Automagic-"flow" and send the data to the AMADCommBridge. One even can control several actions on Android devices.
<br>
To be able to make use of all these functions the Automagic app and additional flows need to be installed on the Android device. The flows can be retrieved from the FHEM directory, the app can be bought in Google Play Store.
<br><br>
<b>How to use AMADDevice?</b>
<ul>
<li>first, make sure that the AMADCommBridge in FHEM was defined</li>
<li>install the "Automagic Premium" app from the PlayStore</li>
<li>install the flowset 74_AMADDeviceautomagicFlowset$VERSION.xml file from the $INSTALLFHEM/FHEM/lib/ directory on the Android device</li>
<li>activate the "installation assistant" Flow in Automagic. If one now sends Automagic into the background, e.g. Homebutton, the assistant starts and creates automatically a FHEM device for the android device</li>
</ul>
<br><br>
<u><b>Define a AMADDevice device by hand.</b></u>
<br><br>
<a name="AMADDevicedefine"></a>
<b>Define</b>
<ul><br>
10.6.9.10 1496497380000 IODev=AMADBridge
<code>define &lt;name&gt; AMADDevice &lt;IP-ADRESSE&gt; &lt;AMAD_ID&gt; IODev=&lt;IODEVICE&gt;</code>
<br><br>
Example:
<ul><br>
<code>define WandTabletWohnzimmer AMADDevice 192.168.0.23 123456 IODev=NAME_des_AMADCommBridge_Devices</code><br>
</ul>
<br>
In this case, an AMADDevice is created by hand. The AMAD_ID, here 123456, must also be entered exactly as a global variable in Automagic.
</ul>
<br><br><br>
<a name="AMADreadings"></a>
<b>Readings</b>
<ul>
<li>airplanemode - on/off, state of the aeroplane mode</li>
<li>androidVersion - currently installed version of Android</li>
<li>automagicState - state of the Automagic App <b>(prerequisite Android >4.3). In case you have Android >4.3 and the reading says "not supported", you need to enable Automagic inside Android / Settings / Sound & notification / Notification access</b></li>
<li>batteryHealth - the health of the battery (1=unknown, 2=good, 3=overheat, 4=dead, 5=over voltage, 6=unspecified failure, 7=cold)</li>
<li>batterytemperature - the temperature of the battery</li>
<li>bluetooth - on/off, bluetooth state</li>
<li>checkActiveTask - state of an app (needs to be defined beforehand). 0=not active or not active in foreground, 1=active in foreground, <b>see note below</b></li>
<li>connectedBTdevices - list of all devices connected via bluetooth</li>
<li>connectedBTdevicesMAC - list of MAC addresses of all devices connected via bluetooth</li>
<li>currentMusicAlbum - currently playing album of mediaplayer</li>
<li>currentMusicApp - currently playing player app (Amazon Music, Google Play Music, Google Play Video, Spotify, YouTube, TuneIn Player, Aldi Life Music)</li>
<li>currentMusicArtist - currently playing artist of mediaplayer</li>
<li>currentMusicIcon - cover of currently play album<b>Noch nicht fertig implementiert</b></li>
<li>currentMusicState - state of currently/last used mediaplayer</li>
<li>currentMusicTrack - currently playing song title of mediaplayer</li>
<li>daydream - on/off, daydream currently active</li>
<li>deviceState - state of Android devices. unknown, online, offline.</li>
<li>doNotDisturb - state of do not Disturb Mode</li>
<li>dockingState - undocked/docked, Android device in docking station</li>
<li>flow_SetCommands - active/inactive, state of SetCommands flow</li>
<li>flow_informations - active/inactive, state of Informations flow</li>
<li>flowsetVersionAtDevice - currently installed version of the flowsets on the Android device</li>
<li>incomingCallerName - Callername from last Call</li>
<li>incomingCallerNumber - Callernumber from last Call</li>
<li>incommingWhatsAppMessageFrom - last WhatsApp message</li>
<li>incommingWhatsTelegramMessageFrom - last telegram message</li>
<li>intentRadioName - name of the most-recent streamed intent radio</li>
<li>intentRadioState - state of intent radio player</li>
<li>keyguardSet - 0/1 keyguard set, 0=no 1=yes, does not indicate whether it is currently active</li>
<li>lastSetCommandError - last error message of a set command</li>
<li>lastSetCommandState - last state of a set command, command send successful/command send unsuccessful</li>
<li>lastStatusRequestError - last error message of a statusRequest command</li>
<li>lastStatusRequestState - ast state of a statusRequest command, command send successful/command send unsuccessful</li>
<li>nextAlarmDay - currently set day of alarm</li>
<li>nextAlarmState - alert/done, current state of "Clock" stock-app</li>
<li>nextAlarmTime - currently set time of alarm</li>
<li>powerLevel - state of battery in %</li>
<li>powerPlugged - 0=no/1,2=yes, power supply connected</li>
<li>screen - on locked,unlocked/off locked,unlocked, state of display</li>
<li>screenBrightness - 0-255, level of screen-brightness</li>
<li>screenFullscreen - on/off, full screen mode</li>
<li>screenOrientation - Landscape/Portrait, screen orientation (horizontal,vertical)</li>
<li>screenOrientationMode - auto/manual, mode for screen orientation</li>
<li>state - current state of AMAD device</li>
<li>userFlowState - current state of a Flow, established under setUserFlowState Attribut</li>
<li>volume - media volume setting</li>
<li>volumeNotification - notification volume setting</li>
<br>
Prerequisite for using the reading checkActivTask the package name of the application to be checked needs to be defined in the attribute <i>checkActiveTask</i>. Example: <i>attr Nexus10Wohnzimmer
checkActiveTask com.android.chrome</i> f&uuml;r den Chrome Browser.
<br><br>
</ul>
<br><br>
<a name="AMADset"></a>
<b>Set</b>
<ul>
<li>activateVoiceInput - start voice input on Android device</li>
<li>bluetooth - on/off, switch bluetooth on/off</li>
<li>clearNotificationBar - All/Automagic, deletes all or only Automagic notifications in status bar</li>
<li>closeCall - hang up a running call</li>
<li>currentFlowsetUpdate - start flowset update on Android device</li>
<li>installFlowSource - install a Automagic flow on device, <u>XML file must be stored in /tmp/ with extension xml</u>. <b>Example:</b> <i>set TabletWohnzimmer installFlowSource WlanUebwerwachen.xml</i></li>
<li>doNotDisturb - sets the do not Disturb Mode, always Disturb, never Disturb, alarmClockOnly alarm Clock only, onlyImportant only important Disturbs</li>
<li>mediaAmazonMusic - play/stop/next/back , controlling the amazon music media player</li>
<li>mediaGoogleMusic - play/stop/next/back , controlling the google play music media player</li>
<li>mediaSpotifyMusic - play/stop/next/back , controlling the spotify media player</li>
<li>mediaTuneinRadio - play/stop/next/back , controlling the TuneinRadio media player</li>
<li>mediaAldiMusic - play/stop/next/back , controlling the Aldi music media player</li>
<li>mediaAudible - play/stop/next/back , controlling the Audible media player</li>
<li>mediaYouTube - play/stop/next/back , controlling the YouTube media player</li>
<li>mediaVlcPlayer - play/stop/next/back , controlling the VLC media player</li>
<li>nextAlarmTime - sets the alarm time. Only valid for the next 24 hours.</li>
<li>notifySndFile - plays a media-file <b>which by default needs to be stored in the folder "/storage/emulated/0/Notifications/" of the Android device. You may use the attribute setNotifySndFilePath for defining a different folder.</b></li>
<li>openCall - initial a call and hang up after optional time / set DEVICE openCall 0176354 10 call this number and hang up after 10s</li>
<li>screenBrightness - 0-255, set screen brighness</li>
<li>screenMsg - display message on screen of Android device</li>
<li>sendintent - send intent string <u>Example:</u><i> set $AMADDEVICE sendIntent org.smblott.intentradio.PLAY url http://stream.klassikradio.de/live/mp3-192/stream.klassikradio.de/play.m3u name Klassikradio</i>, first parameter contains the action, second parameter contains the extra. At most two extras can be used.</li>
<li>sendSMS - Sends an SMS to a specific phone number. Bsp.: sendSMS Dies ist ein Test|555487263</li>
<li>startDaydream - start Daydream</li>
<li>statusRequest - Get a new status report of Android device. Not all readings can be updated using a statusRequest as some readings are only updated if the value of the reading changes.</li>
<li>timer - set a countdown timer in the "Clock" stock app. Only seconds are allowed as parameter.</li>
<li>ttsMsg - send a message which will be played as voice message</li>
<li>userFlowState - set Flow/s active or inactive,<b><i>set Nexus7Wohnzimmer Badezimmer:inactive vorheizen</i> or <i>set Nexus7Wohnzimmer Badezimmer vorheizen,Nachtlicht Steven:inactive</i></b></li>
<li>vibrate - vibrate Android device</li>
<li>volume - set media volume. Works on internal speaker or, if connected, bluetooth speaker or speaker connected via stereo jack</li>
<li>volumeNotification - set notifications volume</li>
</ul>
<br>
<b>Set (depending on attribute values)</b>
<ul>
<li>changetoBtDevice - switch to another bluetooth device. <b>Attribute setBluetoothDevice needs to be set. See note below!</b></li>
<li>openApp - start an app. <b>attribute setOpenApp</b></li>
<li>openURL - opens a URLS in the standard browser as long as no other browser is set by the <b>attribute setOpenUrlBrowser</b>.<b>Example:</b><i> attr Tablet setOpenUrlBrowser de.ozerov.fully|de.ozerov.fully.MainActivity, first parameter: package name, second parameter: Class Name</i></li>
<li>screen - on/off/lock/unlock, switch screen on/off or lock/unlock screen. In Automagic "Preferences" the "Device admin functions" need to be enabled, otherwise "Screen off" does not work. <b>attribute setScreenOnForTimer</b> changes the time the display remains switched on!</li>
<li>screenFullscreen - on/off, activates/deactivates full screen mode. <b>attribute setFullscreen</b></li>
<li>screenLock - Locks screen with request for PIN. <b>attribute setScreenlockPIN - enter PIN here. Only use numbers, 4-16 numbers required.</b></li>
<li>screenOrientation - Auto,Landscape,Portait, set screen orientation (automatic, horizontal, vertical). <b>attribute setScreenOrientation</b></li>
<li>system - issue system command (only with rooted Android devices). reboot,shutdown,airplanemodeON (can only be switched ON) <b>attribute root</b>, in Automagic "Preferences" "Root functions" need to be enabled.</li>
<li>setAPSSID - set WLAN AccesPoint SSID to prevent WLAN sleeps</li>
<li>setNotifySndFilePath - set systempath to notifyfile (default /storage/emulated/0/Notifications/</li>
<li>setTtsMsgSpeed - set speaking speed for TTS (Value between 0.5 - 4.0, 0.5 Step) default is 1.0</li>
<li>setTtsMsgLang - set speaking language for TTS, de or en (default is de)</li>
<br>
To be able to use "openApp" the corresponding attribute "setOpenApp" needs to contain the app package name.
<br><br>
To be able to switch between bluetooth devices the attribute "setBluetoothDevice" needs to contain (a list of) bluetooth devices defined as follows: <b>attr &lt;DEVICE&gt; BTdeviceName1|MAC,BTDeviceName2|MAC</b> No spaces are allowed in any BTdeviceName. Defining MAC please make sure to use the character : (colon) after each second digit/character.<br>
Example: <i>attr Nexus10Wohnzimmer setBluetoothDevice Logitech_BT_Adapter|AB:12:CD:34:EF:32,Anker_A3565|GH:56:IJ:78:KL:76</i>
</ul>
<br><br>
<a name="AMADstate"></a>
<b>state</b>
<ul>
<li>initialized - shown after initial define.</li>
<li>active - device is active.</li>
<li>disabled - device is disabled by the attribute "disable".</li>
</ul>
<br><br><br>
<u><b>Further examples and reading:</b></u>
<ul><br>
<a href="http://www.fhemwiki.de/wiki/AMAD#Anwendungsbeispiele">Wiki page for AMAD (german only)</a>
</ul>
<br><br><br>
</ul>
=end html =end html
=begin html_DE =begin html_DE

File diff suppressed because it is too large Load Diff