Hallo Zusammen,
ich habe eine kleine Android App entwickelt.
Name: URI2FHEM
Features:
Beispiel HTML Code:
<a href="fhem://set Deckenstrahler on">on</a>
<br>
<a href="fhem://set Deckenstrahler off">off</a>
Beispiel für meine Android App "Notify" in einer Notify:
define notify_test dummy
attr notify_test room notify_test
attr notify_test setList on off
define notify_test_n notify notify_test {fhem(sendNotify("<br><br><br><br><h1 align=center style=color:FF0000><a href='fhem://set Deckenstrahler on'>on</a><br><br><a href='fhem://set Deckenstrahler off'>off</a></h1>","test","test","test",1))}
Nutzungsbeispiel für die Kombi URI2FHEM und Notify:
- Du kommst nach Hause
- Dir wird automatisch eine Top Meldung(Vor dem Lockscreen und Bildschirm an) gesendet.
- Dort werden dir z.B. die Links für Deckenstrahler an usw angeboten.
Cool :-)
Ein kleiner Vorschlag ... willst du das gleich mit in andFHEM einbauen? Ich würde mich freuen, weil dann eben nicht noch eine App installiert werden müsste :-).
Wenn du es einbauen willst, kannst du es machen:
MainActivity.java:
package com.tool.uri2fhem;
import android.net.Uri;
import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Uri data = getIntent().getData();
if (data.equals(null)) { } else {
String host = data.getHost();
Intent intent = new Intent("li.klass.fhem.constants.Actions.EXECUTE_COMMAND");
intent.putExtra("COMMAND", host);
startService(intent);
}
finish();
}
}
AndroidManifest.xml:
<activity
android:name="com.tool.uri2fhem.MainActivity"
android:label="@string/app_name"
android:theme="@android:style/Theme.NoDisplay" >
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="fhem" />
</intent-filter>
</activity>
Eventuell musst du die Activity umbenennen :)
Klar, wenn du nichts dagegen hast baue ich es ein :-)
So ich habe es mal eingebaut. Vielen Dank :-)
https://github.com/klassm/andFHEM/commit/45598ea4206b0064d5fb55f2220845f7e2930c37 (//github.com/klassm/andFHEM/commit/45598ea4206b0064d5fb55f2220845f7e2930c37)