Arduino Sensor network connected to KNX

Hi, I’m trying to integrate the sensor network against a KNX HA-system instead of Vera. Right now I’ve just tried a proof of concept, but the general idea is like this:

  1. A machine acts as the Vera server (in my design this machine is a raspberry pi).
  2. A Lua script executes on the raspberry pi, using the Vera Plugin Henrik wrote, overriding the luup object.
  3. linknx ([url=http://linknx.sourceforge.net/]http://linknx.sourceforge.net/[/url]) executes it’s service on the raspberry pi (or another machine)
  4. The Lua script on the raspberry pi writes the sensor values at certain allocated group addresses in KNX (prefix/radioId/childId)
  5. You can use the normal functionality in linknx for creating rules and administer them through knxweb/knxweb2

Would like to have comments on this design.

The idea is to release this KNX Lua extension as open source along with the rest of Henrik:s code

//regards: Johan

Have now made some lua-code that integrates the sensor network (written by Henrik) with a KNX network through a linknx-server. You can get the source code (GPL v2) here: http://code.mios.com/trac/mios_arduino-sensor/browser/VeraArduino/KNX/KNXgw.lua

(you will also need the file: http://code.mios.com/trac/mios_arduino-sensor/browser/VeraArduino/Vera/L_Arduino.lua)

In order to run the program you need to:

  1. Have a linknx-server running on some machine (ip-number and port-number are configured in KNXgw.lua)
  2. Have lua and luars232 installed on the machine: If you are running on a raspberry pi or another debian-based machine, you can install it with: sudo apt-get install luarocks; sudo luarocks install luars232
  3. Create a file named KNX/KNXgw.cfg containing some information about which objectId:s and KNX-addresses should be used for writing sensor values. (if a sensor is attached, some more information about the sensor is written here, check out KNXgw.lua for more info)
  4. Attach an USB-port with an arduino (nano) acting as gateway in the sensor network. You should also have installed the ArduinoGateway.ino-sketch according to Henrik’s instructions on the arduino.

Now just stand in the right directory and execute:
sudo lua -l luars232 -l Vera/L_Arduino KNX/KNXgw.lua

Have tried the motion detector, temperature sensor and the moisture sensor so far…

//regards: Johan

Hi,
I was looking for something like this - RPi acting as the server, Arduino acting as field device nodes, without using a Vera. I know this post is several months old. Does your project use a Vera at all, or does the RPi replace the Vera? I’m wondering if your RPi server has any kind of web interface so you can view your device statuses (temperatures, humidity, etc) from a webpage?

I have a RPi, a few Arduinos and some nRF24L01’s and sensors. I’m not a programmer, but I can follow instructions and make simple Arduino sketches.

Johan (my brother) isn’t hanging much on this forum.

The KNX gateway is running standalone on one of his RPIs. No one is actively developing the KNX-gateway right now.

But as I said… we’ll be working on a RPI version soon.