Raspberry Pi GPIO + MQTT

Hi, I want to trigger GPIO input and send command to the device via MQTT. Does anyone has any ideas how to do it?

I use nodejs to control gpio on raspberry in combination with mqtt to communicate between openhab and the nodejs script

See alsoConnecting a conventional doorbell to openhab
This Tutorial is still with the mqtt 1 binding, last weekend converted my openhab setup to 2.5 (with mqtt 2 binding) but didn’t update the documentation

I wrote https://github.com/rkoshak/sensorReporter for just this purpose originally.

1 Like

Thank you both for useful information! I will dig into it!

I’ve also written a program to get GPIO access via MQTT, it has a few other tricks too. Check it out MQTTany if you want.

Thanks! Will check it out for sure!