Skip to content
StefCoene edited this page Nov 1, 2017 · 25 revisions

What is this?

Velbus is domotica hardware build by Velleman. It has no built-in option for communication with the rest of the world. Luckily the protocol is well documented.

So I wrote some perl code to monitor the bus used by Velbus. I also wrote a small webservice that can be used to put commands on the bus. I also integrated the OpenHAB REST API in my code so updates are send in real time to OpenHAB.

Features and other stuff

How it works

  • written in perl
  • daemon that monitors the messages on the bus:
    • all messages are logged in mysql or built-in SQLite database
    • changes are forwarded to openHAB (temperature, buttons, dimmers, relays, counters, ...)
  • basic web interface and command utility line to:
    • scan the bus
    • get status of the connected modules
    • generate openHAB items file
    • put current date and time on the bus
  • web service
    • used by openHAB to poll for the status
    • used by openHAB to put commands on the bus to control the Velbus modules
    • this can be an apache cgi-bin script or a built-in mini webserver

What works / features:

  • trigger a scan of all modules on the bus
  • discover the modules on the bus caused by a scan
  • get the name of the channels and the modules
  • get status of relays, temperature sensors, dimmers, shutters, counters
  • put date & time on the bus (handy to sync the clock in case of a power failure or daylight saving time changes)
  • process all messages on the bus and push the changes to openHAB via REST API
    • TODO: make list of what's pushed to openHAB
  • control relays, dimmers shutters, heater mode and/or desired temperature
  • webservice for integration with openHAB or other software
  • generate Velbus items file for openHAB
  • auto process the Velbus protocol files and extract the needed information

TODO:

  • in the list of discovered modules: print a warning for not-supported modules, check the firmware level
  • document openHAB graphs and other 'nice to know'
  • XML output for webservice (currently only json since this works for openHAB)
  • installation script (needed for library include path)
  • merge information from http://www.docum.org/drupal/content/velbus-software
  • better logging
  • better security by running scripts as a non-root user

Velbus bugs

I found some bugs in the code of Velbus.

  • The third part of the name of the second blind channel is not correct, it returns the third part of the name of the first channel. There is a new firmware for this issue.
  • Channel names are truncated to 15 characters. There is a new velbuslink software for this issue.

Requirements: what do I need?

  • linux server (also tested on windows)
  • working Velbus setup
  • velserv running: source can be found here or an other server like jvelbusd
  • mysql database (optional: you can use built-in SQLite database)
  • apache with perl module (optional: you can use a built-in mini webserver)
  • openHAB with the http binding

Install path

The scripts are developed with /home/velbus/velserver as install directory. If you want to place the scripts somewhere else, you need to update these files and change all occurrences of /home/velbus/velserver in the following files:

  • bin/commands.pl
  • bin/logger.pl
  • bin/webserver.pl
  • etc/apache-velserver.conf
  • www/index.pl
  • www/service.pl

Clone this wiki locally