HABPanelViewer 0.9.24

Tags: #<Tag:0x00007fe05231e220> #<Tag:0x00007fe05231e0e0>

(Volker Bier) #623

You can save an ImageItem to a file using the following rule and bash script:

rule "HABPanelViewer Picture Taken"
	Item ImageItem changed
	val outputFile = "/tmp/" + now.toString.replaceAll("[:\\/ \\+]+", "_") + ".jpg"

    //var String call_result = 
	executeCommandLine("/etc/openhab2/scripts/captureImage.sh ImageItem " + outputFile, 5000)

with the shell script being:

curl -m 10 --insecure -o - https://openhabianpi:8443/rest/items/$1/state | dd bs=23 skip=1 | base64 -d > $2

Edit: are you using camera API 2 when taking the pictures?

(Jesper Lauritsen) #624

Cool, I’ll try the captureImage.sh :smiley:

Yes, I’m using the camera API 2. I’ve had a single crash today, and the panel probably snapped a 100 pics because of the changing lights with today’s weather. Later I’ll change my rule to only snap in some situations, so it is no too bad. The strange thing is that when the screen lights up and it snaps a pic, I see a message at the bottom that the front camera could not be found - but it snaps with no problem.

(Jesper Lauritsen) #625

Hmm, last evening I can see in the log that my Motion Item changed to CLOSED, and I did a SCREE_ON and snapped an Image. But after that I never received any changes on Motion, so the the screen kept on all night. A reboot was necessary today for the motion detection to get working again. No errors in any logs.

(Volker Bier) #626

Did you look into the adb log? You will never see HPV errors in any of the openHAB logs. And there is not much I can do without an adb log file. If you can grab one, open an issue in github and attach it.

(Jesper Lauritsen) #627

I’ll be away the coming days, but will look into it when I’m back.

(Marcin) #628


I have strange visual issue with HABPanelViewer. On my Nexus 10 (Android 7.1 Lineage but I have the same issue with other versions) I have black square on bottom-right corner. It appears after entered into Preferences or changed recent apps or minimalized and restored HABPanelViewer. Restart app restores normal view. Nexus 10 has high native resolution 2560x1600 maybe this is an issue.

(Aurelio Caliaro) #629

I have a quite old tablet with Android 4.2.2 (a Medion product for which there are no OS updates).
Instead of throwing it away, which is not very sustainable, I would like to use it for HABPanelViewer. HABPanelViewer is however limited to Android >4.4, so when I try to install it it fails (“Parsing apk file failed Maybe minSdk of apk is lower than current Sdk”).
Any idea how to make it run or doesn’t it work at all on old Androids? Is this limitation to >4.4 just a default setting when building HABPanelViewer (which could maybe be overrun by setting an older Sdk) or is there a rationale for this limitation?

(Volker Bier) #630

This looks like the preview area. Do you have camera preview enabled in the preferences? Which version of the app are you running?

(Marcin) #631

Camera is broken in Lineage Android for Nexus 10. I almost sure that camera is disabled in preferences. A black square appears only in some circumstances. I’ll check camera properties on weekend. Version 0.9.24.

(Sid Amos) #632

Camera issue #26 strikes again. I have added new information to that issue.