WallPanel

Begonnen von sinus61, 10 November 2019, 15:41:41

Vorheriges Thema - Nächstes Thema

sinus61

In einer anderen Rubrik erwähnte gerade mal jemand die Android-App WallPanel (https://thanksmister.com/wallpanel-android/). Das ist ein Fullscreen-Browser, der sich auch per Rest-API und MQTT steuern lässt und darüber einige Infos liefert. Kann außerdem Bewegungs- und Gesichtserkennung und Kamerastreaming.

Da die MQTT Infos nicht ganz komplett per autocreate reinkommen hab ich hier mal eine Config zusammengestellt, vielleicht kann es ja jemand brauchen:


defmod MQTT2_wz_tablet_mqtt MQTT2_DEVICE wz_tablet_mqtt
attr MQTT2_wz_tablet_mqtt IODev MQTT2s
attr MQTT2_wz_tablet_mqtt event-on-change-reading .*
attr MQTT2_wz_tablet_mqtt jsonMap MOTION_value:motion FACE_value:face
attr MQTT2_wz_tablet_mqtt readingList wz_tablet_mqtt:wallpanel/mywallpanel/state:.* { json2nameValue($EVENT) }\
wz_tablet_mqtt:wallpanel/mywallpanel/sensor/battery:.* { json2nameValue($EVENT) }\
wz_tablet_mqtt:wallpanel/mywallpanel/sensor/motion:.* { json2nameValue($EVENT, 'MOTION_', $JSONMAP) }\
wz_tablet_mqtt:wallpanel/mywallpanel/sensor/face:.* { json2nameValue($EVENT, 'FACE_', $JSONMAP) }
attr MQTT2_wz_tablet_mqtt setList alert:textField wallpanel/mywallpanel/command {"eval": "alert('$EVTPART1');;"}\
audio:textField wallpanel/mywallpanel/command {"$EVTPART0": "$EVTPART1"}\
brightness:colorpicker,BRI,0,1,255 wallpanel/mywallpanel/command {"$EVTPART0": $EVTPART1}\
camera:noArg wallpanel/mywallpanel/command {"$EVTPART0": "true"}\
clearCache:noArg wallpanel/mywallpanel/command {"$EVTPART0": true}\
google:noArg wallpanel/mywallpanel/command {"url": "https://www.google.com"}\
relaunch:noArg wallpanel/mywallpanel/command {"$EVTPART0": true}\
reload:noArg wallpanel/mywallpanel/command {"$EVTPART0": true}\
speak:textField {"wallpanel/mywallpanel/command {'$EVTPART0': '".substr($EVENT,5)."'}"}\
url:textField wallpanel/mywallpanel/command {"$EVTPART0": "$EVTPART1"}\
volume:slider,0,1,100 wallpanel/mywallpanel/command {"$EVTPART0": $EVTPART1}\
wake:true,false wallpanel/mywallpanel/command {"$EVTPART0": "$EVTPART1"}

Beta-User

 :)

Magst du das mal als attrTemplate testen?

# source: https://forum.fhem.de/index.php/topic,105222.0.html
name:wallpanel_app
filter:TYPE=MQTT2_DEVICE
desc:For use with Android-App WallPanel (https://thanksmister.com/wallpanel-android/)
order:X_15
par:DEVNAME;name of this wallpanel;{ AttrVal("DEVICE","readingList","") =~ m,wallpanel/([^/]+)/, ? $1 : undef }
par:ICON;ICON as set, defaults to mqtt;{ AttrVal("DEVICE","icon","mqtt") }
attr DEVICE icon ICON
attr DEVICE event-on-change-reading .*
attr DEVICE jsonMap MOTION_value:motion FACE_value:face
attr DEVICE readingList wallpanel/DEVNAME/state:.* { json2nameValue($EVENT) }\
  wallpanel/DEVNAME/sensor/battery:.* { json2nameValue($EVENT) }\
  wallpanel/DEVNAME/sensor/motion:.* { json2nameValue($EVENT, 'MOTION_', $JSONMAP) }\
  wallpanel/DEVNAME/sensor/face:.* { json2nameValue($EVENT, 'FACE_', $JSONMAP) }
attr DEVICE setList alert:textField wallpanel/DEVNAME/command {"eval": "alert('$EVTPART1');;"}\
  audio:textField wallpanel/DEVNAME/command {"$EVTPART0": "$EVTPART1"}\
  brightness:colorpicker,BRI,0,1,255 wallpanel/DEVNAME/command {"$EVTPART0": $EVTPART1}\
  camera:noArg wallpanel/DEVNAME/command {"$EVTPART0": "true"}\
  clearCache:noArg wallpanel/DEVNAME/command {"$EVTPART0": true}\
  google:noArg wallpanel/DEVNAME/command {"url": "https://www.google.com"}\
  relaunch:noArg wallpanel/DEVNAME/command {"$EVTPART0": true}\
  reload:noArg wallpanel/DEVNAME/command {"$EVTPART0": true}\
  speak:textField {"wallpanel/DEVNAME/command {'$EVTPART0': '".substr($EVENT,5)."'}"}\
  url:textField wallpanel/DEVNAME/command {"$EVTPART0": "$EVTPART1"}\
  volume:slider,0,1,100 wallpanel/DEVNAME/command {"$EVTPART0": $EVTPART1}\
  wake:true,false wallpanel/DEVNAME/command {"$EVTPART0": "$EVTPART1"}


Falls noch irgendwelche Links oder Erläuterungen (comment) sinnvoll sind: Darfst du gerne vorschlagen, auch ein passenderes Icon wäre vermutlich nett...
Server: HP-elitedesk@Debian 12, aktuelles FHEM@ConfigDB | CUL_HM (VCCU) | MQTT2: MiLight@ESP-GW, BT@OpenMQTTGw | MySensors: seriell, v.a. 2.3.1@RS485 | ZWave | ZigBee@deCONZ | SIGNALduino | MapleCUN | RHASSPY
svn: u.a MySensors, Weekday-&RandomTimer, Twilight,  div. attrTemplate-files

sinus61

Hab es gerade mal an 2 Tablets getestet, funktioniert. Ich habe noch den wake Befehl durch 2 screen Befehle ersetzt und das kindle Icon genommen.
Ob mehr Kommentare Sinn machen weiß ich nicht, am Anfang muss man wohl einmal auf die Webseite schauen um alle Einstellungen zu verstehen.


# source: https://forum.fhem.de/index.php/topic,105222.0.html
name:wallpanel_app
filter:TYPE=MQTT2_DEVICE
desc:For use with Android-App WallPanel (https://thanksmister.com/wallpanel-android/)<br>NOTE: Experimental, please provide feedback!
order:X_15
par:DEVNAME;name of this wallpanel;{ AttrVal("DEVICE","readingList","") =~ m,wallpanel/([^/]+)/, ? $1 : undef }
par:ICON;ICON as set, defaults to mqtt;{ AttrVal("DEVICE","icon","kindle") }
attr DEVICE icon ICON
attr DEVICE event-on-change-reading .*
attr DEVICE jsonMap MOTION_value:motion FACE_value:face
attr DEVICE readingList wallpanel/DEVNAME/state:.* { json2nameValue($EVENT) }\
  wallpanel/DEVNAME/sensor/battery:.* { json2nameValue($EVENT) }\
  wallpanel/DEVNAME/sensor/motion:.* { json2nameValue($EVENT, 'MOTION_', $JSONMAP) }\
  wallpanel/DEVNAME/sensor/face:.* { json2nameValue($EVENT, 'FACE_', $JSONMAP) }
attr DEVICE setList alert:textField wallpanel/DEVNAME/command {"eval": "alert('$EVTPART1');;"}\
  audio:textField wallpanel/DEVNAME/command {"$EVTPART0": "$EVTPART1"}\
  brightness:colorpicker,BRI,0,1,255 wallpanel/DEVNAME/command {"$EVTPART0": $EVTPART1}\
  camera:noArg wallpanel/DEVNAME/command {"$EVTPART0": "true"}\
  clearCache:noArg wallpanel/DEVNAME/command {"$EVTPART0": true}\
  google:noArg wallpanel/DEVNAME/command {"url": "https://www.google.com"}\
  relaunch:noArg wallpanel/DEVNAME/command {"$EVTPART0": true}\
  reload:noArg wallpanel/DEVNAME/command {"$EVTPART0": true}\
  screenoff:noArg wallpanel/mywallpanel/command {"wake": false}\
  screenon:textField wallpanel/mywallpanel/command {"wake": true, "wakeTime": $EVTPART1}\
  speak:textField {"wallpanel/DEVNAME/command {'$EVTPART0': '".substr($EVENT,5)."'}"}\
  url:textField wallpanel/DEVNAME/command {"$EVTPART0": "$EVTPART1"}\
  volume:slider,0,1,100 wallpanel/DEVNAME/command {"$EVTPART0": $EVTPART1}

Beta-User

 :) Heute morgen war es im update...  ;D

Update folgt, ich baue noch ein paar comment und farewell-Angaben rein, damit das klarer wird, dass man die Webseite ansehen sollte.

Wenn die Zeitangabe nummerisch ist: wäre evtl. ein entsprechendes Widget eine gute Idee?
Siehe https://wiki.fhem.de/wiki/FHEMWEB/Widgets; würde selectnumbers (log?) vorschlagen.
Server: HP-elitedesk@Debian 12, aktuelles FHEM@ConfigDB | CUL_HM (VCCU) | MQTT2: MiLight@ESP-GW, BT@OpenMQTTGw | MySensors: seriell, v.a. 2.3.1@RS485 | ZWave | ZigBee@deCONZ | SIGNALduino | MapleCUN | RHASSPY
svn: u.a MySensors, Weekday-&RandomTimer, Twilight,  div. attrTemplate-files

sinus61

Die Zeitabgabe sind Sekunden, weiß nicht was da universell sinnvoll wäre, bis zu welchem Wert.

Für meine Zwecke würde ich es wohl eher so machen:


screenon:select,60,600,3600,86400 wallpanel/wz_tablet/command {"wake": true, "wakeTime": $EVTPART1}


1min, 10min, 1Std, 1Tag

Beta-User

Thx, so ist es jetzt eingecheckt :) .
Server: HP-elitedesk@Debian 12, aktuelles FHEM@ConfigDB | CUL_HM (VCCU) | MQTT2: MiLight@ESP-GW, BT@OpenMQTTGw | MySensors: seriell, v.a. 2.3.1@RS485 | ZWave | ZigBee@deCONZ | SIGNALduino | MapleCUN | RHASSPY
svn: u.a MySensors, Weekday-&RandomTimer, Twilight,  div. attrTemplate-files

feger

Hallo,
Der Beitrag ist zwar schon sehr alt, aber vielleicht benötigt ihr die Info.

Ich habe auch Wallpanel mit MQTT2 im Einsatz, jedoch stimmt das template leider nicht mehr ganz.
Bei den Sensoren battery, light, magneticField gibt es jeweils ein Datenfeld, welches value und unit heißt. Beim updaten der Werte überschreiben sie sich gegenseitig.
Ich habe einfach ein Präfix vor gestellt und jetzt passt es für mich.

Vielleicht hilft es dem einen oder anderen.

mywallpanel:wallpanel/mywallpanel/sensor/battery:.* { json2nameValue($EVENT, 'battery_', $JSONMAP) }
mywallpanel:wallpanel/mywallpanel/sensor/motion:.* { json2nameValue($EVENT, 'motion_', $JSONMAP) }
mywallpanel:wallpanel/mywallpanel/sensor/face:.* { json2nameValue($EVENT, 'face_', $JSONMAP) }
mywallpanel:wallpanel/mywallpanel/sensor/light:.* { json2nameValue($EVENT,'light_', $JSONMAP) }
mywallpanel:wallpanel/mywallpanel/sensor/magneticField:.* { json2nameValue($EVENT,'magnet_', $JSONMAP) }

mfg Feger
CUL433MHz für Intertechno & Somfy
CUL868MHz für Homematic
RFXTRX433E für Oregon & KeeLoq

Maista

Die URL stimmt auch nicht mehr.

https://wallpanel.app/