Warema WMS Integration

Integration for Warema WMS Webcontrol? For Blinds and Shutters?

I’m working on something, stay tuned :slight_smile:

2 Likes

The idea is to have a solution architecturally similar to the new Zwave JS - an integration + an add-on that handles the hardware.

A development version of the add-on exists here, and it’s based on this this javascript library. The long term plan is to contribute/fork/rewrite in python, still not clear how much time I can invest in this.

The integration is right now under development, and it’s basically a clone of ZWave JS and for my own sanity, uses MQTT. The setup flow is complete, will now focus on discovery. There’s no published code yet.
There’s a very primitive implementation out there, with tons of drawbacks/TODOs, but it exposes devices/entities and supports basic UP/DOWN/STOP.

I’m planning to add features in the next days, then clean-up the code.

Supported now:

  • Availability (items will be grayed out in the UI if the add-on is not running)
  • Position reports
  • Position set
  • “Ignore” devices - comma-separated list of serial numbers to ignore from discovery
  • “Force” devices - comma-separated list of serial numbers to control (when discovery fails to detect all the devices, put all the serials here. this will disable discovery)
  • sensors from Weather Stations (temperature, luminance)

Hi Giuseppe,

Do you maybe have some hints for me why network discovery is not working. (I tried it with the npm-module you referenced). It recognizes my stick but if I try to exchange the network-properties it always tells me

wmsTimeout 5000 scanResponse 388B10 "{R01388B107021FFFF02}".

Cheers & Thx for any help!

Hi Florian,

After the installation, you must select the USB device in the add-on configuration, and leave all the other fields as default. This will start the add-on in “discovery” mode, where you can use a remote to detect the PAN ID and WMS key. Just follow the instructions in the logs to get those parameters.

If you have a wall-mounted remote, instead of a hand-held one, skip the first two steps (open battery case and select channel).

Make sure to follow the steps carefully (you should get the Stick scanned by SNR XXXXXX. and *** Waving and Hello! (requested from SNR XXXXXX) messages, or something is wrong).

Hey Giuseppe,
Unfortunately - it looks like that this process is not working with my setup. Any ideas maybe?

[cont-init.d] 00-banner.sh: exited 0.
[cont-init.d] 01-log-level.sh: executing... 
[cont-init.d] 01-log-level.sh: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[11:42:59] INFO: Starting the Warema bridge...
[11:42:59] INFO: Setting WMS_CHANNEL to 17
[11:42:59] INFO: Setting WMS_SERIAL_PORT to /dev/ttyUSB1
[11:42:59] INFO: Setting IGNORED_DEVICES to .
[11:42:59] INFO: MQTT available, fetching server detail ...
[11:42:59] INFO: MQTT server settings not configured, attempting auto-discovery...
[11:42:59] INFO: Configuring 'mqtt://core-mosquitto:1883' mqtt server
[11:42:59] INFO: MQTT credentials not configured, attempting auto-discovery...
[11:42:59] INFO: Configuring 'addons' mqtt user
Connected to MQTT
warema/bridge/state:offline
Unrecognised command from HA
01 11:43:00.085 I --------------------------------------------------------------------------------
01 11:43:00.086 I Starting getting network paramters...
01 11:43:00.086 I - Open the battery case of the WMS Handheld transmitter.
01 11:43:00.086 I - Select the channel using the (+) button.
01 11:43:00.086 I   Notice: If an unassigned channel is selected, press the (+) button for 5 s.
01 11:43:00.086 I           As soon as the LED flashes, all channels can be selected by
01 11:43:00.086 I           pressing the (+) button again
01 11:43:00.086 I - Press the learn button in the battery case of the the WMS Handheld
01 11:43:00.086 I   transmitter for approx. 5 s. LEDS go green; the transmission LED flashes.
01 11:43:00.086 I   For several seconds, the WMSHand-held transmitter plus scans the operating 
01 11:43:00.086 I   range for devices.
01 11:43:00.086 I - Each time when scanning stops with red LED perform steps:
01 11:43:00.086 I   1)  When you press the control button (A), you can check WHICH target device
01 11:43:00.086 I       was just found.
01 11:43:00.086 I   2) If you can *not* see the output
01 11:43:00.086 I        "*** Waving and Hello!"
01 11:43:00.086 I      on the screen after pressing (A) another device than the WMS Stick has
01 11:43:00.086 I      been found. Press the (C) button to switch to the next receiver.
01 11:43:00.087 I   3) If you can see the output
01 11:43:00.087 I        "*** Waving and Hello!"
01 11:43:00.087 I      on the screen after pressing (A) then the WMS Stick has been found. 
01 11:43:00.087 I      Press the STOP button to assign the WMS Stick to the channel. After 
01 11:43:00.087 I      pressing STOP the network parameters are dislayed on the screen. 
01 11:43:00.087 I - Press Ctrl-C to abort.
01 11:43:33.720 I *** Stick scanned by SNR 1084216.
01 11:43:34.727 I *** Stick scanned by SNR 1084216.
01 11:43:35.732 I wmsTimeout 2000 scanResponse 388B10 "{R01388B107021FFFF02}".
01 11:43:35.734 I *** Stick scanned by SNR 1084216.
01 11:43:37.744 I wmsTimeout 2000 scanResponse 388B10 "{R01388B107021FFFF02}".
01 11:45:59.983 I Timeout occured detecting WMS network parameters.
01 11:45:59.983 I Please complete operation within 3 minutes.
01 11:45:59.986 I --------------------------------------------------------------------------------

I can’t really tell what’s happening here. The wmsTimeout is surprising, that usually happens when devices are out of range - can you make sure that the remote you’re using is not too far from the Warema USB stick, when running this process?

Hi Giuseppe,

Sorry I’ve seen your message just now! - I think distance should not be a problem as I was around 1m away during this process.

Maybe it’s a incompatibility with the stick or the remote? I’ve seen that there are two different article-numbers of warema sticks out there. I were not able to recognize any difference but - never now or?

Anyhow - I do not have a basic-warema-remote but the comfort one - I hope that this is not also a problem at all.

Cheers

Command back - I’ve overseen that the article-number on the packaging is another than on the stick itselft.

BTW: it looks like that this is a problem with the USB-Stack in ESXI as I’ve installed homeassistant in ESXI and passed the stick-directly to the HASS.io machine. I tried to attach the stick now directly to a physical test-machine where I installed debian and the npm-modules from https://www.npmjs.com/package/warema-wms-venetian-blinds which you’re using as base and voila - recognition of the stick worked :slight_smile:

I assigned the stick now back to Hass.io with the correct filled out parameters. It get’s recognized but it only provide me the values from the weaterstation - but I do not have devices for the blinds on my balcony.

Cheers

That’s great to hear!

Could you please provide logs from the add-on startup, particularly the 20/30 lines right after the Warema init completed message

At the moment, it detects the blinds after the stick is initialized, and adds them to HA. I’ve only tested it with a specific type of shades, it might just be that yours have a different type and are simply not handled.

Hi again,

Here we go with the logs:

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 00-banner.sh: executing... 
-----------------------------------------------------------
 Add-on: Warema Bridge
 Control your Warema WMS system
-----------------------------------------------------------
 Add-on version: dev
 You are running the latest version of this add-on.
 System: Home Assistant OS 5.11  (amd64 / qemux86-64)
 Home Assistant Core: 2021.2.3
 Home Assistant Supervisor: 2021.03.4
-----------------------------------------------------------
 Please, share the above information when looking for help
 or support in, e.g., GitHub, forums or the Discord chat.
-----------------------------------------------------------
[cont-init.d] 00-banner.sh: exited 0.
[cont-init.d] 01-log-level.sh: executing... 
[cont-init.d] 01-log-level.sh: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[12:53:06] INFO: Starting the Warema bridge...
[12:53:06] INFO: Setting WMS_KEY to [there_comes_the_key]
[12:53:06] INFO: Setting WMS_PAN_ID to DA04
[12:53:06] INFO: Setting WMS_CHANNEL to 17
[12:53:06] INFO: Setting WMS_SERIAL_PORT to /dev/ttyUSB1
[12:53:06] INFO: Setting IGNORED_DEVICES to .
[12:53:07] INFO: MQTT available, fetching server detail ...
[12:53:07] INFO: MQTT server settings not configured, attempting auto-discovery...
[12:53:07] INFO: Configuring 'mqtt://core-mosquitto:1883' mqtt server
[12:53:07] INFO: MQTT credentials not configured, attempting auto-discovery...
[12:53:07] INFO: Configuring 'addons' mqtt user
Warema init completed
05 12:53:07.714 I Interval for position update: 30 seconds.
onnected to MQTT
warema/bridge/state:offline
Unrecognised command from HA
warema/1099761/availability:online
Unrecognised command from HA
05 12:53:08.476 I wmsTimeout 750 scanRequest 000000 "{R04FFFFFF7020DA0402}".
05 12:53:09.238 I wmsTimeout 750 scanRequest 000000 "{R04FFFFFF7020DA0402}".
05 12:53:09.999 I wmsTimeout 750 scanRequest 000000 "{R04FFFFFF7020DA0402}".
[]
warema/1099761/illuminance/state:100000
Unrecognised command from HA
warema/1099761/temperature/state:92.5
Unrecognised command from HA
warema/1099761/illuminance/state:100000
Unrecognised command from HA
warema/1099761/temperature/state:92.5
Unrecognised command from HA
.....

Hello Giuseppe, thank you so much for taking this up! We have a whole bunch of Warema WMS Raffstores / blinds and a Warema weather station in our house. This so far has been a critically missing piece in our home automation for which I just did not know how to get it into HASS. This would be totally awesome!

Hey, you can add https://github.com/giannello/addon-warema-bridge this as a repository to your add-on store and install the add-on.

Thanks Florian.

The scanRequest is not returning any item, which usually means that the shades are out of range.

After the last HA updates (yesterday), my home setup is behaving the same way - maybe something changed and it’s not playing nice with usb devices? I’ll take some time this weekend to downgrade and see exactly when and why it breaks.

If you feel extra motivated, you can also run the docker image of the add-on on a computer, and point it to HA’s MQTT server.

From my tests, looks like USB3 is the culprit.
When updating, I also moved the USB stick I use as a boot drive to one of the USB3 ports on my RPI4. If I move it back to USB2, I can scan devices again. To make it work while booting from USB3, I have to connect the stick to an USB extension cord, and keep it a few centimeters away from the RPI4.

You might want to try with an extension cord :smiley:

erm - I don’t know how to do this … When I try to build the docker image from the git-repository it tells

COPY failed: file not found in build context or excluded by .dockerignore: stat rootfs/srv/package-lock.json: file does not exist

Blockquote[quote=“giannello, post:17, topic:272124”]
From my tests, looks like USB3 is the culprit.
When updating, I also moved the USB stick I use as a boot drive to one of the USB3 ports on my RPI4. If I move it back to USB2, I can scan devices again. To make it work while booting from USB3, I have to connect the stick to an USB extension cord, and keep it a few centimeters away from the RPI4.

You might want to try with an extension cord
[/quote]

I’m not running homeassistant on RPI but on VMware ESXi with the official HA-OVA. I directly passed the USB-Stick to the HomeAssistant virtual-machine - and this is although USB2.0 because the VM does not support USB3.

Anyhow I recognised that there is a error-message on the console when I attach the USB-Stick to it

[somenumber] ftdi_sio ttyUSB1: error from flowcontrol urb

from my short googling It points out that this maybe is an kernel-problem with the ftdi-chipset of the USB-Stick.

I’ve realized the docker image won’t work outside hassio without changes, so I’ve published a “standalone” version that doesn’t depend on hassio to work.

docker run -e WMS_KEY=XXX -e WMS_PAN_ID=XXXX -e WMS_SERIAL_PORT=/dev/ttyUSB0 -e MQTT_USER=warema -e MQTT_PASSWORD=changeme -e MQTT_SERVER=mqtt://homeassistant.local:1883 --device=/dev/ttyUSB0 -it giannello/addon-warema-bridge-standalone

Make sure the mqtt broker is configured to allow username/password authentication, in hassio it’s enough to add

logins:
  - username: warema
    password: changeme