Help adding new Zigbee Roller Shutter Controller

Hi there,

I use HA since November last year and found it quite easy to add sensors and switches from Xiaomi and Osram via zigbee2mqtt.
I have now integrated several Merten Wiser roller-shutter controllers into my house. With the help of KoenK I managed to pair them with zigbee2mqtt on my RPi and can send commands like “open”, “close”, “stop” and any positition between 0 and 100% via MQTT (MQTT.fx or Developer tab in HA). So far so good.
They even get auto discovered by HA, but I only get to see the auto discovery of the buttons on the controller. They get discovered via the MQTT message:

topic: homeassistant/device_automation/0x588e81fffe127538/action_close_21/config
payload: '{"automation_type":"trigger","type":"action","subtype":"close_21","payload":"close_21","topic":"zigbee2mqtt/0x588e81fffe127538/action","device":{"identifiers":["zigbee2mqtt_0x588e81fffe127538"],"name":"0x588e81fffe127538","sw_version":"Zigbee2MQTT 1.14.3","model":"Merten PlusLink Shutter insert with Merten Wiser System M Push Button (MEG5113-0300/MEG5165-0000)","manufacturer":"Schneider Electric"}}'

Under devices I can see the controller, but it has no entities connected and if I try to send further messages via MQTT to auto discover more functions, I get no response.

I tried e.g.:

topic: homeassistant/cover/0x588e81fffe1399d8/config
payload: "{\"device_class\":\"shutter\",\"command_topic\":\"zigbee2mqtt/0x588e81fffe1399d8/set/state\",\"position_topic\":\"zigbee2mqtt/0x588e81fffe1399d8\",\"value_template\":'{{ value_json.position }}'}"

No effect there.
I can however add an entity to configuration.yaml and then I get a working entity, that can control the shutter (up, down, stop and position via slider) - however, this is not connected with the device in the GUI (no link) and the slider is also not updated with the position that is published over MQTT.
I googled like crazy, but can’t seem to figure out what is wrong.
This is what I add in configuration.yaml:

#configure Rolladensteuerung
  - platform: mqtt
    name: "Rolladen Treppe"
    unique_id: "0x588e81fffe1399d8"
    command_topic: "zigbee2mqtt/0x588e81fffe1399d8/set/state"
    position_topic: "zigbee2mqtt/0x588e81fffe1399d8"
    set_position_topic: "zigbee2mqtt/0x588e81fffe1399d8/set/position"
    qos: 0
    retain: true
    payload_open: "OPEN"
    payload_close: "CLOSE"
    payload_stop: "STOP"
    position_open: 100
    position_closed: 0
    optimistic: false
    value_template: '{{ value.position}}'

And here is the position message from the zigbee2mqtt debug log:

info  2020-08-28 21:44:35: MQTT publish: topic 'zigbee2mqtt/0x588e81fffe1399d8', payload '{"linkquality":5,"position":98}'

I’m already close, but need some hints how to put it together… thanks for any ideas!

Best regards,

OK, after some more trying and playing, I figured out how I can send the right MQTT messages to make HA autodiscover the shutters. Problems were mainly due to Syntax errors. Here’s how it works for me when sending from HA Developer-Services-MQTT.publish:

MQTT Cover:

topic: homeassistant/cover/0x588e81fffe127538/config
payload: "{\"device\":{\"identifiers\":[\"zigbee2mqtt_0x588e81fffe127538\"]},\"command_topic\": \"zigbee2mqtt/0x588e81fffe127538/set/state\",\"set_position_topic\": \"zigbee2mqtt/0x588e81fffe127538\",\"set_position_template\": \"{ \\\"position\\\": {{ position }} }\",\"position_topic\": \"zigbee2mqtt/0x588e81fffe127538\",\"value_template\": \"{{ value_json.position }}\",\"retain\": true, \"position_open\": 100, \"position_closed\": 0}"


topic: homeassistant/sensor/0x588e81fffe127538/config
payload: "{\"device\":{\"identifiers\":[\"zigbee2mqtt_0x588e81fffe127538\"]},\"state_topic\": \"zigbee2mqtt/0x588e81fffe127538\",\"value_template\": \"{{ value_json.linkquality }}\"}"
1 Like

@7h0mas-R - Hello - can you assistant me with my installation? I also have the Merten Wiser Touch and shutters but am a novice and would very much like to understand how to control them. I have ordered a Tubes coordinator which I’m awaiting delivery. After which I’m assuming I can begin. I’m running on a VM docker installation and not a Pi. It seems like very few people understand these devices so I’m grasping at anyone who can help.

Hi Frank! Welcome! Unfortunately, I can probably not offer much of support, because you have quite a different setup than what I use.
With the Wiser Touch you already have a proprietary Merten/Schneider Bridge, which you can pair with your Merten shutter controllers. I use a Zigbee-USB-Stick on an RPi to connect the Merten Controllers. I have no Wiser Touch.
If you use the Touch, you will probably not be able to use Zigbee2MQTT, as I do. As far as I know, the Zigbee devices can only connect to one Bridge at a time, so you won’t be able to pair them with Zigbee2MQTT when using the Touch. Zigbee2MQTT was exactly designed, to get independent of proprietary bridges and be able to mix Zigbee devices from different vendors, using cheap adapters.

So you can either use the Touch (and maybe connect HomeAssistant to a websocket interface or similar, if there is an API for that in the Touch) or another adapter supported by Zigbee2MQTT.
The Tubes coordinator (at least one they offer) seems to be supported by Zigbee2MQTT.
If you only have Merten Products, you may still find the Touch easier to setup. If you want to start mixing, try out HomeAssistant + Zigbee2MQTT. Once you have setup the Tubes and Zigbee2MQTT, you basically have to follow the pairing instructions and the controls should automatically show up as a new device.
If you do not like the open source solution, you can always factory reset the Shutter controls and pair them again with the Touch. If you run into issues with Zigbee2MQTT, feel free to come back here and ask.

The docker VM should probably not make a big difference, although I do not run Docker. It is mainly important, to get the USB bridge up and running with Zigbee2MQTT.

1 Like

@7h0mas-R - I didn’t fully comprehend your initial writing due to my being a novice :grinning: , but now I understand what you were saying!

I configured 1 of the shutters to work directly with the ZHA and which gives me greater control than the Touch. The touch is fine for basics but I want to open/close/etc more based on environmentals and not just time.

It appears that the :arrow_up: are confused though. The current state is open but down arrow is greyed out but the up arrow is enabled. Any ideas here?

Thanks for your great explanation!


Hi Frank, nice to hear that it works. It always takes a while to get some ideas behind it straight-I remember when I started.
There is a functionality in the Zigbee2MQTT implementation, that allows to swap direction.
It is not exposed in the Home assistant Interface directly, so you will need to go to „Settings-AddOns-Zigbee2MQTT-User Interface“
In the User Interface, find your shutter and go to „Settings (specific)“. There you find an „Invert_cover“ switch.
Try if that helps

Thanks @7h0mas-R - unfortunately I am using ZHA at the moment and have not migrated to Z2M as of yet.

I know Z2M offers more capabilities but I don’t want to break my current setup. I will try in the future though.

Ok, but I‘m still a bit puzzled…. I think I remember, that the direction to insert the shutter driver was indicated on the housing, so pressing the „up“ button on the switch should do the same as the command sent via Zigbee.
Could it be, that your Controller is mounted the wrong way round and you compensated that by swapping the two cables to the motor?

@7h0mas-R - I didn’t install them but I will definitely give that a look! Thanks!

Ah, didn‘t think of that. Be careful, if you are not familiar with household installations - the operation voltage is dangerous.
It should also be possible, to do this with HA on-board methods using code.
I found a thread with a workaround here.
In Zigbee2MQTT there is an invert cover Boolean for that purpose.
Probably not too difficult to implement in ZHA as well - but have no time to look into this.
I assume, that the Merten Bridge also had such a setting, so the electrician is free to choose the Installation orientation to fit the Situation best