Setting up a Zwave Serial Port on Macos

I am creating a new topic particularly for running Openhab 4 on Macos High Sierra. The usual solutions don’t seem to apply as they mostly reference OpenHabian.

I am trying to set up Zwave using a Vera using ser2net and socat.

I have the Vera using ser2net setup correctly. Socat is talking, and I have set up a serial port /dev/zwavevera. Socat says it is connected to device /dev/ttys004.

However, adding the ports to Openhab 4 has been a challenge. What I have done:

  1. I have added my user to the group wheel.
  2. I have created a /var/lock folder and tested it.
  3. I have added a serial bridge in Openhab Paper UI.
  4. I have added a serial Z-wave controller to Openhab Paper UI.

Nothing connects in Openhab until I add the ports using “export EXTRA_JAVA_OPTS=”-Dgnu.io.rxtx.SerialPorts=/dev/ttys004:/dev/zwavevera" at the top of the start.sh file.

If I run this file manually from the command line, the serial port connects in Openhab, but nothing changes on the Zwave controller in OH, it shows “BRIDGE_OFFLINE” and “Controller Is Offline”.

The two questions I have is:

  1. Where do I add “export EXTRA_JAVA_OPTS=”-Dgnu.io.rxtx.SerialPorts=/dev/ttys004:/dev/zwavevera" if I am running a Launchctl Agent? I tried creating a openHAB-wrapper.conf file in my openhab/etc/ folder, but it doesn’t seem to affect anything.
  2. What would be the next step in getting the z-wave controller online?

Thanks!

Made progress.

  1. I had to add my user to the tty group.
  2. The socat device should be made with tty group and not wheel group.
  3. Although the device made by ser2net is /dev/zwavevera, the device socat created was /dev/ttys007 which was with group tty.
  4. I then added a serial bridge on /dev/ttys007 in OpenHAB UI
  5. I then added Zwave Bridge serial stick with /dev/ttys007.

I still have not been able to add the EXTRA_JAVA_OPTS to the openHAB-service script. A little help would be appreciated there.

Does anyone know how to add EXTRA_JAVA_OPTS to the Openhab service script on a Mac?

Unfortunately I don’t, but the docker documentation talks about it. Maybe that will help.
openhab/openhab-docker: Repository for building Docker containers for openHAB (github.com)

Also further on some comments on the device. Maybe something like that might work on the Mac.
FWIW my docker linux file;

services:
  openhab:
    image: "openhab/openhab:milestone"
    restart: always
    network_mode: host
    volumes:
      - "/etc/localtime:/etc/localtime:ro"
      - "/etc/timezone:/etc/timezone:ro"
      - "./openhab_addons:/openhab/addons"
      - "./openhab_conf:/openhab/conf"
      - "./openhab_userdata:/openhab/userdata"
    devices:
      - '/dev/serial/by-id/usb-0658_0200-if00'
    environment:
      CRYPTO_POLICY: "unlimited"
      EXTRA_JAVA_OPTS: "-Duser.timezone=America/New_York"
      OPENHAB_HTTP_PORT: "8080"
      OPENHAB_HTTPS_PORT: "8443"
      USER_ID: "1000"
      GROUP_ID: "1000"