# UniPi binding

**URL:** <https://community.openhab.org/t/unipi-binding/2094>\
**Category:** Bindings\
**Tags:** websocket, unipi, raspberry\
**Created:** [August 26, 2015, 5:31am UTC](https://community.openhab.org/t/unipi-binding/2094 "2015-08-26T05:31:44Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![tomhora](https://community.openhab.org/letter_avatar_proxy/v4/letter/t/eb8c5e/32.png) [@tomhora](https://community.openhab.org/u/tomhora)\
**Post date:** [August 26, 2015, 5:31am UTC](https://community.openhab.org/t/unipi-binding/2094/1 "2015-08-26T05:31:44Z")

</div>

Hello everyone, I am looking for a developer that could implement [UniPi](http://unipi.technology) binding for OpenHAB maybe with a websocket client using the official [API for UniPi](https://github.com/UniPiTechnology/evok).

Let me know if anyone is interested, more details via pm please.

---

<div class="post-metadata">

**Author:** ![Steamrunner](https://community.openhab.org/user_avatar/community.openhab.org/steamrunner/32/27141_2.png) [@Steamrunner](https://community.openhab.org/u/Steamrunner)\
**Post date:** [November 29, 2015, 3:20pm UTC](https://community.openhab.org/t/unipi-binding/2094/2 "2015-11-29T15:20:07Z")

</div>

Hello,

I’ve been looking into this a bit. My approach would be to run openhab directly on the Pi connected to the UniPi. Looks like the existing GPIO binding could take care of the digital inputs. To control the relays which seem to be connected to a MCP23008 a modified version of this binding could perhaps be used. [i2c mcp23017 Binding by dfliess · Pull Request #3000 · openhab/openhab1-addons · GitHub](https://github.com/openhab/openhab/pull/3000)

What do other think about this?

---

<div class="post-metadata">

**Author:** ![tomhora](https://community.openhab.org/letter_avatar_proxy/v4/letter/t/eb8c5e/32.png) [@tomhora](https://community.openhab.org/u/tomhora)\
**Post date:** [December 17, 2015, 10:32am UTC](https://community.openhab.org/t/unipi-binding/2094/3 "2015-12-17T10:32:44Z")

</div>

Thanks for your interest. My idea is not to write another low level drivers because they are already implemented in evok. This also brings the advantage that I am responsible to make any new or modified HW implemented in evok so there will be no additional work in OpenHAB driver. We are using the same way in other automation platforms (Pidome and Pimatic) and it works great! It also allows you to control multiple UniPis from one installation of OpenHAB.

What do you think of it?

---

<div class="post-metadata">

**Author:** ![Steamrunner](https://community.openhab.org/user_avatar/community.openhab.org/steamrunner/32/27141_2.png) [@Steamrunner](https://community.openhab.org/u/Steamrunner)\
**Post date:** [December 12, 2016, 2:45pm UTC](https://community.openhab.org/t/unipi-binding/2094/4 "2016-12-12T14:45:14Z")

</div>

I’ve finally picked this up again. I’ve made a binding that can control the unipis relays using pi4j so no need for evok.

> **[Dropbox](https://www.dropbox.com/s/inx252jox7yn2rm/org.openhab.binding.unipi-1.9.0-SNAPSHOT.jar?dl=0)**

I’m running this on raspbian jessie, with openhab 1.8.3 installed though apt. Copy the above file to /usr/share/openhab/addons/, make sure openhab has sufficient permissions to use the i2c bus (add openhab to the i2c group), add the following to your items file:

```
Switch Relay1 "Relay 1"	(Relays) { unipi="relay:1" }
Switch Relay2 "Relay 2"	(Relays) { unipi="relay:2" }
Switch Relay3 "Relay 3"	(Relays) { unipi="relay:3" }
Switch Relay4 "Relay 4"	(Relays) { unipi="relay:4" }
Switch Relay5 "Relay 5"	(Relays) { unipi="relay:5" }
Switch Relay6 "Relay 6"	(Relays) { unipi="relay:6" }
Switch Relay7 "Relay 7"	(Relays) { unipi="relay:7" }
Switch Relay8 "Relay 8"	(Relays) { unipi="relay:8" }

```

---

<div class="post-metadata">

**Author:** ![JensK](https://community.openhab.org/user_avatar/community.openhab.org/jensk/32/71153_2.png) [@JensK](https://community.openhab.org/u/JensK)\
**Post date:** [February 3, 2017, 6:46am UTC](https://community.openhab.org/t/unipi-binding/2094/5 "2017-02-03T06:46:12Z")

</div>

Glad to see that there is a binding now to use unipi on oh. Would be great if that is going to be a binding for oh2 finally. This is definitely one of the next things I wanna try; therefore allow me a perhaps a more OT questions: How is this board connected to oh? just LAN and that’s it or do you need the gpio of rpi for connection?  
Best  
Jens

---

<div class="post-metadata">

**Author:** ![Steamrunner](https://community.openhab.org/user_avatar/community.openhab.org/steamrunner/32/27141_2.png) [@Steamrunner](https://community.openhab.org/u/Steamrunner)\
**Post date:** [February 7, 2017, 11:23am UTC](https://community.openhab.org/t/unipi-binding/2094/6 "2017-02-07T11:23:44Z")

</div>

I run openhab directly on the unipi. This binding I made can only work this way as it accesses the hardware directly. At the moment it only takes care of the relays, the inputs can be handled using the existing gpio binding.

---

<div class="post-metadata">

**Author:** ![JensK](https://community.openhab.org/user_avatar/community.openhab.org/jensk/32/71153_2.png) [@JensK](https://community.openhab.org/u/JensK)\
**Post date:** [August 31, 2017, 10:46am UTC](https://community.openhab.org/t/unipi-binding/2094/8 "2017-08-31T10:46:58Z")

</div>

> [@tomhora](#):
>
> My idea is not to write another low level drivers because they are already implemented in evok. This also brings the advantage that I am responsible to make any new or modified HW implemented in evok so there will be no additional work in OpenHAB driver.

Does this mean, unipi could be used without any special binding. If so, kindly share an example. Thanks jens

---

<div class="post-metadata">

**Author:** ![Jan\_Kalina](https://community.openhab.org/letter_avatar_proxy/v4/letter/j/898d66/32.png) [@Jan\_Kalina](https://community.openhab.org/u/Jan_Kalina)\
**Post date:** [September 27, 2017, 1:26pm UTC](https://community.openhab.org/t/unipi-binding/2094/9 "2017-09-27T13:26:59Z")

</div>

Hi,  
I would be very grateful if you can share example how to use UniPi relays from OpenHAB.

I am new in this area and I am considering to buy UniPI M203 as I need quite a lot relays and I like the compact design,  
but the price tag and mainly lack of UniPi support is a big con.

As it seems that you have solved the main roadblock it would be nice to understand how it is solved and used.  
Thanks a lot,  
Jan

---

<div class="post-metadata">

**Author:** ![tomhora](https://community.openhab.org/letter_avatar_proxy/v4/letter/t/eb8c5e/32.png) [@tomhora](https://community.openhab.org/u/tomhora)\
**Post date:** [October 2, 2017, 8:18am UTC](https://community.openhab.org/t/unipi-binding/2094/10 "2017-10-02T08:18:51Z")

</div>

Right now the easies way is to implment the connection between OpenHAB and UniPi Neuron using TCP Modbus ([GitHub - UnipiTechnology/neuron-tcp-modbus-overlay: DEPRECATED \<Legacy TCP Modbus server and overlay which provides legacy support for old deployments of UniPi Neuron controllers\>](https://github.com/UniPiTechnology/neuron_tcp_modbus_overlay) - also included in the Opensource image for Neurons).

RIght now we are woking on Evok which provides more interfaces like Websocket, REST or SOAP APIs to all IOs. After that, we will try to write a bindign for OpenHAB2 as well.

---

<div class="post-metadata">

**Author:** ![Henri](https://community.openhab.org/letter_avatar_proxy/v4/letter/h/d9b06d/32.png) [@Henri](https://community.openhab.org/u/Henri)\
**Post date:** [August 16, 2018, 8:30pm UTC](https://community.openhab.org/t/unipi-binding/2094/11 "2018-08-16T20:30:26Z")

</div>

Seems like the best way to do this is indeed modbus TCP, but can a communication be established on 1 device (aka 1 IP adress?)

---

<div class="post-metadata">

**Author:** ![tomhora](https://community.openhab.org/letter_avatar_proxy/v4/letter/t/eb8c5e/32.png) [@tomhora](https://community.openhab.org/u/tomhora)\
**Post date:** [August 17, 2018, 6:55am UTC](https://community.openhab.org/t/unipi-binding/2094/12 "2018-08-17T06:55:52Z")

</div>

Sure

---

<div class="post-metadata">

**Author:** ![drewscm](https://community.openhab.org/letter_avatar_proxy/v4/letter/d/34f0e0/32.png) [@drewscm](https://community.openhab.org/u/drewscm)\
**Post date:** [September 14, 2018, 9:36pm UTC](https://community.openhab.org/t/unipi-binding/2094/13 "2018-09-14T21:36:47Z")

</div>

Has anymore work been done on a Unipi binding? Are others successfully using their Unipi or Neuron with openhab?
