FHEM – Setup, practical use, and alternative interfaces

Alternative Interfaces

The user interface, which is fairly frugal in the eyes of many users, has been hotly debated within the FHEM scene for years. Rudolf Koenig, the founder of FHEM, was never really interested in creating a sexy user interface. Besides changing the foreground and background colors, and changing the logo, you have very few options for customizing the user interface.

A Floorplan extension (Figure 3) was created to map out FHEM objects on a 2D floor plan, visualize status messages, and let users output switching commands. As the use of mobile devices grew, however, Floorplan was marginalized due to its less than responsive design.

Figure 3: The FHEM floor plan offers users a 2D visualization.

smartVISU

FHEM supports smartVISU, the intelligent "visualization framework for better home experience," which was originally designed to create HTML-based visualizations for home automation based on the commercial KNX system.

You can map many simple elements, such as dimmers or buttons, but also more complex components, such as a comprehensive heating control system. Users can create individual pages for rooms using standard HTML expressions. The smartVISU framework provides tags that are embedded in an HTML structure to establish a connection between the visualization and the smart home devices set up in FHEM.

In order for FHEM integration to work, some preparations have to be made on the software side. These preparations include installing the required packages – including a web server, which is usually Apache 2 (Listing 4, lines 1 and 2). In addition, you need to download smartVISU (line 3), install the files in the /var/www/smartvisu/ directory, and set the required user permissions. At the FHEM command line, you can then finally install the module and transfer it to the configuration with a define command (Listing 5).

Listing 4

Preparing to Use smartVISU

01 $ apt-get update
02 $ apt-get -y install php5 libapache2-mod-php5 apache2 git
03 $ git clone https://github.com/herrmannj/smartvisu-cleaninstall.git

Listing 5

Setting up the smartVISU Module

01 update force https://raw.githubusercontent.com/herrmannj/fronthem/master/controls_fronthem.txt
02 define fronthem fronthem

Now you need to look at the visualization elements that represent the devices contained on the room pages. For each room, you create an HTML file, which in turn is stored in the rooms_menu.html file (Figure 4). The individual devices are then entered in rooms.html as the block content. The syntax is shown in Figure 5 using a switch as an example.

Figure 4: The smartVISU files have to be included in rooms_menu.html.
Figure 5: This code visualizes a switch in smartVISU.

It takes some hard work to map the desired objects from FHEM to smartVISU. Anyone who is not deterred by this, and is also prepared to tackle smartVISU's installation and configuration overhead, will be rewarded with a smart user interface. The interface even works extremely well on mobile devices. Step-by-step instructions (in German) are available on the web [3].

TabletUI

Meanwhile, TabletUI (Figure 6), another extensive visualization environment based on HTML, is enjoying increasing popularity. Similar to smartVISU, TabletUI lets users map information in a smart way. The GUI's focus, which can display a multitude of functions simultaneously, is – as the name suggests – tablets.

Figure 6: TabletUI offers an attractive alternative user interface.

If you want to use TabletUI, first update the FHEM packages using the FHEM console (Listing 6, line 1) and then import the TabletUI module (line 2). You now need to define all the desired elements in an HTML file. The ./www/tablet/index.html file is primarily used for these element definitions.

Listing 6

Installing TabletUI

01 update all
02 define TabletUi HTTPSRV ftui/ ./www/tablet/ TabletUI

The sample file index-example.html, which you can copy and save as index.html, is conveniently located in the same directory. This makes it possible to test the functionality more precisely.

Familiarize yourself with the syntax in order to establish the necessary links with the elements you wish to integrate from FHEM. In particular, the widgets in the TabletUI user interface need to be populated with the desired values (data-get), and the switching commands need to be sent to FHEM (data-set).

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy Linux Magazine

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

  • PiXtend V2

    The PiXtend board extends the Raspberry Pi with many useful interfaces and functions for new target groups.

  • Freescale Calls Up Second Generation Internet Tablets

    Freescale drums at the Consumer Electronics Show (CES) in Las Vegas. Just as smart, but a bigger display than the Smartphone and costing less than $200 is what the next Internet Generation of 12 to 25-year-olds wants. At least the chipmaker has a fitting idea for it.

  • xsetwacom

    With a little extra effort, on-the-fly adjustment of your graphics tablet on Linux is possible with this command-line tool.

  • Project Harmony Launches Today

    "Project Harmony is like Creative Commons for contributor agreements. We've set out to capture the best practices of free and open source software contributions, across a diverse array of project cultures, communities, and values." said Allison Randal, a community participant in Project Harmony. "The public review process for the Alpha versions of the documents launches today, and runs through May 6th. After a year of hard work by the original ~100 drafting volunteers, we're really looking forward to broader participation in this public review."

  • Controlling a Smart Plug

    You could spend hundreds of dollars on specialized IoT appliances and fixtures, or you could just hack a smart plug and talk to it with your Linux system.

comments powered by Disqus

Direct Download

Read full article as PDF:

Price $2.95

News