HomeAutomationForGeeks / openhab-controlpanel

Simple dashboard using the OpenHAB REST services
MIT License
46 stars 10 forks source link

openhab-controlpanel

A simple dashboard using the OpenHAB REST services.

GitHub users: if you want to fork this project, take a look at the advanced version instead. It has the config options in a separate file so you don't accidentally share your personal stuff.

See also

http://www.homeautomationforgeeks.com/dashboard.shtml

Table of Contents

Screenshots

Example setup

Example setup

Running full screen on a cheap ($50) Android tablet

Running on an Android tablet

Features

Installing Prerequisites

Raspberry Pi / Linux

This dashboard was created on a Raspberry Pi 2 but can probably run on most systems with very little modification.

Apache

To install Apache on your Raspberry Pi:

sudo apt-get install apache2

To check if Apache works, just browse to your Pi's IP address (eg. http://192.168.1.80). If Apache installed correctly, you'll see a page saying "It works!".

PHP

If you enabled persistence in OpenHAB and want to be able to view logs, you also need to install PHP, and the MySQL PHP libraries:

sudo apt-get install php5 libapache2-mod-php5

sudo apt-get install php5-mysql

The Weather Underground API

The weather bar uses the Weather Underground API to get weather data. You can remove it if you don't want this. If you keep it, you'll need:

Start by requesting an API key:

The next step is to find a weather station ID:

Installation

Download the project files

Download the dashboard and unzip it to /var/www on your Pi. It won't work out of the box: you'll need to open index.html and look for all the places where it says TODO. That's where you need to change things like insert your weather API key and configure widgets.

You'll probably want to look through the code to understand what's going on. There are comments explaining things throughout. The main files are:

There's also logging: you configure the amount of logging by changing the loggingLevel value in index.html. To see the log output, press F12 while in your browser and make sure the "console" tab is selected.

Included Dependencies

Full Screen Mode on your Android tablet

If you're using an Android tablet as your screen, you'll want the browser to work in full screen mode so the various tool bars don't take up precious screen space.

There are probably several ways to do it - here's one way:

  1. Install the Chrome For Android browser, or update it to the latest version (you need at least version 39).
  2. Browse to to your dashboard site, and once it's loaded open the Settings menu and click "Add to homescreen". This will create a launcher icon, and allow it to start full-screen. If you're curious, see here for how that works.
  3. Install the Immersive Mode app. Once installed open the app and have it start on boot.
  4. Open your dashboard site using the launcher icon you created earlier. The Chrome interface (address bar etc) should be hidden, but you can still see the Android notifications bar at the top and actions bar at the bottom.
  5. Slide down the Android notifications from the top, and select the right-most icon in the Immersive Mode notification. This should hide both bars - your dashboard is now the only thing visible on the tablet.