Synology DiskStation

Hi all.
I have just migrated to a new syno nas, and want to update my OH2 from 2.0.0.008-SNAPSHOT.

Is the current build working for people?

Also, I had trouble installing the current spk via manual install as port 8080 in use. Any suggestions?

System Info Binding Help

Can anybody share their “System Info” things, items & rules config for their Synology? I’m running the DS716+ and for some reason can NOT get this binding to work.

https://docs.openhab.org/addons/bindings/systeminfo/readme.html

Best, Jay

The opnhab Use has no permissions for /dev/ttyUSB1

Hi,

I installed the Openhab 2.3 Synology .spk on my diskstation. Openhab runs OK, but I am having trouble getting serial ports running.

I tried all kinds of solutions on the internet, like adding usergroups dialout and uucd, access rights to /run/lock and /dev/tty* etc.

Nothing helps…

When I start Openhab from the command line using start.sh I get the message:

/volume1/SmartHome/openHAB/userdata/tmp/libNRJavaSerial_root_0/libNRJavaSerial.so: /volume1/SmartHome/openHAB/userdata/tmp/libNRJavaSerial_root_0/libNRJavaSerial.so: wrong ELF class: ELFCLASS32 (Possible cause: can’t load IA 32-bit .so on a ARM-64bit platform)

It looks like the problem is that Openhab tries to load a 32bit Intel library. My Synology has a Realtek RTD1296 CPU, which has a 64bit ARMv8 hardfloat architecture.

It seems the problem is in the package nrjavaserial. In my Openhab release version 3.12OH is included. I uninstalled this package through the karaf command line and put version 3.15 in the addons folder. From version 3.14 nrjavaserial supports ARMv8. The problem is still there, so it seems the problem is in Openhab itself, it tries to load the wrong .so

Can somebody please help me with this issue? I have spent many hours on this, but still no success. Thank you

Regards,

Robin

@cniweb any chance on a more recent release?

@cniweb

I installed Openhab2 on the nas, openHAB-2.3.0.005-syno-noarch-0.001.spk, but I was wrong about selecting the directory.
All files are under / volume1 / @ appstore / openHAB2
Questions:

  • how can I move under / volume1 / public / openHAB2?
  • Or I can also remove the whole Openhab installation, how?
  • which directory should I create before installation?

Thank you

create /volume1/public/openHAB

Uninstalling it removes all files (except v1/public/openHAB - if created)

So, uninstall it, then create the folder, then install OH and be sure to select the option to use the public folder.

Thank you :grinning:

I installed OpenHab 2.3
How can I install:
Node-red?
Paper Log View?

sorry, i don’t use either of those two.

Has anybody implemented delayed RULES logic (below) in their openhab2.service due to more than 1 startup rule firing when starting up OH2?

If so, Synology doesn’t have “systemctl” nor can I find the “openhab2.service” file.

Running OH2.3, latest build for OH.

Any help would be grateful!

Best, Jay

My prefered variant

This is the most simple alternative, but just works with linux and systemd (e.g. openhabian). Thanks to @ptweety for this variant.

Simply create the file `/etc/systemd/system/openhab2.service.d/override.conf. This overrides the standard startup script where applicable.

If you are on stretch-based openhabian, you may use sudo systemctl edit openhab2.service , otherwise you have to use sudo nano /etc/systemd/system/openhab2.service.d/override.conf

[Service]
ExecStartPre=-/bin/bash -c '/usr/bin/find ${OPENHAB_CONF} -name "*.rules" -exec /usr/bin/rename.ul .rules .rules_away {} \\;'
ExecStartPre=-/bin/bash -c '/usr/bin/find ${OPENHAB_CONF} -name "*.script" -exec /usr/bin/rename.ul .script .script_away {} \\;'
ExecStartPost=/bin/sleep 240
ExecStartPost=-/bin/bash -c '/usr/bin/find ${OPENHAB_CONF} -name "*.script_away" -exec /usr/bin/rename.ul .script_away .script {} \\;'
ExecStartPost=-/bin/bash -c '/usr/bin/find ${OPENHAB_CONF} -name "*.rules_away" -exec /usr/bin/rename.ul .rules_away .rules {} \\;'
TimeoutStartSec=360

That’s it.

Is there a package for the new release for OH 2.4.0 for synology?
And the fix for the USB permisssions?

i’ve moved to a docker container myself

Do you find the socket container update process is easier?

Any issues with usb ports etc?

Seems to be a ok. You have to hand edit the config and I can help you with that. It was a lot easier than I thought it would be, even making my own docker that includes curl and nano and python for speedtest

Hello,
I’m also interested in updating in the Nas Synology DS216J with OH 2.4.0, I have no idea how to do it.
Can you post as you did?

I installed OH 2.3.0 with 2.3.0.005

Sure, I’ll try to include as much as I remember. You’ll have to adjust for your individual setup, so pay attention.
First, if you don’t already have docker, install it. Then, in docker, click on registry and in the seach box type openhab.


It’ll download and then appear in the “image” section of docker. Give it some time to fully download.
While that’s taking place, lets talk about folders and such. Hopefully your folders live in the public share. If not, this is where you’ll adjust what happens next.
If you do use public, your openhab configuration lives in /volume1/public/openHAB
you’ll need to map /volume1/public/openHAB/addons userdata and conf to their respective folders under /openhab - more on this is a second

Once fully downloaded, select it and click “launch.” Give it a name and click “Advanced Settings” and then the Volume tab. Ignore the localtime and timezone entries for now, focus on userdata, addons, and conf.
If you know what I’m doing there, great. If not, don’t worry about it right now.
Make yours look like this:
image

Next, click on the “Ports” tab. It’s going to get a little hairy here. Depending on what ports you have in use elsewhere on your system you may need to at the very least set these to something else while you transition and then you can change them back. Once you’re comfortable that it’s working you can uninstall the synology OH package and eventually set your ports back.

Also, now is a good time to mention you should have an “openhab” user and “openhab” group created through the control panel. If you created them through ssh and they’re not visible through control panel, fine. Make a note of the openhab UID and GID. (you can find these in /etc/paswd and /etc/group find openhab and look for the first number:
image
mine is 1028 - > UID for openhab)

Back to docker, click on the “Environment” tab. Change the highlighted settings to your environment:
Ignore the device one, i don’t think that does anything - we’ll get to that later
image

Then click “Apply” and “Next” but uncheck the box for running the container and finally click “Apply.”

Now your container should be almost ready to go.
Next we hand edit the container file to make life a little easier.
Still in the docker app click on the “Container” tab on the left side and select the container you just created.
Click “Settings” then “Export” and download the config to your local computer


Open the json file that you just downloaded in your favorite editor (notepad++ ?)
Now is the time we add the z-wave stick if you have it. At the top of the file, make yours look like this, adjusting for your own system:
image

   "devices" : [
      {
         "CgroupPermissions" : "rwm",
         "PathInContainer" : "/dev/ttyACM0",
         "PathOnHost" : "/dev/ttyACM0"
      }
   ],

You also need to add localtime and timezone which is either a pain or not really possible through the UI.
Find in your json file the section that looks like this:
image
That’s not exactly right in the picture but it’s corrected here in the text for you:

      {
         "host_volume_file" : "/etc/timezone",
         "mount_point" : "/etc/timezone",
         "type" : "ro"
      },
      {
         "host_volume_file" : "/etc/localtime",
         "mount_point" : "/etc/localtime",
         "type" : "ro"
      },

Save the file. Back on the synology using “File Station” upload the file you just saved. Then in docker delete the container you created. Once deleted, click settings at the top and Import. Point it to the file you uploaded with file station. You’ll have a new container with your custom settings.

Now might be a good time to shut down the openhab package. After that’s off, you can start that docker container. On the running container click “Details”
image

Then you can look at the terminal and create a bash terminal if you want.

Here you see a karaf console and a bash console. You’ll probably see a bunch of errors. A lot of the config files were customized for the synology install. You’ll need to hand edit a lot of those files to fix all the paths. It’s a pain, but you do it once and it’s done.

I know this all looks complicated, but it’s really not.

In a session opened to the synology (not the openhab terminals) cd /volume1/public/openHAB/userdata
then “grep -r appstore” you’ll get a list of all the config files that have synology specific paths.
use nano or vi or whatever to edit those files. the base path in the openhab container for everything is /openhab
so edit the paths in those files

2 Likes

Thanks for your detailed explanation, unfortunately I have DS226J and Docker is not compatible.
Quite right ?

no idea, sorry. man, i spent 30 minutes writing that up :stuck_out_tongue:

It will certainly serve to another user :wink: