GPIO Support - OpenHAB 2

Hi,
No, tried but it was not successful

Quang-Tuyen Tran
quangtuyen.tran@gmx.de
(+49) 015237376688

Hello,
I can now use GPIO as Input on OpenHAB 2 using Snapshot 2.1.0 Build #887
For GPIO Bindig i am using GPIO Binding Snapshot 1.10.0.201704230111

1 . The first you need install libjna 3.2.7 on your raspberry:

sudo apt-get autoremove libjna-java
sudo wget http://ftp.debian.org/debian/pool/main/libj/libjna-java/libjna-java_3.2.7-4_armhf.deb
sudo dpkg -i libjna-java_3.2.7-d_armhf.deb

2 . You need take a new file gpio.cfg into the folder: /etc/openhab2/services with this code:

sysfs=/sys
debounce=10

3 . add gpio to openhab group:

sudo adduser openhab gpio

4 . Example for items file:

Contact	ws_hall 		{gpio="pin:17 debounce:10 activelow:yes"}

5 . Example for rules file:

rule "hall light"
when
	Item ws_hall received update CLOSED
then
	if (hall_light.state==OFF) {
		hall_light.sendCommand(ON)
	} else {
		hall_light.sendCommand(OFF)
	}
	
end

i hope this info can help someone :slight_smile: