HabPanelViewer: configuring control/sensor items on Android 13/14 devices

Background: This thread was split off from another topic to discuss problems with HabPanelViewer on Android 13/14 devices. Specifically, the HPV app crashes when the user attempts to select items for controlling the HPV app or sending device data to an openHAB server. As a result, it’s not possible to set up or modify HPV’s control/sensor features.

These features appear to work on Android 9 devices without issue, and may work on Android 10. It’s believed that they do not work in Android 11/12, but this has no been confirmed.

HPV is no longer in development, so fixes are not expected unless a new developer takes over the project.

That’s odd. What happened when you tried to open the settings? I’m running HPV on a 2019 Fire HD 10, and I just have to swipe left and open the Preferences.

I know its odd, but on my 2023 Fire HD10 I have enabled gesture navigation and swiping left (i.e. from the right side of the screen towards its center) it snaps to the “back” gesture instead of opening the settings.
I reverted back to the classic button navigation (for testing), but I couldn’t get that working either.
So I’m out of ideas tbh.

Shoot. I don’t have that version of Fire OS, so unfortunately I can’t help you troubleshoot.

The only thing I can think of is that Fire OS has a different feature for gesture navigation, separate from main navigation. My Samsung devices have “One-handed navigation” as an option, which enables me to stick with the classic button nav and still have gestures.

Does HPV (v0.9.27) work for you under OH4.2?
I did the settings and can display the page.
But as soon as I try to select the command item to interact with OH (or any other item e.g. for sensor connection) HPV crashes.
Maybe you have any idea?
The log says status url missing but the url is set (without path) and it’s working:

03-10 10:11:34.245  7167  7167 E HPV-SseConnection: setting status URL_MISSING, connection=null
03-10 10:11:34.245  7167  7167 E HPV-SseConnection: java.lang.Exception: dummy
03-10 10:11:34.245  7167  7167 E HPV-SseConnection: 	at de.vier_bier.habpanelviewer.openhab.SseConnection.setStatus(SseConnection.java:153)
03-10 10:11:34.245  7167  7167 E HPV-SseConnection: 	at de.vier_bier.habpanelviewer.openhab.SseConnection.connect(SseConnection.java:105)
03-10 10:11:34.245  7167  7167 E HPV-SseConnection: 	at de.vier_bier.habpanelviewer.openhab.SseConnection.setNetworkConnected(SseConnection.java:148)
03-10 10:11:34.245  7167  7167 E HPV-SseConnection: 	at de.vier_bier.habpanelviewer.openhab.SseConnection.connected(SseConnection.java:89)
03-10 10:11:34.245  7167  7167 E HPV-SseConnection: 	at de.vier_bier.habpanelviewer.NetworkTracker.addListener(NetworkTracker.java:37)
03-10 10:11:34.245  7167  7167 E HPV-SseConnection: 	at de.vier_bier.habpanelviewer.MainActivity.onCreate(MainActivity.java:248)
03-10 10:11:34.245  7167  7167 E HPV-SseConnection: 	at android.app.Activity.performCreate(Activity.java:8342)
03-10 10:11:34.245  7167  7167 E HPV-SseConnection: 	at android.app.Activity.performCreate(Activity.java:8321)

I’m still on 4.1.1, and haven’t changed my HPV config in a long time. Now I’m kind of afraid to touch it.

Does this happen for you on multiple devices?

now I tried on another device with the same result. One is Android 13, the other is 14.
I don’t think REST has changed, so could you try to install on another device?

Tried it on my Samsung tablet running Android 13, and it’s the same as you. If I click on a field to enter in an openHAB item, it crashes or restarts.

My Fire HD 10 is using Fire OH 7, which is only Android 9.

@pilspeda, what happens to you when you’re using the classic button navigation? I think your newer Fire HD 10 will be using Fire OS 9, which apparently uses some Android 10 and some 11 (sigh).

could you try exporting the settings from your working device and then importing into the non-working?

I feel like we’re pretty far off-topic now. @rlkoshak, can you split this into its own thread from #9 onward?

@Larsen, have you successfully imported settings before? Both of my tablets can export, but neither can see the HPV.prefs file when I try to import. So I wonder if it ever worked.

yes, I exported, changed some settings and imported the prefs-file and settings were successfully changed back.

Could you post your settings-file (maybe without server name) so I could try to manually insert the parts for the command item and a sensor item in my prefs-file?

I just sent you the HPV.prefs file in a PM.

That’s funny. Mine looks quite different.
I could not even select your file to import.
Well, sad to let HPV go, but I’m out of ideas. Which version are you using?

I thought I was on 0.9.27, but maybe I never upgraded my Fire HD tablet. I’ll check it when I’m home later on.

Sounds like the same thing that happened to me. I installed HPV on my Android phone just now. The exported file looks like yours, and I was able to see it when I tried to import. Still seems odd that the app can’t see the other file at all.

Okay, I think I’ve got something that works.

First, it turns out that I wasn’t using 0.9.27 on my Fire HD 10. I was using 0.9.27pre. I guess I didn’t update when it was finalized.

I installed the 0.9.27pre version on my Android 14 phone, and it also crashed when I tried to edit the control/sensor items. However, I was able to update to the 0.9.27 version on my Fire HD 10 without issue.

I couldn’t get the HPV.prefs file to work on another device, and I suspect that was due to the encryption. So, I took a chance and wiped the HPV data on my Fire HD 10 to start fresh with no encryption. This time, I was able to import the HPV.prefs file onto my Android 14 phone. After I restarted the app, everything worked.

Here’s the file to try it yourself. HPV.prefs.txt (2.1 KB)

While doing this, I discovered that HPV can’t import settings unless I’ve exported first. I think this is why I wasn’t able to see the HPV.prefs file before (and possibly the same for you). I had to export to a folder, then replace the file in the exact same folder. Then I was able to import it.

When I tried to edit the file in Notepad, I wasn’t able to import it into the app. I assume that’s due to Notepad messing up the encoding. So, I added the following items:

String HabPanelViewer_Control - for sending commands to HPV
Switch HabPanelViewer_Display - reports whether the display is on or off
DateTime HabPanelViewer_Start - reports when the app was last started
Number HabPanelViewer_Battery - reports battery state
Number HabPanelViewer_Brightness - reports display brightness
DateTime HabPanelViewer_Connected - reports when the app last connected to the server

I don’t actually use most of these items, but figured it would be better to include them. Then they can just be added in openHAB and HPV.prefs doesn’t need to be edited.

There are other sensors that I don’t have on my tablet, so I can’t add them. Also, I didn’t add motion detection, because I remember it not working very well for me.

So, I think what we know is:

  • HPV works from Android 9-14 if you only want to connect to openHAB and display a UI
  • We can only edit the control/sensor items if we’re on Android 9 (and maybe Android 10?)
  • In Android 11+, the control/sensor items might work by importing my HPV.prefs file and then using the items I’ve defined above.

Everything I tried was unfortunately without success:

  • Exported settings and tried to import your settings: file cannot be selected
  • inserting a parameter from your settings in my settings file: error during import
  • changing my settings file manually: error during import
  • changing only one letter: settings can be imported, unfortunately doesn’t help to change settings

I’m going to search if there’s an old device with Android 9 somewhere in the cellar as a last chance.

That’s super weird. I can’t imagine what the app could be looking for beyond the .prefs extension, but obviously there’s something more to it.

Did you have encryption enabled before you tried to import my file? I don’t think it was clear in my post that I started with unencrypted apps on both devices.

sorry for late answer :flushed:
no, encryption was not enabled. There must be a hash or checksum within the file and that’s checked before the file selection dialogue.
My wild guess would be that the REST-API of OH4 is not compatible to HPV. Are you able to connect to OH4.2?

I’m on OH 4.1.1, so I feel like this is entirely about something changing between Android versions.

The weird thing is that I was able to move the file to other devices. That should be no different from you putting it on one of yours, since HPV doesn’t know the difference.

yes really weird: I found an ancient TV-box with Android 4.4. On that I could connect to the server, set the command item, export and import settings. But again when I try to import this file on Android 13 it’s not even shown in the file selection box.
So, I’m completely out of ideas. Seems like HPV is fading away :cry:

Try wiping the data completely to give HPV a fresh start, set it up again, and export the HPV.prefs file. Then, replace that file with your Android 4.4 file in exactly the same spot and with exactly the same name.

Yeah, we’ve been on borrowed time, but I guess FullyKioskBrowser will replace most of it’s functionality with MQTT.