Tutorial: How to port openHAB bindings to Eclipse Smarthome


#1

Dear Developers,

You probably already know that our hub supports Eclipse SmartHome, but did you know that many of the openhab2 bindings can be ported into ESH. OpenHAB2 is developed in Java and mainly based on the ESH framework. If you have experience programming smart home products and can’t wait for the Mixtile team to implement the products/bindings you want, you can port the bindings and testing them yourself. To give you quick start. Follow the steps below to add the bindings you want to ESH.

  • Download the list of add-ons from openhab website (download here)

  • Then unzip the folder and find the add-on/jar file you are interested in

  • Go to terminal, go to the folder where your jar is located, then copy your jar file to the hub. For this tutorial I want the Orvibo binding

    • scp org.openhab.binding.Orvibo-2.3.0.jar user@youripaddress:/home/user
  • SSH into your hub and get root access (password is the SN id in the back of your hub)

    • ssh user@yourhubipaddress
    • sudo -i
  • Stop your hub

    • systemctl stop mhub.service
  • Go to folder where the jar file is located (/home/user), change the ownership to the hub, then move it to org.eclipse.smarthome folder

    • cd /home/user
    • chown mhub. org.openhab.binding.orvibo-2.3.0.jar (Your jar could be something different)
    • mv org.openhab.binding.orvibo-2.3.0.jar /opt/mhub/runtime/concierge/system/org.eclipse.smarthome
    • (You can check the ownership of the file with: ls -l)
  • Now add a jar line to smarthome.xargs document

    • cd /opt/mhub/runtime/concierge/
    • vi smarthome.xargs (I used the vi editor, you can use any other editors)
    • for my orvibo binding I need to add: -istart ${esh.dir}/org.openhab.binding.orvibo-.2.30.jar
    • (scroll all the way down where you can see a list of addons and add your jar line)
  • After you added the line, restart your hub

    • systemctl start mhub.service
  • Wait a few minutes and log in to Eclipse Smarthome from a browser

    • Youhubipaddress:8080

As you can see, the orvibo binding is in my list of bindings. I’ve added half of dozens of bindings/services. Generally speaking, the bindings that end in 2.3.0 works (e.g. org.openhab.binding.wifiled-2.3.0.jar) Please keep in mind, further configuration/programming may be needed to get the binding/service to work on your part. If the hub stopped working, you could factory reset it to turn it back to normal.

Also keep in mind that the order of the bindings in the smarthome.xargs file is important as well. If you put a non-working binding before a working one, then the working one will not show up in ESH. For e.g.

-istart ${esh.dir}/org.NOTWORKINGBINDING.jar
-istart ${esh.dir}/org.WORKINGBINDING.jar

The working binding will not appear in the ESH. Let us know in the comments below which bindings you were able develop to our hub! Also if you want to develop with openhab2 instead of ESH, then you can follow this tutorial here.


Tutorial: How to use the hub with openHAB 2.3
#2

Hello,

thank you for the detailed tutorial, I really like you encouraging us to tinker a bit with the hub :slight_smile:

Unfortunately, I didn’t get org.openhab.binding.avmfritz-2.3.0.jar and org.openhab.binding.wifiled-2.3.0.jar to be shown in the paper ui. Even though I saw, that you could implement WifiLED…

I followed all your steps, here is a screenshot of the file owner and permissions:

and here a screenshot about the edit I did in smarthome.xargs

Can you help me - did I forget some final magic step after editing the xargs and restarting the hub?

Kind regards


#3

Hi @saugstauber

Thank you for commenting on this post. It seems that you wrote the ‘org.openhab.binding.wifiled-2.3.0.jar’ on your smarthome.xargs incorrectly.

On another note, the order of the bindings in the smarthome.xargs file is important as well. If you put a non-working binding before a working one, then the working one will not show up in ESH. For e.g.

-istart ${esh.dir}/org.NOTWORKINGBINDING.jar
-istart ${esh.dir}/org.WORKINGBINDING.jar

The working binding will not appear in the ESH.

Best

Bac

Mixtile Team


#4

Hi Bac,

Its compatible Openhab 2 version 2.4.0 addons?


#5

Hi Victor,

We are not sure. We haven’t ported them to ESH before.

Bac

Mixtile Team


#6

Hi Bac,

I add addon Mi Home 2.3.0 correctly, but i go to add a Xiaomi Gateway V2, but when I’m going to add this device it gives me the error ERROR: 409 - Conflict.

.
Any idea?

Best regards
Víctor


#7

Hi Victor,

I’m not sure. I think the ‘Xiaomi Mi Smart Home’ Bindings requires the a Xiaomi gateway to work. Which Xiaomi/Aqara devices do you want to connect to our hub? Our hub can already pair with many Xiaomi/Aqara devices.

Feel free the check out ourcompatibility list

Best

Bac

Mixtile Team


#8

Hi Bac,

I have Xiaomi Gateway and use this in Home Assistant 0.89.1 and OpenHub 2.4, I like to try these programs and see what options they have. I was testing the integration of Xiaomi / Aqara devices in the Mixtile Hub and if I could put the Gateway. I have almost all ZigBee devices XIaomi/Aqara, for example the vibration sensor Aqara does not recognize Mixtile Hub, i will continue testing these days. I have also added the Yeelight addon, but I can not control the wifi bulbs from the app, from the web interface without problem.

Best regards
Víctor


#9

Hi Victor,

Good news! We developed the Aqara vibration sensor and other 2 more Aqara devices to our hub in our latest firmware 1.13. (published yesterday). Update your hub to the latest firmware, and you should be able to find the vibration sensor.

With the Yeelight, could you control it on an iPhone app and/or through the Mixtile voice assistant?

Best

Bac

Mixtile Team


#10

Hi Bac,

Great news.
Respect Yeelight couldn´t control android app o r Mixtile voice assistant, i haven´t IOS phone.

Best regards
Víctor


#11

We haven’t made the yeelight compatible with our hub yet.


#12

Fantastic news.
Thanks