Posts

Showing posts from April, 2017

OpenHab2 - MQTT binding demo

Image
OpenHab2 - MQTT binding demo This demo demonstrates how to use MQTT binding addon in OpenHAB2 installed into Orange Pi zero. The idea is very basic. A switch is created on default sitemap. When you turn on the switch, it sends "ON" message to Topic  /office/light  via MQTT broker that is installed on Orange Pi. When you turn off the switch, it sends "OFF" message to Topic  /office/light . Require Openhab2 MQTT broker installed. First, install MQTT binding via paperui Define all the brokers which you want to connect to, in your  services/mqtt.cfg  file. cd /etc/openhab2/services sudo nano mqtt .cfg Edit the file as follow # # Define your MQTT broker connections here for use in the MQTT Binding or MQTT # Persistence bundles. Replace <broker> with an ID you choose . # # URL to the MQTT broker, e.g. tcp://localhost: 1883 or ssl://localhost: 8883 mosquitto.url=tcp://localhost: 1883 # Optional. Client id ( max 23 chars) to use w