# Raspi 7" touch display as openHAB GUI // How-to

**URL:** <https://community.openhab.org/t/raspi-7-touch-display-as-openhab-gui-how-to/4113>\
**Category:** Tutorials & Examples\
**Tags:** raspberry, python, gui\
**Created:** [November 11, 2015, 9:08am UTC](https://community.openhab.org/t/raspi-7-touch-display-as-openhab-gui-how-to/4113 "2015-11-11T09:08:28Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mitch77](https://community.openhab.org/user_avatar/community.openhab.org/mitch77/32/354_2.png) [@Mitch77](https://community.openhab.org/u/Mitch77)\
**Post date:** [November 11, 2015, 9:08am UTC](https://community.openhab.org/t/raspi-7-touch-display-as-openhab-gui-how-to/4113/1 "2015-11-11T09:08:28Z")

</div>

Hi community,

I recently bouhgt a rapsi 7" touch display and want to let you know how I transformed it into a openHAB client for the “living” room.

My hardware:

- Raspberry Pi B+
- Touch display with frame
- How to assemble it: [http://www.element14.com/community/docs/DOC-78156/l/raspberry-pi-7-touchscreen-display](http://www.element14.com/community/docs/DOC-78156/l/raspberry-pi-7-touchscreen-display)

- Install Raspbian wheezy
- Set it up so the GUI comes up after booting
- Sometimes the screen and touch control get’s mixed up, so you have to change the following  
in /boot/config.txt:  
`sudo nano /boot/config.txt lcd_rotate=2`
- Start the epiphany browser so it automtically sets up its profile  
\*Switch off the screensaver and let the browser start automatically with the openHAB URL:  
`sudo nano /etc/xdg/lxsession/LXDE-pi/autostart`  
add:  
`@xset s off @xset -dpms @xset s noblank @epiphany-browser -a --profile ~/.config http://UrlToOpenhab/openhab.app?sitemap=xxx`

then do a:  
`sudo reboot`

and your openhab should come up automatically  
That’s it.

What I did additionally to improve the WAF (previously there was a clock where the pi now is placed)  
Modified a python script I found on the web to show the current time:  
If I touch the clock it disappears and comes up after 30 seconds:

download here:  
[https://drive.google.com/file/d/0BzRabLA27s-9VkRBckM1YXR4dkk/view?usp=sharing](https://drive.google.com/file/d/0BzRabLA27s-9VkRBckM1YXR4dkk/view?usp=sharing)

Also dont’ forget to add it to autostart (see above):  
`@/usr/bin/python /home/pi/tk_clock101.py`

Regards,  
Michael

---

<div class="post-metadata">

**Author:** ![jvanzuijlen](https://community.openhab.org/user_avatar/community.openhab.org/jvanzuijlen/32/70715_2.png) [@jvanzuijlen](https://community.openhab.org/u/jvanzuijlen)\
**Post date:** [November 12, 2015, 7:04am UTC](https://community.openhab.org/t/raspi-7-touch-display-as-openhab-gui-how-to/4113/2 "2015-11-12T07:04:55Z")

</div>

Python with no indentation posted; always a challenge 😉

---

<div class="post-metadata">

**Author:** ![Mitch77](https://community.openhab.org/user_avatar/community.openhab.org/mitch77/32/354_2.png) [@Mitch77](https://community.openhab.org/u/Mitch77)\
**Post date:** [November 12, 2015, 7:36am UTC](https://community.openhab.org/t/raspi-7-touch-display-as-openhab-gui-how-to/4113/3 "2015-11-12T07:36:51Z")

</div>

Thanks @jvanzuijlen: you’re right. I changed it and will post the file elsewhere

---

<div class="post-metadata">

**Author:** ![jvanzuijlen](https://community.openhab.org/user_avatar/community.openhab.org/jvanzuijlen/32/70715_2.png) [@jvanzuijlen](https://community.openhab.org/u/jvanzuijlen)\
**Post date:** [November 12, 2015, 8:05am UTC](https://community.openhab.org/t/raspi-7-touch-display-as-openhab-gui-how-to/4113/4 "2015-11-12T08:05:29Z")

</div>

Thanks @Mitch77 !

---

<div class="post-metadata">

**Author:** ![crankycoder](https://community.openhab.org/user_avatar/community.openhab.org/crankycoder/32/70612_2.png) [@crankycoder](https://community.openhab.org/u/crankycoder)\
**Post date:** [November 12, 2015, 2:31pm UTC](https://community.openhab.org/t/raspi-7-touch-display-as-openhab-gui-how-to/4113/5 "2015-11-12T14:31:44Z")

</div>

do you have any pics of this in action? I would be REALLY interested in seeing this. This sounds like a great option for me.

---

<div class="post-metadata">

**Author:** ![Mitch77](https://community.openhab.org/user_avatar/community.openhab.org/mitch77/32/354_2.png) [@Mitch77](https://community.openhab.org/u/Mitch77)\
**Post date:** [November 12, 2015, 4:35pm UTC](https://community.openhab.org/t/raspi-7-touch-display-as-openhab-gui-how-to/4113/6 "2015-11-12T16:35:29Z")

</div>

![](https://community-openhab-org.s3-eu-central-1.amazonaws.com/original/2X/6/60ab775a4ec7fc22f291c51fb45f61bdf5a3760d.JPG) ![](https://community-openhab-org.s3-eu-central-1.amazonaws.com/original/2X/9/9f060bbb3f885e583fe6570809c749f0a3dcae9c.JPG)

Hi Jason, see here the final result 😄  
Anymore specific pictures?  
BR, Michael

---

<div class="post-metadata">

**Author:** ![SchrummSchrumm](https://community.openhab.org/user_avatar/community.openhab.org/schrummschrumm/32/28605_2.png) [@SchrummSchrumm](https://community.openhab.org/u/SchrummSchrumm)\
**Post date:** [November 17, 2015, 2:08pm UTC](https://community.openhab.org/t/raspi-7-touch-display-as-openhab-gui-how-to/4113/7 "2015-11-17T14:08:10Z")

</div>

Really Nice! Thanks for sharing.  
I was thinking to use an old kindle for this. The E-Ink display is perfect for status information like temperature, etc.

---

<div class="post-metadata">

**Author:** ![steved](https://community.openhab.org/letter_avatar_proxy/v4/letter/s/c4cdca/32.png) [@steved](https://community.openhab.org/u/steved)\
**Post date:** [December 1, 2015, 8:31pm UTC](https://community.openhab.org/t/raspi-7-touch-display-as-openhab-gui-how-to/4113/8 "2015-12-01T20:31:59Z")

</div>

If you’re just displaying the Openhab pages in the browser, it’s worth switching it to full-screen (“kiosk”) mode to gain a bit more display space.  
Unfortunately its a little more involved than another command line option (as far as I could find).  
There are instructions [here, among other places](http://www.sunspot.co.uk/Projects/raspberrypi_LAN_master/LCD_Kiosk/raspi_LCD_Kiosk.html)  
I’ve actually commented out the lines beginning ‘xset’, since I wanted the screen to blank after a while

---

<div class="post-metadata">

**Author:** ![dommo0815](https://community.openhab.org/letter_avatar_proxy/v4/letter/d/9dc877/32.png) [@dommo0815](https://community.openhab.org/u/dommo0815)\
**Post date:** [April 16, 2016, 9:54am UTC](https://community.openhab.org/t/raspi-7-touch-display-as-openhab-gui-how-to/4113/9 "2016-04-16T09:54:19Z")

</div>

Hi Michael,

how did you change the script that the temperature and the lights are shown in the top? Can you share it?

---

<div class="post-metadata">

**Author:** ![Mitch77](https://community.openhab.org/user_avatar/community.openhab.org/mitch77/32/354_2.png) [@Mitch77](https://community.openhab.org/u/Mitch77)\
**Post date:** [April 16, 2016, 1:50pm UTC](https://community.openhab.org/t/raspi-7-touch-display-as-openhab-gui-how-to/4113/10 "2016-04-16T13:50:36Z")

</div>

Hi Thomas.

the temperature comes directly from my MQTT server, the “sum of lights on” from openhab via REST. Those are put into different “containers”.

Please find the modified script here:  
[homeinfo.py](https://drive.google.com/open?id=0BzRabLA27s-9V2E4RzFCZVRwSkU)

I’m not really familiar with Python so putting this together was kind of copy&paste, try&error. Python gurus please bear with me. 😔

Regards,  
Michael

---

<div class="post-metadata">

**Author:** ![schlaubi](https://community.openhab.org/user_avatar/community.openhab.org/schlaubi/32/108571_2.png) [@schlaubi](https://community.openhab.org/u/schlaubi)\
**Post date:** [May 31, 2016, 12:17pm UTC](https://community.openhab.org/t/raspi-7-touch-display-as-openhab-gui-how-to/4113/11 "2016-05-31T12:17:56Z")

</div>

Hi Michael,  
thanks for sharing with us 🙂  
I like to have a display for the living room too.

So i think about different solutions:

- arduino with a e-ink display
- raspberry with a touch display
- android tablet

My requirements are:  
-low energy

- shutdown the display on the night.

The problem with the pi ist, that it has no wakeonlan. So at the evening i can shutdown, but in the morning no reboot ☹  
But it is possible the shutdown only the display.

Do you know the wattage? (Off and On)  
And do you have the display on the whole day?

Thanks

---

<div class="post-metadata">

**Author:** ![jcollie](https://community.openhab.org/user_avatar/community.openhab.org/jcollie/32/71253_2.png) [@jcollie](https://community.openhab.org/u/jcollie)\
**Post date:** [June 1, 2016, 5:41pm UTC](https://community.openhab.org/t/raspi-7-touch-display-as-openhab-gui-how-to/4113/12 "2016-06-01T17:41:47Z")

</div>

@schlaubi A 5V 2.5A power supply (which is what’s recommended for use with the display) can put out at _most_ 12.5W of power, so it’s probably going to draw a little more than that at peak usage since power supplies aren’t 100% efficient. And that’s the maximum, typical usage is going to be much less.

> **[Amazon.com: CanaKit 5V 2.5A Raspberry Pi 3 B+ Power Supply/Adapter (UL Listed) :...](https://www.amazon.com/CanaKit-Raspberry-Supply-Adapter-Listed/dp/B00MARDJZ4)**
>
> 2.5A is now a requirement for the Raspberry Pi 3. The CanaKit 2.5A Raspberry Pi power supply / adapter has been specially designed and tested for the new Raspberry Pi 3 and incorporates an inline noise filter for highest stability and reliable...

As far as blanking the screen at night there are many ways to handle that. The backlight can be turned on/off from software so you could use a button, a PIR motion detector, link into the astro binding in openHAB etc - the possibilities are endless.

[https://www.raspberrypi.org/forums/viewtopic.php?f=108&t=125372](https://www.raspberrypi.org/forums/viewtopic.php?f=108&t=125372)

The main downside of the RPi screen that I’ve found so far is that I haven’t found a good on-screen keyboard, so you’d need to keep a keyboard handy for anything that required more than point-and-click.

---

<div class="post-metadata">

**Author:** ![zacofunny](https://community.openhab.org/user_avatar/community.openhab.org/zacofunny/32/46537_2.png) [@zacofunny](https://community.openhab.org/u/zacofunny)\
**Post date:** [June 2, 2016, 1:37pm UTC](https://community.openhab.org/t/raspi-7-touch-display-as-openhab-gui-how-to/4113/13 "2016-06-02T13:37:59Z")

</div>

@schlaubi You can workaround WOL by switching off/on power source of RPi with some remote controlled power plug or relay.

Also please note: [Google to Add Raspberry Pi 3 to Android Open Source Project?](http://www.androidheadlines.com/2016/05/google-add-raspberry-pi-3-android-open-source-project.html)

---

<div class="post-metadata">

**Author:** ![Mitch77](https://community.openhab.org/user_avatar/community.openhab.org/mitch77/32/354_2.png) [@Mitch77](https://community.openhab.org/u/Mitch77)\
**Post date:** [June 2, 2016, 2:00pm UTC](https://community.openhab.org/t/raspi-7-touch-display-as-openhab-gui-how-to/4113/14 "2016-06-02T14:00:15Z")

</div>

> [@schlaubi](#):
>
> And do you have the display on the whole day?

yes, as it’s nicely showing temperature outside and a clock.

> [@zacofunny](#):
>
> @schlaubi You can workaround WOL by switching off/on power source of RPi with some remote controlled power plug or relay.

Agree. That’s what I would recommend, too for a RPi.

---

<div class="post-metadata">

**Author:** ![markstamp](https://community.openhab.org/letter_avatar_proxy/v4/letter/m/b5a626/32.png) [@markstamp](https://community.openhab.org/u/markstamp)\
**Post date:** [September 13, 2016, 7:24pm UTC](https://community.openhab.org/t/raspi-7-touch-display-as-openhab-gui-how-to/4113/15 "2016-09-13T19:24:54Z")

</div>

Thanks! I will be doing this as soon as I get OpenHAB up and running!

---

<div class="post-metadata">

**Author:** ![Sweetchuck007](https://community.openhab.org/letter_avatar_proxy/v4/letter/s/b782af/32.png) [@Sweetchuck007](https://community.openhab.org/u/Sweetchuck007)\
**Post date:** [December 7, 2018, 7:44pm UTC](https://community.openhab.org/t/raspi-7-touch-display-as-openhab-gui-how-to/4113/16 "2018-12-07T19:44:18Z")

</div>

I have installed the epiphany browser. But allways when I try to start the browser i get the message

> “_Unable to init server: Could not connect: Connection refused Failed to parse arguments: Cannot open display:_”

Do you know where the probleme is?

I use openhab2.3 and the raspberryPI Touchscreen. My goal ist to use the openhab panel on touch screen.

Alfred
