Pc + raspberry pi

Hello, I was wondering if there was anyway I can run openhab on Pc but still use the raspberry pi because of its GPIO

I have openHAB on a PC and have Domoticz running on the raspberry pi… A long way to do it but openHAB controls Domoticz which then controls the GPIO stuff.

There are many ways you could do it. Some of the more straightforward ways include…

  • Pi exposes an HTTP endpoint and OH queries with the HTTP binding
  • Pi pushes data to OH via the REST API
  • Pi pushes data to OH using MQTT
  • Pi publishes data using UDP; OH listens for it with the TCP binding
  • Pi exposes a TCP endpoint; OH queries it with the TCP binding

Yes you can, as explained by @steve1 but if you are using a pi only for its GPIO it can be cheaper adn more effective to replace it by an arduino, the arduino can talk to the PC by MQTT, REST, UDP or HTTP.

With an Arduino, using the serial/USB interface with the OH serial binding would also be a good option (no need to have a additional networking hardware). Of course, this assumes that the Arduino is physically close to the PC.

1 Like

Absolutely. To add one more example, I have two Raspberry Pis with reed sensors and relays wired to the GPIO pins. I activate the relays from OH by using WebIOPi’s REST API and the Pis report the reed sensor status to OH using MQTT.

I’m about to add a camera to one of the Pis and a water sensor to the other.

My OH server is running on an old laptop running Ubuntu.