HABPanelViewer

android
habpanel
Tags: #<Tag:0x00007fd310bed148> #<Tag:0x00007fd310becfb8>

(Volker Bier) #1

I have created an openHAB controlled kiosk browser as a frontend for habpanel.

Some of the available features are:

  • it can be set as home screen
  • it allows to control the camera flash and screen backlight and volume depending on openHAB items.
  • it can report device sensor values to openHAB.
  • it detects motion using the front camera and can report motion events to openHAB (this does not work at the same time as the flash control on my tablet).
  • it has an app launcher shortcut that allows to configure and launch a specific app from the menu (I use this for an explorer app to install the updates, but it might be handy for other use cases, too)
  • it has an auto-restart on crash feature
  • it auto-discovers the openHAB server on first start
  • it can adjust the volume depending on an openHAB item

I have uploaded the Android Studio app code to github:

A pre-built apk file is available as release in the github project. It is the current development state:
https://github.com/vbier/habpanelviewer/raw/master/app-debug.apk

Thanks to @miker, the app is also available in the play store and the amazon app store.
Thanks to @mueller-ma, you can also install HPV from fdroid.

You can not install the play store version over the apk or vice versa. You need to install the old version first.

Here is a screenshot of the app with open main menu (swipe left starting from the right screen edge to open it):

Feel free to check it out and leave comments. I will work on it in my spare time, so if you have problems or feature requests let me know.

You will need Android 4.4+ for the app to work. All features are available from Android 6.

In case of problems check out the online help or the Wiki. Feel free to add information you think might be useful to other users.


Your setup for a wall mounted tablet
Using HABpanel on iPhone/iPad
New Jeelink Openhab2 Binding
[bug] Paper UI on chrome for android is overlapping
(furax54) #2

I will try it. thank for your work.


(Adtwomey) #3

I will give it ago.


(Michael Ritterbusch) #4

Hi vbier,

I was also working on and testing a very similar purpose Android app… main intents were:

  • Start on Boot
  • Immersive / No Exit without pin/key combo (config option, could use same app on-demand for quick access from phone, etc)
  • Maintain Volume Preset in Preferences
  • Restart App on crash, etc
    Some “MDM” type features.
  • Scheduled Reboot / Remote reboot request (ie if you want changes reflected on all your panels immediately)
  • Housekeeping tasks (clean cache/mem if needed)
  • “Check-in” type feature - ex. have status page of touch-panels. red icon if no checkin for >1hr, etc.

I was planning to make it work on >=4.2 (some features) or everything >=6.0

Will take a look at your asap! Thanks!!

(my 1st Android app as well. Did all this on Debian/Raspberry Pi type devices, but Android fit the bill for all form factors :slight_smile: )


(Michiel) #5

Wow, I think a lot of people will love this app, very useful.

I will test the app if I have time.

Maybe you can make a option that turns on the screen when motion is detected.


(Michael Ritterbusch) #6

FYI… Some of the ideas/features/functions I had noted along the way…


(Volker Bier) #7

I have just updated the app. I have added the restart on crash functionality, regexp validation and a “Status Information” menu entry that currently shows app version, detected cameras, and the values of the configured openHAB items. Note that these are not updated while the Activity is showing.

Also I changed the minSDK to 23, so the app should now run on Android 6+.


(Volker Bier) #8

And another app update.

I have now added motion detection. Unfortunately, it does not work at the same time as the flash, at least not with my tablet. In this case motion detection takes precedence over flash light control.

I have also added a maximum number of restarts before auto-restart is suspended to avoid endless restart loops.


(Scott Rushworth) #9

Nexus 7, Android 6.0.1, habpanelviewer app-debug.apk from Sept 19

I was thoroughly excited to try this for the motion detection! I found ADB over WiFi flaky and needed to be reset regularly. But I can’t seem to get motion detection to work. The screen will stay on when the camera detects motion, and the screen will turn off eventually (a timer configuration setting would be helpful!). But once the screen is off, it does not turn back on with motion. This tablet has back and front facing cameras, but no flash.

Also, what does the Backlight Control do? Does it just dim the screen or turn it on and off completely? I have a switch item configured in the app, but when it turns ON and OFF the screen does not change.


(Volker Bier) #10

Do you have motion detection enabled in the preferences? Is flashlight control disabled? What does the System Information screen show about the detected cameras?
Currently, the motion detection is running all the time and only turns the screen on when motion is detected.

Backlight control just turns the screen on when the configured regexp is met. I have not yet found a way to force the screen on while the regexp is met. You can check in the System Information screen if the item can be read from openHAB and what its value is.


(Scott Rushworth) #11

Yes

Yes, it was disabled automagically due to no flash being found.

The Enable Regex Expression is greyed out:

I’m not sure what you mean by this.


(Volker Bier) #12

This means that the screen turns off after inactivity (as defined in the android preferences), regardless of motion detection or value of the configured item. Whereas I am a looking for a way to force the screen to stay on as long as the regexp is met.

The disabled preference was a bug. I just fixed it and uploaded a new version. Please check if you can now specify the regexp and if the screen turns on when it is met.


(Scott Rushworth) #13

Sweet! That worked to turn on the screen. It did not turn it off when the regexp was no longer met, but the screen will timeout on its own. I think this is workable for me!

Is there anything I can test for you in regards to the motion detection not turning the screen on? I just set the tablets screen timeout to 15s, hid the screen, and it is not coming back on.


(Volker Bier) #14

Nice to hear that at least something works :slight_smile:.

I will add some more information about motion detection to the System Information screen. The app also logs interesting stuff to the android log. According to some other post this can be accessed with
adb logcat

You could check if you can see something there.


(Volker Bier) #15

I have once again pushed an update. Preview size (which is needed for motion detection) calculation is improved and I have added information about motion detection to the System Information Screen.


(Scott Rushworth) #16

Motion is not detected:


(Volker Bier) #17

The detection count is not updated while the System Information Screen is open, so if you open it right after the start it might be zero. In this case close and reopen Status Information and check if the count has changed.

I have once again added some more info to the System Information screen, but this is a very cumbersome process. Can you please check if you can access the log as described?


(Scott Rushworth) #18


At one point I did see detections show up, but only once.

The forum was unhappy with the amount of data (and it keeps crashing!), so I created an issue in GH with the log.


(Volker Bier) #19

I just pushed another update.

It contains an alternative motion detection mechanism using the new camera api 2 (this is now enabled by default). It is tested to be working with my Galaxy Tab A and a Nexus 5. If you have problems with this, you can switch back to the old mechanism in the preferences but have to restart the app manually.

There is now a restart menu entry (but as I have found out this morning, it does not work on the Nexus, but only on my Galaxy Tab A). I will investigate this, but I am not going to have any time during the next week.

I have also removed the default value for the panel name so that initial installs should show the habpanel start page once the URL has been configured.


(Fabi) #20

Very cool! At this time I am using Filly Kiosk Browser. IT would bei nice to activate Screen Using Openhab Switch or Contact Item (from my KNX Motion sensor).