UniPi binding

Hello everyone, I am looking for a developer that could implement UniPi binding for OpenHAB maybe with a websocket client using the official API for UniPi.

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

1 Like


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. https://github.com/openhab/openhab/pull/3000

What do other think about this?

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?

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.

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" }

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?

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.

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

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,

Right now the easies way is to implment the connection between OpenHAB and UniPi Neuron using TCP Modbus (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.

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?)


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