OH4 - MQTT Mapping true = ON, false = OFF

Hi,
I have a FireHD10 Tablet which is running Fully Kiosk Browser.
Via MQTT it publishes various device info (which I can see with MQTT Explorer).
What I am interested in is: I want to grab the current Screen Status (ON/OFF).
Here is the current status:


My *.things

Thing mqtt:topic:fully "MQTT - Wallpanel - Fully Kiosk Browser" (mqtt:broker:myMQTTBroker) {
    Channels:
        Type    switch :        ScreenOn        [stateTopic="deviceInfo/203e871c-36e48cc5/",    transformationPattern="JSONPATH:$.screenOn", ON="true", OFF="false"]
}

My *.items

Switch  MYWALLPANEL_SCREEN      "MyWallPanel - Screen"                  {channel="mqtt:topic:fully:ScreenOn"}

Unfortunately I have no idea how to / or
a) get the current status and
b) transform “true” = ON and “false” = OFF
c) if I have even configured my *.things correctly

My current status is:

Any help would be much appreciated.
Thanks

I usually won’t touch syntax errors like this (I don’t have to mess with them through the UI) but this one is easy.

a. Get the status of what? Of the Thing?

b. Use the correct syntax. It’s on="true", off="false"

c. There isn’t enough information presented to answer that beyond the syntax error.

Edit:
I got it solved, i had a “/” too much in my MQTT Thing defintion.
My *.thing

Thing mqtt:topic:fully "MQTT - Wallpanel - Fully Kiosk Browser" (mqtt:broker:myMQTTBroker)
{
    Channels:
        Type    switch :        ScreenStatus    [stateTopic="fully/deviceInfo/203e871c-36e48cc5/",       transformationPattern="JSONPATH:$.screenOn", on="true", off="false"]
}

and my debugged *.thing

Thing mqtt:topic:fully "MQTT - Wallpanel - Fully Kiosk Browser" (mqtt:broker:myMQTTBroker)
{
    Channels:
        Type    switch :        ScreenStatus    [stateTopic="fully/deviceInfo/203e871c-36e48cc5",       transformationPattern="JSONPATH:$.screenOn", on="true", off="false"]
}

And my item defintion:

Switch  swWALLPANEL_STATUS      "MyWallPanel - Screen"                  {channel="mqtt:topic:fully:ScreenStatus"}

###########################

Sorry for being so unprecise:
a) get the status of my FireHD10 screen. screenON = true/false (retrievable via MQTT)
b) corrected that
c) what info is missing ?

You’ve never really posted the JSON that’s being parsed. Screen shots are all but unusable most of the time. Verify that you’re suing the correct topic.

And nothing’s going to happen until you link the Channel to an Item of course.

You may want to consider HabPanelViewer. Even though “HabPanel” is in the name, it’s just a web browser. So you can use any UI or webpage you like with it.

Lots of folks here use FKB, and I have nothing against it. I just thought you might want to know about HPV as an alternative.

HPV will communicate directly with your OH server using the REST API, so an MQTT broker isn’t required. In addition to getting device status from HPV, you can use an item to send commands to the app. For example, I have HPV turn the screen on when I’m home, and turn it off when I leave or go to bed.

Note that HPV is no longer in active development, but it’s a very mature app. I’ve used the last version for two years, and I think the only issue I had was when I experimented with motion detection.

1 Like

Thanks,
I actually used HPV for quite a while, but I never knew it was versatile.
All I want is to switch the tablet screen on/off and switch a smartplug on/off depending on the tablet’s battery status.

Seems like I need to invest some time into HPV

Sorry for dumb question @pilspeda , but you mentioned that you using Fully Kiosk Browser as mqtt client. Can you post your html page or GUI as a template?

I might have gotten the terminology mixed up.
FKB (Fully Kiosk Browser) is running on my tablet and publishes device info (e.g. screen status) via MQTT.
I use this information in my OH4 instance to trigger/run rules.
I have quite a weird setup too.
My primary software on my Fire HD10 is WallPanel (because its free and I like its gui).
Unfortunately WallPanel does not publish all device info I’m interested in (the screen is on/off). This is where FKB comes in handy.

I also tried to install HabPanelViewer on my Fire HD10.
It installed fine, but I could not open the settings menu in order to configure it. So I trashed that idea and have gone back using FKB and WallPanel.
Weirdly, it seems as if I can use FKB MQTT capability without needing a license.

10 posts were split to a new topic: MPV Discussion