Caution

This is the documentation for the current development branch of the CometVisu. It is possible that some of the described features are not yet available in the current release.

Also there might be lots of errors in this documentation as some parts of the content have been translated by an online translation service.

Prerequisites for the installation

To be able to use the CometVisu the system needs to fulfill a few prerequisites.

These are

  • a backend to connect the KNX bus

  • [optional] rrdtool for diagrams

  • [optional] InfluxDB for diagrams

  • a web server with (optional but recommended) PHP support

  • the CometVisu software package

Note

To be able to use the Manager or the Editor the prerequisite is PHP 7. The core of the CometVisu itself can be used without PHP though.

Backend

To be able to connect the devices with the CometVisu you need a “backend”.

Note

The CometVisu supports only one backend at the same time. The simultaneous connection to multiple backends is not supported.

There are different possibilities:

KNX bus

The recommended way to connect the CometVisu to the KNX bus is the FastCGI backend cometvisu-knx-fcgi. It has been used since CometVisu 1.0.0 and implements the CometVisu protocol. The backend supports three transports:

  • knxd: a local knxd daemon

  • ip-tunnel: direct KNXnet/IP tunneling - no knxd needed

  • ip-routing: direct KNXnet/IP routing - no knxd needed

The installation, the web server wiring and all settings are described in FastCGI backend (cometvisu-knx-fcgi).

The old backend with the CGI programs eibread-cgi and eibwrite-cgi of eibd or knxd still works, but is no longer recommended. It is described in Install eibd.

openHAB

To use openHAB as backend you can refer to Installation on a Debian System with openHAB and Installing on an Ubuntu system with openHAB and Docker.

MQTT

To use the CometVisu as one of the MQTT participant you need a MQTT broker that can be contacted with WebSockets.

ioBroker

An ioBroker server with a socket interface is required for the data exchange: either the web adapter (iobroker.web) or the “Web socket” adapter (iobroker.ws, at least version 5.0.2). CometVisu loads the matching client library from that server, so it does not matter which protocol it uses. To display charts or history data, the SQL adapter (iobroker.sql, at least version 4.1.1) is additionally required.

Backend configuration

To configure the CometVisu to use a given backend different possibilities are available, listed below. There a later listed method overrules those above it, e.g. the values from the config file will be used even when those are set differently with docker environment variables.

HTTP header / Docker environment variable

The web server can pass setup information in the HTTP header of the config file. By using the official docker image of the CometVisu this can be achieved by setting the corresponding ENVIRONMENT parameters.

HTTP header

ENVIRONMENT

use

X-CometVisu-Backend-Name

BACKEND_NAME

Name like knxd, openhab, iobroker or mqtt

X-CometVisu-Backend-KNXD-Url

BACKEND_KNXD

URL of the knxd login resource

X-CometVisu-Backend-MQTT-Url

BACKEND_MQTT

URL of the MQTT login resource

X-CometVisu-Backend-ioBroker-Url

BACKEND_IOBROKER

URL of the ioBroker websocket API

X-CometVisu-Backend-OpenHAB-Url

BACKEND_OPENHAB

Only openHAB: path to the REST-API

X-CometVisu-Backend-LoginUrl

CGI_URL_PATH

Deprecated: URL of the knxd or openHAB login resource

X-CometVisu-Backend-User

BACKEND_USERNAME

Deprecated: user name, when needed for the MQTT broker or openHAB

X-CometVisu-Backend-Pass

BACKEND_PASSWORD

Deprecated: password, when needed for the MQTT broker or openHAB

Warning

The user name and password for the MQTT broker are stored in plain text and are transported like that over the network!

Config file

In the all containing <pages> element the different parameters can be set as attributes:

attribute

use

backend

Name like knxd, openhab or mqtt

backend-knxd-url

URL of the knxd login resource

backend-mqtt-url

URL of the MQTT login resource

backend-iobroker-url

URL of the ioBroker websocket API

backend-openhab-url

Only openHAB: path to the REST-API

backend-url

Deprecated: URL of the MQTT WebSocket

username

Deprecated: User name, when needed for openHAB

password

Deprecated: Password, when needed for openHAB

Example:

<?xml version="1.0" encoding="UTF-8"?>
<pages backend="mqtt" backend-url="wss://web.server:443/mqtt/ws" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" lib_version="9" design="pure" xsi:noNamespaceSchemaLocation="../visu_config.xsd">
  <meta>
    <plugins>
...

URL

By the URL parameter backend the backend can also be selected. This is only relevant for special cases like development or testing. It also requires that the access URLs are set by one of the other methods.

Graph tool - RRDtool

An optional but much-recommended component is rrdtool to provide the data for creating graphs. There are many ways to pass data to rrds and the use of rrdtool is documented in depth. The installation of rrdtool for CometVisu is described under RRDtool.

Time series from an InfluxDB database are supported without any additional external software, only PHP is required.

Web server

When the FastCGI backend is used, no CGI programs are needed for the KNX access. Instead the three URL paths /cgi-bin/l, /cgi-bin/r and /cgi-bin/w have to be forwarded to the FastCGI socket of the backend - see FastCGI backend (cometvisu-knx-fcgi).

The program rrdfetch for the diagram plugin is still an ordinary CGI program and is usually located at /usr/lib/cgi-bin/. It must be executable for the account of the web server. This could be enforced by:

chmod +x /usr/lib/cgi-bin/rrdfetch

When this file is a symbolic link also the link target must be executable as well.

The CGI programs r, l and w (which usually are symbolic links to eibread-cgi and eibwrite-cgi) are only required for the legacy backend of Install eibd. In that case all of them must be executable:

chmod +x /usr/lib/cgi-bin/r
chmod +x /usr/lib/cgi-bin/l
chmod +x /usr/lib/cgi-bin/w
chmod +x /usr/lib/cgi-bin/rrdfetch

When these files are symbolic links also the link targets (located e.g. at /usr/local/bin or /usr/share/knxd/examples/bin) must be executable as well.

To be able to use additional components like the editor the web server must support PHP.

lighttpd

For the lighttpd web server an example configuration is given. (Other web servers are also possible, of course). Please make sure that you are changing the example parameters to fit your need.

To install lighttpd on a Debian or Ubuntu system:

apt-get install lighttpd

/etc/lighttpd/lighttpd.conf

server.modules = (
        "mod_access",
        "mod_alias",
        "mod_compress",
        "mod_redirect",
#       "mod_rewrite",
)

server.document-root        = "/var/www"
server.upload-dirs          = ( "/var/cache/lighttpd/uploads" )
server.errorlog             = "/var/log/lighttpd/error.log"
server.pid-file             = "/var/run/lighttpd.pid"
server.username             = "www-data"
server.groupname            = "www-data"

index-file.names            = ( "index.php", "index.html",
                                "index.htm", "default.htm",
                               " index.lighttpd.html" )

url.access-deny             = ( "~", ".inc" )

static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" )

## Use ipv6 if available
#include_shell "/usr/share/lighttpd/use-ipv6.pl"

dir-listing.encoding        = "utf-8"
server.dir-listing          = "enable"

compress.cache-dir          = "/var/cache/lighttpd/compress/"
compress.filetype           = ( "application/x-javascript", "text/css", "text/html", "text/plain" )

include_shell "/usr/share/lighttpd/create-mime.assign.pl"
include_shell "/usr/share/lighttpd/include-conf-enabled.pl"

/etc/lighttpd/conf-enabled/10-cgi.conf

# /usr/share/doc/lighttpd-doc/cgi.txt

server.modules += ( "mod_cgi" )

$HTTP["url"] =~ "^/cgi-bin/" {
        cgi.assign = ( "" => "" )
}

## Warning this represents a security risk, as it allow to execute any file
## with a .pl/.py even outside of /usr/lib/cgi-bin.
#
cgi.assign      = (
        ".pl"  => "/usr/bin/perl",
        ".php" => "/usr/bin/php-cgi",
        ".py"  => "/usr/bin/python",
)

/etc/lighttpd/conf-enabled/11-cgi-cometvisu.conf

### Add cgi for cometvisu
alias.url += ( "/cgi-bin/" => "/usr/lib/cgi-bin/" )
compress.filetype += ("application/javascript", "application/xml", "application/octet-stream")

For the FastCGI backend the FastCGI server is announced in the same file:

### FastCGI socket of the cometvisu-knx-fcgi backend
server.modules += ( "mod_fastcgi" )
fastcgi.server = (
    "/cgi-bin/" => ((
        "socket"      => "/run/cometvisu-fcgi/fcgi.sock",
        "check-local" => "disable"
    ))
)

Installing CometVisu

The CometVisu can be downloaded at https://github.com/CometVisu/CometVisu and unpacked at the web root, most likely in it’s own directory (e.g. /var/www/visu/).

The released versions of the CometVisu are located at https://github.com/CometVisu/CometVisu/releases.

A documentation of an install procedure for the Raspberry Pi is available under CometVisu auf Raspberry Pi.

Testing the installed CometVisu

Just open http://MyServer/visu/ in the browser.

Have fun!