I have some components that I have attached to my RaspberryPi 3 B+ (such as sensors, motors, and LEDs). I want to use my RaspberryPi (running RasbianOS with the latest version of OpenHAB 2.4) to drive the GPIO pins to control my components. The goal is to have HABPanel as the main GUI and use that to change values that will update values in my app that I have running in the background. I also wish to use the smart assistant integration (such as Alexa skills, HomeKit, or Google Home) to also control the components. Can anyone help me figure out how to do this, or if it is even possible? Thanks in advance.
Yes it is possible, pending a whole lot of details you do not provide.
Look for the GPIO binding.
If you need help getting started, go through the Beginner’s Tutorial and read the Concepts section of the docs.
We love to help with specific problems but we will not code this up for you.
I really appreciate your help. I will certainly look through the documentation for the GPIO binding. I definitely don’t expect you or anyone else to write any code for me. I just want to make sure that OpenHAB is capable of doing what I need it to do, and that I am going in the right direction with this.
Basically I need to be able to control a couple ADC modules to drive some motors, the ADC uses SPI protocol to communicate with the raspberry pi. I also need to interface with a couple digital sensors, and some analog sensors (again using ADCs using the SPI protocol). Will I be able to do that complex of tasks using the GPIO binding?
If I can’t use GPIO binding for this task, is there something else I can use on OpenHAB? Or is there a way that I can write my own application and have that bound to OpenHAB?
yes you can.
if I am not mistaken some of the coding you will have to do in Python . and run them in the background.
Or the sensors digital or analog (with a ADC) you can use node red. the ease the coding side. node red can read the sensors and write them to mqtt . and have openhab read the results from your mqtt server.
This will probably give you a better result. Allen recommended NodeRed as an alternative. If you code something in Python you can publish/subscribe for events using OH’s REST API or using MQTT. For an example see https://github.com/rkoshak/sensorReporter. I have this running in various RPis to interact with sensors and actuators around the house and use MQTT to publish the sensor readings and subscribe to MQTT messages to cause things to occur.
Yes forgot about that.
Is there a way that I could do it all in NodeRed? I could use MQTT, but I am not as familiar with that. I am trying to minimize the amount of “middle men” to pass one thing on from the next. Could I not use the GPIO control in NodeRed and accomplish the same thing? Or does the communication protocol make that impossible?
I don’t use NodeRed so can’t answer.
yes you can. use the gpio direct from node red. and just link it to openhab items. and other way around as well .
have a look as there are nodes for the raspberry pi. and also for openHAB