IoT Resources Library
Including IoT development kits, implementation reference documents, and the newest advances of the internet of things. To help more developers do more flexible applications on their IoT projects.
How to connect to OpenHAB with Dusun gateway?
This document describes the way to integrate the Dusun gateway to OpenHAB platform in steps.
1. Download OpenHAB from the link
2. Open the OpenHAB web client, enter the paper UI page
3. Pair one zigbee device with our gateway, as for an example, we used a socket to control switch on/off.
4. Enter the OpenHAB webpage and enter PAPER UI.
5. Choose Add-ons, BINDINGS and type in mqtt, and install.
6. Choose the MISC page and install MQTT Broker Moquet.
7. Choose the Then add the mqtt broker to the gateway, if you had the external broker, choose the MQTT Broker, in our sample we just use the embedded broker for installation. By default, it used the localhost as the host and port 1883.
8. Then create a Generic MQTT Thing by adding MQTT Binding – ADD MANUALLY – Generic MQTT Thing. Choose the bridge as the MQTT Broker we create just now and name it as you want, for example(SWITCHONE).
9. Then add channel to the SWITCHONE, fill in the name and label the one you want. The topic subscribe from ‘t ’ and the topic publish to ‘t/30:ae:7b:2b:4e:b1’. As for the data for ON/OFF value, you can refer to Dusun gateway communication protocol for mqtt.
10. Then choose a item type for the thing created, create a new item and link it with the thing.
11. Finally it’s done, you can control the switch through the OpenHAB.
12. If you want to create the page in BASIC UI, you can create the switch.sitemap file in path ./openhab/conf/sitemaps. As for the grammar, you can refer to the link https://www.openhab.org/docs/configuration/sitemaps.html
A sample code is attached above the name SWITCHONE_SwitchOnff is the one of the channel you created.
13. Then you can control it in the BASIC UI.