- Platform information:
Raspberry Pi 3B+
OH 2.5.5 on openhabian
mosquitto as external broker
mqtt v2 binding
What I did so far:
- Established connection of my tablet running Fully Kiosk Browser to mosquitto.
- Created a generic MQTT Thing for the tablet
- Created multiple channels, which mostly work.
one working example channel for the ScreenState - mqtt:topic:Xido_FKB:Screen (Switch):
Topic: fully/deviceInfo/788ff136-aa884889
Custom On/Open Value: true / false
Incoming Value Transformations:
JSONPATH:$.screenOn
The item
Switch Xido_Scr "Xido Screen" (G_jdbc,G_All_OFF) {channel="mqtt:topic:Xido_FKB:Screen"}
The same thing does not work for a number item (and Number channel), when extracting the battery state:
Topic: fully/deviceInfo/788ff136-aa884889
Incoming Value Transformations:
JSONPATH:$.batteryState
EDIT:
The mqtt message for deviceInfo is:
{"deviceId":"788ff136-aa884889","batteryLevel":79,"isPlugged":true,"SSID":"\"xxx\"","Mac":"6c:c0:1c:79:01:8e","ip4":"192.168.68.40","host":"android-999.fritz.box","screenOrientation":0,"screenBrightness":180,"screenLocked":true,"screenOn":false,"foreground":"de.ozerov.fully","locale":"de_DE","serial":"87241c67d97700000000","version":"1.39.2","versionCode":712,"build":"astar_h7-userdebug 5.1.1 LMY47V 20170711 test-keys","model":"X111","manufacturer":"Allwinner","androidVersion":"5.1.1","SDK":22,"webviewUA":"Mozilla\/5.0 (Linux; Android 5.1.1; X111 Build\/LMY47V) AppleWebKit\/537.36 (KHTML, like Gecko) Version\/4.0 Chrome\/39.0.0.0 Safari\/537.36","motionDetectorStatus":2,"isDeviceOwner":false,"internalStorageFreeSpace":9504325632,"internalStorageTotalSpace":13070655488,"ramFreeMemory":499933184,"ramTotalMemory":1051566080,"appFreeMemory":70142388,"appTotalMemory":83886080,"topFragmentTag":"","appStartTime":"27.05.2020 6:31:12 vorm.","isRooted":false,"isLicensed":true,"isInForcedSleep":false,"maintenanceMode":false,"kioskMode":true,"inDaydream":false,"currentPageUrl":"http:\/\/192.168.68.28:8080\/static\/habpanel\/index.html#\/view\/Home"}
EDIT II:
The logs show ok (from my POV):
2020-05-27 14:41:07.748 [TRACE] [.MqttChannelStateDescriptionProvider] - Providing state description for channel mqtt:topic:Xido_FKB:Battery