Binding for Warema Mobile System WMS

@pet2001

The serialport.jar has to be executed after every reboot to get the stick ONLINE again after reboot. No big problem

This can be solved with a simple script, which is executed at boot time. However, it can happen that the USB stick does not necessarily always get the same port name.

To solve this, you can define a udev rule to create a symlink so that the port name for the WMS stick is always /dev/warema.

1.) Check which is the ATTRS{serial} of your WMS stick:
udevadm info --name=/dev/ttyUSB0 --attribute-walk

2.) Edit /lib/udev/rules.d/99-usbsticks.rules and add the following line (pls. replace ABC12345 with the ATTRS{serial} of your WMS stick)

SUBSYSTEM==“tty”, ATTRS{serial}==“ABC12345”, SYMLINK+=“warema”

If necessary, an initialization script can be executed at the same time:

SUBSYSTEM==“tty”, ATTRS{serial}==“ABC12345”, SYMLINK+=“warema”, RUN+=“/usr/bin/at -M -f /opt/warema/yourscript.sh now + 1 minutes”

3.) Do not forget to restart the udev rules after the changes:
udevadm control --reload-rules && udevadm trigger

@rainer300 I’m willing to help hunting this bug down, have you started already? Is there any info you need?

@giuseppeiannello

Hi,
I’m not sure whether that’s a bug.
The problem only occurs to me when a connection should be established via TCP/IP and the stick has not been opened on the server side before.
If, after successful initialization, the stick is pluged out and pluged in again, the tcp connection is lost and cannot be restored from the client side (until the server side is reinitialized).
This is only the case with the WMS stick. With other USB sticks, e.g. RFXTRX or Enocean, I do not have this problem.

But the workaround described above works quite well for me and I can live with it :slightly_smiling_face:

@rainer300 in my case, this happens with the stick connected to a local USB port.

Haven’t tried your serialport.jar yet, but kudos for pointing out that udev can fire a script :slight_smile:

I might start hacking into it, maybe get it ready for inclusion into the official repository. How much of it is based off the RFXCom binding?

@giuseppeiannello
Hi,
yes, I have learned the basics from the RFXcom and the EnOcean binding.

Hello Rainer,

would it be possible to plug the WMS Stick into a docker host machine and use the stick inside an openhab docker container? If so which devices I have to pass from the host machine to the docker container?

Best regards,
Jörg

The USB stick is a classic FTDI serial-over-usb, it’s normally /dev/ttyUSB0

Yes, thank you for your answer. Therefore I pass the ttyUSB0 from the host into the docker container with

 --device=/dev/ttyUSB0

But my openhab.log shows only

2020-04-29 07:49:11.898 [INFO ] [wms.connector.OpenWMSSerialConnector] - Connecting to OpenWMS USB at /dev/ttyUSB0

every minute.

Best regards,
Jörg

You’re hitting a known bug.
A workaround is available here: Binding for Warema Mobile System WMS

Okay, you mean the serial port is not initialized correctly.

So far I don’t have java installed on my host machine. That’s the reason why I use docker


I have set the log level to debug. Now I get the following output in openhab.log:

2020-04-29 09:48:35.534 [DEBUG] [openwms.handler.OpenWMSBridgeHandler] - Checking OpenWMS transceiver connection, thing status should be = OFFLINE
2020-04-29 09:48:35.536 [DEBUG] [openwms.handler.OpenWMSBridgeHandler] - Connecting to OpenWMS transceiver
2020-04-29 09:48:35.538 [DEBUG] [wms.connector.OpenWMSSerialConnector] - Disconnecting
2020-04-29 09:48:35.560 [DEBUG] [wms.connector.OpenWMSSerialConnector] - Serial port event listener stopped
2020-04-29 09:48:35.562 [DEBUG] [wms.connector.OpenWMSSerialConnector] - Interrupt serial listener
2020-04-29 09:48:35.568 [DEBUG] [penwms.connector.OpenWMSStreamReader] - Data listener stopped
2020-04-29 09:48:35.570 [DEBUG] [wms.connector.OpenWMSSerialConnector] - Close serial out stream
2020-04-29 09:48:35.572 [DEBUG] [wms.connector.OpenWMSSerialConnector] - Close serial in stream
2020-04-29 09:48:35.574 [DEBUG] [wms.connector.OpenWMSSerialConnector] - Close serial port
2020-04-29 09:48:35.579 [DEBUG] [wms.connector.OpenWMSSerialConnector] - Closed
2020-04-29 09:48:35.581 [INFO ] [wms.connector.OpenWMSSerialConnector] - Connecting to OpenWMS USB at /dev/ttyUSB0
2020-04-29 09:48:35.583 [DEBUG] [wms.connector.OpenWMSSerialConnector] - Serial port #### Jetzt gehts los
2020-04-29 09:48:35.600 [DEBUG] [wms.connector.OpenWMSSerialConnector] - Serial port event listener started
2020-04-29 09:48:35.603 [DEBUG] [penwms.connector.OpenWMSStreamReader] - Data listener started
2020-04-29 09:48:35.905 [DEBUG] [openwms.handler.OpenWMSBridgeHandler] - Try to send to controller

Are you sure the serial port initialization issue is the root cause?

@joerg_beck

Hi,
i don’t know why, but with the default libs from openhab2 the usb-stick is not initialized correctly. It is sufficient to open the serial port once with other libs (e.g. jssc). :thinking:
To solve this problem I still have to search for solutions 
 :roll_eyes:

Only for testing purposes I have included a workaround in the binding to initialize the serial port.
If you use it, please give me a short feedback if it works stable for you or not.
But please note that it is only a quick an dirty solution and the usage is at your own risk!

  1. download the Workaround and replace the original binding in the addon folder.
  2. restart openhab

(You may need to copy the lib jssc.jar to the addon folder as well)

Works for me - without having to copy jssc.jar.
Thanks

Hello Rainer, works for me. USB Stick is online. Thank you for the workaround.

Kind regards,
Sascha Jostock

Hello Rainer, now warema stick is online but i donÂŽt know how to find the panid of my blind actuator because scan is not working or i do anything wrong. My remote is the warema comfort when i start scan for things in inbox (L on remotecontrol pressed and remote is scanning) it only scans for about 1-2 seconds with no result. Do you have an idea whatÂŽs my fault?

Regards

1 Like

@rainer300

Hello Rainer,

after an update from openhab 2.5.1 to 2.5.5 I always got an Error in openhab.log:

2020-06-08 11:47:40.744 [ERROR] [openwms.handler.OpenWMSBridgeHandler] - Error occurred when trying to load native library for OS 'Linux' version '4.19.97-v7l+', processor 'arm' java.lang.UnsatisfiedLinkError: /openhab/.jssc/linux/libjSSC-2.7_armsf.so: /openhab/.jssc/linux/libjSSC-2.7_armsf.so: cannot open shared object file: No such file or directory

But I have checked the directory and the file /openhab/.jssc/linux/libjSSC-2.7_armsf.so is available:

-rw-r--r-- 1 openhab openhab 10539 Jun 11 15:45 libjSSC-2.7_armsf.so

Also I have downloaded and copied the jssc.jar file into the addons-Folder, but still have this issue. Do you have an idea what’s going wrong here?

One additional note: the stick was working with openhab version 2.5.1 before in the same environment.

Best regards,
Jörg

Hi,

I’m at the same stage than Klaus Harald (Binding for Warema Mobile System WMS).

My system:

  • WMS blind
  • WMS remote control plus
  • Warema WMS Stick 1002775
  • Raspberry Pi, Openhab 2.5

I’m using the lastest openwms jar from https://github.com/zeezee300/openwms.
I have other USB devices (somfy, elero
) working with openhab, so serial connection is no issue.

I have added the " OpenWMS WAREMA WMS-Stick Transceiver" thing and it shows that it is ONLINE.

Here is the conencton output:

12:34:27.182 [DEBUG] [.openwms.handler.OpenWMSBridgeHandler] - Initializing WMS bridge handler
12:34:27.201 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - 'openwms:bridge:dfb13bb2' changed from INITIALIZING to OFFLINE
12:34:27.218 [DEBUG] [.openwms.handler.OpenWMSBridgeHandler] - Checking OpenWMS transceiver connection, thing status should be = OFFLINE
12:34:27.226 [DEBUG] [.openwms.handler.OpenWMSBridgeHandler] - Connecting to OpenWMS transceiver
12:34:27.251 [DEBUG] [nwms.connector.OpenWMSSerialConnector] - Disconnecting
12:34:27.271 [DEBUG] [nwms.connector.OpenWMSSerialConnector] - Closed
12:34:27.278 [INFO ] [nwms.connector.OpenWMSSerialConnector] - Connecting to OpenWMS USB at /dev/ttyUSB2
12:34:27.285 [DEBUG] [nwms.connector.OpenWMSSerialConnector] - Serial port #### Jetzt gehts los
12:34:27.303 [DEBUG] [nwms.connector.OpenWMSSerialConnector] - Serial port #### Schritt 1 - open Port
12:34:27.318 [DEBUG] [nwms.connector.OpenWMSSerialConnector] - Serial port #### Schritt 2
12:34:27.325 [DEBUG] [nwms.connector.OpenWMSSerialConnector] - Serial port #### Schritt 3 230400
12:34:27.333 [DEBUG] [nwms.connector.OpenWMSSerialConnector] - Serial port #### Schritt 4
12:34:27.340 [DEBUG] [nwms.connector.OpenWMSSerialConnector] - Serial port #### Schritt 5
12:34:27.348 [DEBUG] [nwms.connector.OpenWMSSerialConnector] - Serial port #### Schritt 6
12:34:27.355 [DEBUG] [nwms.connector.OpenWMSSerialConnector] - Serial port #### Schritt 7
12:34:27.363 [DEBUG] [nwms.connector.OpenWMSSerialConnector] - Serial port event listener started
12:34:27.383 [DEBUG] [nwms.connector.OpenWMSSerialConnector] - Serial port #### Schritt 10 - workaround
12:34:27.386 [DEBUG] [openwms.connector.OpenWMSStreamReader] - Data listener started
12:34:27.400 [DEBUG] [nwms.connector.OpenWMSSerialConnector] - Workaround ## start Port: /dev/ttyUSB2
12:34:27.505 [DEBUG] [nwms.connector.OpenWMSSerialConnector] - Workaround ## Versuch 1
12:34:27.522 [DEBUG] [nwms.connector.OpenWMSSerialConnector] - Workaround ## ende
12:34:27.531 [DEBUG] [.openwms.handler.OpenWMSBridgeHandler] - Try to send to controller
12:34:27.563 [DEBUG] [.openwms.handler.OpenWMSBridgeHandler] - Message received: {gWMS USB-Stick}
12:34:27.576 [DEBUG] [.openwms.handler.OpenWMSBridgeHandler] - Get USB-Stick Version
12:34:28.548 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - 'openwms:bridge:dfb13bb2' changed from OFFLINE to ONLINE
12:34:28.568 [DEBUG] [.openwms.handler.OpenWMSBridgeHandler] - Message received: {v37605107   }
12:34:28.579 [DEBUG] [.openwms.handler.OpenWMSBridgeHandler] - Set USB-Stick Version

Now I’m trying to add my blindds.

I’m setting the remote in scan mode (L button, waiting for green light than red/orange) and are trying to discover a new OpenWMS binding thing in Openhab Paper UI but it is not found.

Here is the output:

3:14:49.685 [DEBUG] [enwms.internal.OpenWMSDeviceDiscovery] - Start scan
13:14:49.701 [DEBUG] [enwms.internal.OpenWMSDeviceDiscovery] - Scan - found Networkkey: null
13:14:49.724 [DEBUG] [enwms.internal.OpenWMSDeviceDiscovery] - Scan - found PANID: null

So not Networkkey and PANID found.

As I don’t know the device ID, device serial and PANID I can’t add it manually.
How can I proceed?
How to find out what fails during scan?
Anyway to retrieve the deviceId, serialID and PANID? I have WMS studio and toolkit on Windows, but no idea how to use it to retrieve those information.

I found out my PANID and network ID using WMS toolkit.
PANID: PANID
KeyId: Key1
Kanal 17

I found the following 2 projects which might be usefull for further development of the binding: https://217.160.142.88/topic/7336/iobroker-mit-warema-wms-web-control/29
https://www.npmjs.com/package/warema-wms-venetian-blinds-ws-api

Hi,
I have made some improvements:

  • new configuration for weather moduls,
  • new configuration parameters for blinds,
  • better discovery (incl. detect the PANID)

Pls. feel free to use the new version which can be downloaded at github.

Hey @rainer300, would you mind also publishing the source code, and not only the compiled JAR?

The binding is still quite unstable - it takes multiple tries before it can connect to the stick, and restarting openhab makes it unusable - the stick has to be physically unplugged/replugged.

Having access to the latest source code will definitely be helpful :slight_smile:

@rainer300
Thank you for the new version, which is an improvement for me! Now I get rid of the UnsatisfiedLinkError of the libjSSC-2.7_armsf.so.

But unfortunately I don’t get the Warema Stick Online. In the past I run the serialport.jar file and the Thing was Online. Now that does not help. Here is my log:

2020-07-07 07:59:51.598 [DEBUG] [openwms.handler.OpenWMSBridgeHandler] - Checking OpenWMS transceiver connection, thing status should be = OFFLINE
2020-07-07 07:59:51.600 [DEBUG] [openwms.handler.OpenWMSBridgeHandler] - Connecting to OpenWMS transceiver
2020-07-07 07:59:51.602 [DEBUG] [wms.connector.OpenWMSSerialConnector] - Disconnecting
2020-07-07 07:59:51.635 [DEBUG] [wms.connector.OpenWMSSerialConnector] - Serial port event listener stopped
2020-07-07 07:59:51.637 [DEBUG] [wms.connector.OpenWMSSerialConnector] - Interrupt serial listener
2020-07-07 07:59:51.668 [DEBUG] [penwms.connector.OpenWMSStreamReader] - Data listener stopped
2020-07-07 07:59:51.670 [DEBUG] [wms.connector.OpenWMSSerialConnector] - Close serial out stream
2020-07-07 07:59:51.672 [DEBUG] [wms.connector.OpenWMSSerialConnector] - Close serial in stream
2020-07-07 07:59:51.674 [DEBUG] [wms.connector.OpenWMSSerialConnector] - Close serial port
2020-07-07 07:59:51.681 [DEBUG] [wms.connector.OpenWMSSerialConnector] - Closed
2020-07-07 07:59:51.683 [INFO ] [wms.connector.OpenWMSSerialConnector] - Connecting to OpenWMS USB at /dev/ttyUSB0
2020-07-07 07:59:51.685 [DEBUG] [wms.connector.OpenWMSSerialConnector] - Serial port #### Jetzt gehts los
2020-07-07 07:59:51.701 [DEBUG] [wms.connector.OpenWMSSerialConnector] - Serial port event listener started
2020-07-07 07:59:51.704 [TRACE] [wms.connector.OpenWMSSerialConnector] - Send data (len=8): 4D253XXXXXXXXXXX
2020-07-07 07:59:51.705 [DEBUG] [penwms.connector.OpenWMSStreamReader] - Data listener started
2020-07-07 07:59:52.008 [DEBUG] [openwms.handler.OpenWMSBridgeHandler] - Try to send to controller
2020-07-07 07:59:52.010 [TRACE] [wms.connector.OpenWMSSerialConnector] - Send data (len=3): 7BXXXX

Do you have an idea how to get the Stick Online?

Best regards,
Jörg