openHAB2 and Raspberry Pi GPIO / Sensors

You need it on the OFF one as well and the examples have a space between them which may be required.

Thank you very much rich…you pointed it out rightly the space and the > at OFF command did the trick.

Now only one thing is left, My. openhab shows online but the Iphone app dosen’t load the site map? any Idea?

You have GOT to give me more information. Didi you install the binding? Did you find the uuid and secret? Did you enter them into the myopenhab.org site? Did you double check they were entered correctly?

It’s no fun playing 20 questions.

Rich,
I have followed the procedure from the documetaion, and I have entered the UUID & secret on the myopenhab.org site, and it shows online on that site, but when I try to connect from my Iphone it shows could not connect remote URL.I have entered the basic URL from paper UI configuration page.

Post the urls you have entered into the phone app.

If it shows online on the page you are likely using an incorrect URL in your app.

The Remote URL should be https://myopenhab.org and the Username and Password should be what you use to log into myopenhab.org.

The openHAB URL should be http://<host ip>:8080 where <host ip> is the IP address of the machine running openHAB.

here are my settings,

local URL: http://192.168.0.108:8080
remote URL: https://my.openhab.org
username:nishipkaka@gmail.com
Password: My password with which I logged into this account.
SSL certificates are ignored.

I get the error: Connecting to remote URL,
Request failed, 404 not found

Rich,
Here is screen shot of my openhab settings,

There is no . between “my” and “openhab”.

Remote URL should be “https://myopenhab.org

got it running, I was using settings of the previous version, thank you for the help.
Need your help with the Dimmer item,
I want to send the value of dimmer via http url,
I use http://192.168.0.108:5000/PWM/50 in my browser which works perfect
Kindly note that the last part of the url accepts any int value.

http://docs.openhab.org/addons/bindings/http1/readme.html

This is my current settings for rules and items respectively.
Rules:
rule "For Led_R"
when
Item Led_R received command
then
if ((receivedCommand==INCREASE) || (receivedCommand==DECREASE)) {
var Number bval = 0
if(Led_R.state instanceof PercentType) bval = Led_R.state as PercentType

		if(receivedCommand==INCREASE) bval = bval + 5
		if(receivedCommand==DECREASE) bval = bval - 5

		if(bval<0)   bval = 0
		if(bval>100) bval = 100
            postUpdate(Led_R, bval);
	}

end

and http binding is used as following which is not working
Dimmer Led_R “Red” (FF_Nishit, Lights){http=">[*:GET:http://192.168.0.108:5000/blue3/1$%d]"}

please give your insights.Thanksin advance

You must use sendCommand to trigger the binding.

but how to use it? I have seen some guides on using 'sendHttpGetrequest('http://192.168.0.108:5000/red3/’)'
but I am confused what to write after the last ‘/’ to send the integer number in the link? An example from your side would help better

Replace postUpdate(Led_R, bval) with sendCommand(Led_R, bval).

Let’s say bval from your other rule is the number you want to send. Just append it to the String using +.

sendHttpGetrequest('http://192.168.0.108:5000/red3/' + bval)

Since half of these issues you are having have nothing to do with the original posting, you should start new topics with any new issues you encounter.

Rich,
I tried few things as per your suggestion, but I could not get it working, I have uploaded my rules and items setting in a new topic named 'need help in http binding with dimmer’
here is the link Need help in HTTP binding with dimmer
can you please point my mistakes there,
Thanks in advance.

I’m in trouble in install libjna:
Here is the information
pi@raspberrypi:~ $ sudo dpkg -i libjna-java_3.2.7-4_armhf.deb
dpkg: warning: downgrading libjna-java from 4.2.2-3 to 3.2.7-4
(Reading database … 127905 files and directories currently installed.)
Preparing to unpack libjna-java_3.2.7-4_armhf.deb …
Unpacking libjna-java (3.2.7-4) over (4.2.2-3) …
dpkg: dependency problems prevent configuration of libjna-java:
libjna-java depends on libffi5 (>= 3.0.9); however:
Package libffi5 is not installed.

dpkg: error processing package libjna-java (–install):
dependency problems - leaving unconfigured
Errors were encountered while processing:
libjna-java

Do you have any idea of it?

Hi,
The first you have to remove your libjna-java:

sudo apt-get autoremove libjna-java

I saw you are using 4.2.2

Best regards

It seems that the dependency problem is the key point.
I installed the libffi5…….deb, and then it works out!

Did you try like i wrote:i

I think the command is sudo dpkg -i libjna-java_3.2.7-4_armhf instead of sudo dpkg -i libjna-java_3.2.7-d_armhf

I solved the dependency problem by installing a libffi5 and then I can run the command: sudo dpkg -i libjna-java_3.2.7-4_armhf successfully