Started using openHAB 2-beta3 and it is amazing how well it worked, I have it installed on a Raspberry Pi 3 and it hooked into my existing Philips Hue bridge + lights without a hitch. It also picked up my WeMo wall plug with just a few clicks. This just works
Having trouble finding information/guidance on how I could access GPIO pins on my Raspberry Pi? Is this possible? I saw instructions that this is possible with 1.x version using openhab-addon-binding-gpio package; has anyone got this working using the 2.x release?
I am looking to read some sensors (motion, temperature, lux, humidity and noise level for starters) and use buttons in rules that are plugged into the GPIO.
Some of the guides indicate I need to install org.openhab.io.gpio and org.openhab.binding.gpio but I cannot see those on the Paper interface, so I assume these are 1.x legacy addons. I can’t seem to find the .jar file that I can place into my /usr/share/openhab2/addons to load them.
Search this forum for GPIO as several people have reported some issues with the GPIO behavior. If I remember correctly it has to do with the startup of OH behavior and restoreOnStartup or something like that.
Personally I use a Python Script I wrote to interact with the GPIO pins, though that has as much to do with the fact that my Pis are not running OH and are instead reporting to/receiving commands from OH.
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
Hey rich,
I also use python script on PI and run OH on the same machine with Http binding, but when I pressed the button for Lights, it dosen’t change the state of my GPIO pin, I used the post method of http binding but it is not happening. Do I need to run OH on a different machine?
Kindly note that the python script’s server run on port 6060 and OH run on port 8080
This sounds like a problem between OH and the python script you are using. We won’t be able to help with that as we have no information about how this python script works or what it expects.
But you are not required to run the python script on a separate machine from OH so long as they are all using different ports.
If you are talking about MY sensorReporter script, then you must use MQTT to send commands to sensorReporter from openHAB. It does not support HTTP for receiving commands, only for sending messages to openHAB.
Rich,
Thank you for your reply, I will update you on this,
The other thing I would like to know is, How am I suppose to install My open hab binding in openhab2,
I checked the documentation for it, but I did not find UUID and Secret files in the location suggested by them,
Kindly note that I installed the OH2 using the apt-get method.
You must install the binding first through PaperUI (or Habmin, or the Karaf Console). Then the binding will create those files. They do not exist before installing the binding.
Rich,
I did not installed the HTTP binding first, but now I have installed it, But it is still not working, any IDEA?
Do I need to restart openhab service?