Tutorial: How to use the hub with openHAB 2.3


#1

Dear Developers,

Mixtile team uses Eclipse SmartHome (ESH) for the hub. If you absolutely must use openHAB on your hub, you can follow this tutorial to install it on your hub. Keep in mind that we don’t have the resources to help you if you encountered any problems with openHAB. This tutorial is written assuming you have experience using the terminal in Linux systems. Any mistakes you make during the process of this tutorial may render your hub nonfunctional. We recommend you resetting the hub if it is nonfunctional. If you wish to continue with this tutorial, please note that Mixtile is not liable for the damages you caused to the hub.

((Outdated)Video version here)

  1. Make sure your hub is rooted (instruction here)
  2. Download openHAB and openHAB Add-ons to your computer
    a. openHAB 2.3.0 Stable Runtime (download here)
    b. openHAB 2.3.0 Stable Add-ons (download here)
  3. Create a folder “openhab” on your computer
  4. Put the openHAB file (‘2a’) into the “openhab” folder then unzip it
  5. Put the Add-ons file (‘2b’) into the "openhab/addons’ folder
  6. Open the terminal
  7. Go to your openhab folder than copy your openhab folder into the hub
    a. scp -r openhab user@*yourhubipaddress*:/home/user
  8. ssh into your hub then get root access
    a. ssh user@yourhubipaddress (password is the SN code in the back of your hub)
    b. sudo -i (password is the SN code in the back of your hub)
  9. Stop the mhub
    a. systemctl stop mhub
  10. Go to the the userdata folder in openhab then copy 3 files from your current mhub folder
    a. cd /openhab/userdata
    b. cp -rf /opt/mhub/userdata/openhabcloud .
    c. cp -rf /opt/mhub/userdata/refreshThing.json .
    d. cp -rf /opt/mhub/userdata/uuid .
  11. Create 2 secure links to locations and jsondb
    a. ln -s /config/mhub/userdata/locations/ locations
    b. ln -s /config/mhub/userdata/jsondb/ jsondb
  12. Go to the addons folder and copy mixtiles addons to the addons folder
    a. cd ../addons
    b. cp -rf /opt/mhub/runtime/concierge/system/org.eclipse.smarthome/com.mixtile.hub.* .
  13. Go back to the folder with openhab and give access to mhub.
    a. cd /home/user
    b. chown -R mhub. openhab
  14. Go to the opt folder then rename your old mhub folder to mhub-back (This way you can always switch back)
    a. cd /opt/
    b. mv mhub/ mhub-back
  15. Then copy the openhab folder this folder with mhub name
    a. cp -rf /home/user/openhab/ mhub
  16. Give ownernship access to mhub
    a. chown -R mhub. mhub
    b. chown -R root. mhub/userdata/openhabcloud
    c. chown root. mhub/userdata/uuid
    d. (To see the ownernship of a file) ls -l
  17. Go to the system folder and edit the ‘mhub.service’ file with vi
    a. cd /lib/systemd/system/
    b. cp mhub.service mhub_back.service (make a backup so you can always return to it)
    c. vi mhub.service
    d. (how it should look like after you edit it)

  1. If you followed all the steps above correctly, you should be able to start the service. To start the mhub.service, write the following commands
    a. systemctl daemon-reload
    b. systemctl enable mhub.service
    c. systemctl start mhub.service
    d. (To see the journal of your service) journalctl -u mhub -f
  2. Open your browser to access openHAB
    a. yourhubipaddress:8080
  3. Wait about 10 minutes for it to load and enjoy a cup a coffee/tea in the mean time.

image

If at any point you want to go back to Eclipse Smarthome (ESH), you can either factory reset your hub OR do the following steps

  • Stop the mhub.service
  • Rename the current mhub folder to openhab and rename the mhub-back folder back to mhub. (see step 14)
  • Change the mhub.service back to what it was originally (see step 17)
  • Start the mhub.service (see step 18)

Tutorial: How to port openHAB bindings to Eclipse Smarthome
Mixtile -> openHAB -> MQTT -> Hass.io (and Node-RED)
#2

Thanks a lot, works well for me.

But at this point I have to use cp -R to get it work, please test and update if needed.


#3

ZigBee and Z-Wave Bridge not initialised, see picture:


#4

Hi Tobias,

I’m glad you got it working. And thanks for letting me know. I got it updated.

As for the initialization problem, you may have to wait 10 minutes or so when you first got it started.


#5

Hi Tobias,

Please note that I changed step 10 and step 16 (added b and c)

Bac

Mixtile Team


#6

Hi,

after 7 hours still not initializied.

If I check the journal of the mhub service, got some errors. Maybe this could be the reason?

>     Oct 23 21:19:19 MixtileHub start.sh[3992]: WARNING: The library file '/usr/share/ezdk-1.8.0_152/jre/lib/aarch32/libverify.so' is corrupted! Further execution might lead to unexpected behavior. Ensure that you have downloaded the build from http://zulu.org/download/
> 
>     Oct 23 21:19:19 MixtileHub start.sh[3992]: WARNING: The library file '/usr/share/ezdk-1.8.0_152/jre/lib/aarch32/libjava.so' is corrupted! Further execution might lead to unexpected behavior. Ensure that you have downloaded the build from http://zulu.org/download/
> 
>     Oct 23 21:19:19 MixtileHub start.sh[3992]: WARNING: The library file '/usr/share/ezdk-1.8.0_152/jre/lib/aarch32/libzip.so' is corrupted! Further execution might lead to unexpected behavior. Ensure that you have downloaded the build from http://zulu.org/download/
> 
>     Oct 23 21:19:20 MixtileHub start.sh[3992]: WARNING: The library file '/usr/share/ezdk-1.8.0_152/jre/lib/aarch32/libmanagement.so' is corrupted! Further execution might lead to unexpected behavior. Ensure that you have downloaded the build from http://zulu.org/download/
> 
>     Oct 23 21:19:20 MixtileHub start.sh[3992]: WARNING: The library file '/usr/share/ezdk-1.8.0_152/jre/lib/aarch32/libnet.so' is corrupted! Further execution might lead to unexpected behavior. Ensure that you have downloaded the build from http://zulu.org/download/
> 
>     Oct 23 21:19:20 MixtileHub start.sh[3992]: WARNING: The library file '/usr/share/ezdk-1.8.0_152/jre/lib/aarch32/libnio.so' is corrupted! Further execution might lead to unexpected behavior. Ensure that you have downloaded the build from http://zulu.org/download/
> 
>     Oct 23 21:19:29 MixtileHub start.sh[3992]: WARNING: The library file '/usr/share/ezdk-1.8.0_152/jre/lib/aarch32/libsunec.so' is corrupted! Further execution might lead to unexpected behavior. Ensure that you have downloaded the build from http://zulu.org/download/
> 
>     Oct 23 21:20:27 MixtileHub start.sh[3992]: WARNING: The library file '/usr/share/ezdk-1.8.0_152/jre/lib/aarch32/libawt.so' is corrupted! Further execution might lead to unexpected behavior. Ensure that you have downloaded the build from http://zulu.org/download/
> 
>     Oct 23 21:20:27 MixtileHub start.sh[3992]: WARNING: The library file '/usr/share/ezdk-1.8.0_152/jre/lib/aarch32/libawt_headless.so' is corrupted! Further execution might lead to unexpected behavior. Ensure that you have downloaded the build from http://zulu.org/download/
> 
>     Oct 23 21:20:27 MixtileHub start.sh[3992]: WARNING: The library file '/usr/share/ezdk-1.8.0_152/jre/lib/aarch32/libawt_headless.so' is corrupted! Further execution might lead to unexpected behavior. Ensure that you have downloaded the build from http://zulu.org/download/

#7

Hi,

I had the same thing in my journal when I set it up. I made some changes in step 10 and 16. Maybe you could delete the 3 files you downloaded in step 10 and the mhub folder in step 15. Stop the mhub.service. Then re-do the steps 10,15, and 16. Start the mhub.service again!


#8

Hi,

thanks, but same problem after 1h waiting.
Any other Idea what could be the problem?

BTW, you forgot the spaces in the point 10:
your write:
cp -rf /usr/share/mhub/userdata/openhabcloud
but I think
cp -rf /usr/share/mhub/userdata/ openhabcloud
is correct.


#9

Hi,

We should copy the file inside the openhabcloud folder. Please note there is a space and dot AFTER openhabcloud.


#10

Keep up the hard work Tobias! I am planning on jumping on this project too. Main reason I bought Mixtiles was the ‘local’ operation joint with OH2. Just need to get some time to start.


#11

Got it work now :slight_smile:
sry the think with the dot is new for me.

Pls check point 12. There is a space between / and com.mixtile.hub.* and also a dot at the end.
That works not for me, I killed the space. Correct?

Thanks for your great support, will test it more in the next days

EDIT: only the " Alarm Controller" stays on “UNINITIALIZED”.


#12

You are correct. The space should not be there :slight_smile: I’m glad you got it to work. What was the problem?


#13

The Problem was, I don’t use at point 10 the dot.
I make a space between and ignored the dot…so my fault in the second try.

Thanks a lot for support!


#14

One more question.

How can I now use the ZigBee and Z-Wave in OpenHAB?
I need to install the bindings of openHAB and connect it with the “things” “ZigBee Bridge”?
Or how can I search for new ZigBee and Z-Wave devices?


#15

Hi @Tobias

I love the enthusiasm!

How to view/add mapping tty

Z-wave: ls -l /sys/bus/usb/devices/7-1:1.0/tty
Zigbee: ls -l /sys/bus/usb/devices/8-1:1.0/tty
Bluetooth: /dev/ttyS1

To add a tty device to the ESM of the Mixtile Hub, you need to modify /usr/share/mhub/runtime/concierge/start.sh to add the java run parameters, similar to:

EXTRA_JAVA_OPTS="-Dgnu.io.rxtx.SerialPorts=/dev/ttyUSB0:/dev/ttyS0:/dev/ttyS2:/dev/ttyACM0:/dev/ttyAMA0"

#16

Hi, thanks.
but the

does not exist or do you mean the start.sh in mhub folder?

Can you give me the example for ZigBee, so that I can understand in the correct way?
I thought it would work direct in openHAB because it is written in the PAPER UI that the Z-Wave and ZigBee Things are online.


#17

Hi Tobias,

I recommend to read up on the openhab website. As it has better and much more information than I could provide.

Best

Bac

Mixtile Team


#18

After installing openhab Mixtile iOS app connects to Hab only in local network. Binding of HomeKit integration after installing and configuration doesn’t work (doesn’t appear in Home app).
As your college Fenix said earlier, it should be way to make homebridge working without installing openhab. And he tell me that there will be instruction. And you confirm it, too. Where is it?:smile:


#19

Hi @egoist

Nice to hear from you again! Sorry you couldn’t get HomeKit to work. We decided to make a tutorial for openHAB because it will let our users explore much more functionalities including the HomeKit service. You can actually recompile HomeKit into our hub without installing openHAB.

If you are still using ESH, just put the HomeKit jar file in

/usr/share/mhub/runtime/concierge/system/org.eclipse.smarthome

add HomeKit addon line to

/usr/share/mhub/runtime/concierge/smarthome.xargs

then restart your mhub service.


#20

With openhab your iOS app doesn’t work well. Could I downgrade to ESH?