Aqara Relay Controller Zigbee to use roller/blind

I am thinking to buy this device,Xiaomi Mijia Aqara Wireless Relay LLKZMK11LM , to control my blinds via home assistant.
Does anyone working with this device?? (yes please, say yes…) :blush:

https://es.aliexpress.com/i/33014653752.html?spm=a219c.12057483.0.0.234b6045PZ6XGh

I have thought to use MQTT Cover via zigbee.

My main concern would be:
0/ find help :slight_smile:
1 / prevent the two relays run at the same time. so i need to thing how to avoid this.:thinking:
2 / be able to control the percentage of blind.:selfie:

I would like to hear your experiences… :left_speech_bubble::speech_balloon:

Up
Any experience

I do have these relays, they are basically 2 separate relays and appear in HA as lights if you use deCONZ. I use template fan to change one as I use it in the bathrooms for light and fan
The have switch inputs on the module (mains in only) for each relay
Note, I have 2 and one sometimes turns the other relay on and off and randomly turns off when switched on. Must be faulty as the other works fine.

more experiences…?

I have same idea :

  1. Aqara relay is double channel and i’ll use 1 channel for open the roller and one for close. For prevent the two relays run at the same time must create a scene or blockly with conditions (if channel 1 is on => channel 2 off and if chnnel 2 is on => channel 1 off and auto channel off after x secons - time required to close / open the roller).
  2. To control the percentage of roller…must the time required for closing / opening must be timed and if total time is 5 seconds => 25% = 1.25s, 50% = 2.5s, 75%=3.75s and 100%=5s and it can be controlled with a scenario for example open 25% : turn on for 1.25s, after 1.25s auto off.

ummm sounds good…
who could test it…?
have you at the moment this relay?

I have also been working on this for a short while, altough i have not been looking at percentages, i would sugest a (Quick’N’Dirty ™?) solution as stated previously: open or close, add a delay long enaugh to completly open or close the shutter to the different direction, delay, stop invert delay stop for instance in pseudo code: -down -delay(60s) -stop -up -delay(5s) -stop

The above would be perfect just to set the blinds in their ‘vented’ position.

ofcourse trying to put the actual state or even just (top) or (bottom) half in lets say… an input_number might be nicer on the outside
Just an idea

input_number:
  shutter:
    name: Shutter Position
    initial: 0
    min: 0
    max: 11
    step: 1
    icon: mdi:window-shutter-open
# Some snippit i found and had set asside for future use
# it will be... no it IS broken but just an idea on how wild you could go
# immagination is not a factor, time and money tough...
#   icon_template: >-
#     {% if states('input_number.shutter')| between 0 and 9}
#       mdi:window-shutter-open
#     {% else if states('input_number.shutter')| equals 10}
#      mdi:window-shutter-alert
# This could be the vented position
#      {% else if states('input_number.shutter')| equals 11}}
#      mdi:window-shutter
#     {% endif %}

see the bottom side of the picture at the bottom

See
but harder to track on the software side. <- So… that’s my take on a possible solution.

As for what i have now that i can share:

Using Zigbee2mqtt:
Recently Interlock has been added to the commands/features, so this makes it perfect for our case.
you can switch the relay by mqtt/hass or by the physical switch connection of the aqara itself using a 2 way switch 1-line with 1-open contact and 1-close contact, the last command given will be kept.

A way to get 3 push buttons up, down and stop.
A disclamer tough, stop is a group of up and down together here in lovelace it is set as a entity group with switch.turn_off service if you have no extra layer of protection firmware/hardware you might burn down your house so do not use withouth interlock ENABLED

  - entity: group.studio_shutter_stop
    tap_action:
      action: call-service
      service: switch.turn_off
      service_data:
        entity_id:
          - group.studio_shutter_stop
    type: entity-button

-> do not use switch.turn_on 
cards:
  ~ I'm braking the configuration here to prevent blind copy which might brake 
     your hardware, possibly even cause the end of the world
  - entity: switch.studio_shutter_up
    hold_action:
      action: more-info
    icon: 'mdi:window-shutter-open'
    icon_height: 30px
    show_icon: true
    show_name: false
    tap_action:
      action: toggle
    type: entity-button
  - entity: group.studio_shutter_stop
    hold_action:
      action: more-info
    icon: 'mdi:window-shutter-alert'
    icon_height: 30px
    show_icon: true
    show_name: false
    tap_action:
      action: call-service
      service: switch.turn_off
      service_data:
        entity_id:
          - group.studio_shutter_stop
    type: entity-button
  - entity: switch.studio_shutter_down
    hold_action:
      action: more-info
    icon: 'mdi:window-shutter'
    icon_height: 30px
    show_icon: true
    show_name: false
    tap_action:
      action: toggle
    type: entity-button
icon_height: 30px
title: south window shutter
type: vertical-stack

see the top side of the picture an the bottom

at this time i hope this can give you a push in the right direction or an idea to work with.
That said my next goal us to use input_select which would be safer and just a better coded solution, but i cannot acess it with the pushbuttons and i don’t like to use a dropdown menu

There is also a little extra included at the bottom,

but for now and as it always goes for these sorts of projects… it works well enough and if/when i get some extra time i will improve on it

input_select:
  shutter_do:
    name: Shutter direction
    options:
      - stop
      - up
      - down
    initial: stop
    icon: mdi:window-shutter-open

automation:
  - alias: shutter stop
    trigger:
      - platform: state
        entity_id: input_select.shutter_do
        to: "stop"
    action:
      service: switch.turn_off
      data:
        entity_id:
          - switch.studio_shutter_down
          - switch.studio_shutter_up
  - alias: shutter up
    trigger:
      - platform: state
        entity_id: input_select.shutter_do
        to: "up"
    action:
    - service: switch.turn_off
      data:
        entity_id: switch.studio_shutter_down
    - service: switch.turn_on
      data:
        entity_id: switch.studio_shutter_up
  - alias: shutter down
    trigger:
      - platform: state
        entity_id: input_select.shutter_do
        to: "down"
    action:
    - service: switch.turn_off
      data:
        entity_id: switch.studio_shutter_up
    - service: switch.turn_on
      data:
        entity_id: switch.studio_shutter_down
# Not required but Home automation is for the lazy tech people so might aswel use it
  - alias: 'Open shutter when sun rises'
    trigger:
      platform: sun
      event: sunrise
      offset: "-00:20"
    action:
    - service: input_select.select_option
      data_template:
        entity_id: input_select.shutter_do
        option: "up"
  - alias: 'Close shutter when sun sets'
    trigger:
      platform: sun
      event: sunset
      offset: "00:20"
    action:
    - service: input_select.select_option
      data_template:
        entity_id: input_select.shutter_do
        option: "down"

New user, so i needed to sacrefice some layout formatting as i can only put use 1 picture
shutter-combined-picture

very nice…!

i have tested and it’s working.
im already working in a other way to configure the roller via mqtt .
here the link that im following to try to cover this zigbee relay as roller.

I have updated the config applied here:

Heyhey,

I also thought about buying this switch to control my window blinds. One thing I couldn’t find out is, if the switch has the option to physically (so when i would operate the switch by hand) block to activate both buttons? To be more specific: My apartment has electric window blinds and the switch in every room is designed, that I cannot have the UP and DOWN button pressed at the same time, it’s just not possible. If I want to push the DOWN button, I can only do this, if the UP button is not activated / pressed / however you wanna name it :slight_smile:

Can the switch actually do this? So somebody cannot by accident have UP and DOWN pressed and I don’t want to imagine what happens then :smiley:

Thanks and greetings,

Andy!

Hello Andy,

I had the same idea about using this relay as a roller shutter relay. From my experience I would not recommend it. It blew during a reset phase which I could not prevent. Something related to the hub… I am not sure.

I had it on a Somfy AC motor that luckily survived :slight_smile:

Hey Kristian,

I’m using the Shelly 2.5s now for all four roller shutters and THEY ARE AWESOME! Get them! :slight_smile: I’m in love with Shelly since then :slight_smile:

Has anyone managed to find a solution to this case? I have been trying for a long time to operate these relays with my blinds but the switches are not working correctly and I don’t know how to operate them. I’m starting to be unhinged already …

Just get Shelly 2.5s that’s all you need. Nothing more. They have various operation modes for one button, two buttons, for push on, push off… They are really the solution to automate electric roller blinds:
Just this little thing behind your switches (ignore the horrible wiring. I actually made the photo to show what I had to fix :wink: ):

And that’s how you can configure the switch for various layouts of buttons:

Ohhhhh, thanks, this image is from shelly’s application I suppose, you can save those parameters and then work with it from home assistant with mqtt?

Correct, that’s a screen from the app. But you only need the app to setup the device once, then never again as it has full MQTT support like every Shelly device AND all Shellies also natively (with the app, if you would use it) work without internet (just another sympathy bonus, imho).

The Shelly 2.5 also come with a calibrate setting in the app for the roller shutter mode, so it knows where 0% and 100% open is. Also: The physical buttons of course have full functionality and Shelly knows when you use a button. So it always knows the current position! It’s not like it only knows the position when you use the app!
Seriously: They thought of everything!

These the Shelly 2.5 MQTT docs: https://shelly-api-docs.shelly.cloud/#shelly2-5-mqtt
And that’s the general MQTT doc: https://shelly-api-docs.shelly.cloud/#mqtt-support

Here’s an example of one of my Shelly 2.5 in HA:

- platform: mqtt
  name: "[Living Room] Balcony Roller Shutter"
  device_class: shutter
  command_topic: "shellies/shellyswitch25-SERIALID/roller/0/command"
  position_topic: "shellies/shellyswitch25-SERIALID/roller/0/pos"
  set_position_topic: "shellies/shellyswitch25-SERIALID/roller/0/command/pos"
  availability_topic: "shellies/shellyswitch25-SERIALID/online"
  payload_available: "true"
  payload_not_available: "false"
  retain: false
  payload_open: "open"
  payload_close: "close"
  payload_stop: "stop"
  position_open: 100
  position_closed: 0
  optimistic: false

Note on my config: I’ve set retain to false, as my network is a bit wonky sometimes. I had my roller covers suddenly move like a ghost because of a still retained message… But you really don’t need retain flag for control messages. Retain is only useful for state update messages that you want to have clients that come after the message had sent to see.

Small note, which is a liiiiiiittle weird: You can’t activate MQTT via the app. You need to open the IP of the Shelly 2.5 in the browser. Yes, they also run a webserver that gives you all settings from the app plus even more, like enabling MQTT under “Security” I think it was

Shelly’s support has been added to HA 0.115. So starting 17/09 no need for MQTT.