ZHA - Linkind 5-Key Remote Control ZBT-RGBWSwitch-D0801

Hi guys, bear with me please because this is my first Blueprint. I found this Linkind remote on Amazon for only 10 dollars, so I decided to try to write a blueprint for it. Basically this blueprint allows the remote to work like this:

The remote has 3 modes. The modes can be cycled through by clicking the left hand button (looks like a refresh symbol). There is a green LED that cycles between 3 positions to show you what mode it is in. The first mode is the BRIGHTNESS mode. When selected, it allows you to cycle through 5 different brightness levels for the light entity(ies) that you’ve selected using the up and down arrows. The second mode is the COLOR TEMP mode, that allows you to cycle through 4 different color temperatures (for RGBW lights) also using the arrow keys. The third mode is the COLOR mode, which allows you to cycle through six different colors.

This is not the best way to set up this remote, but again, it’s my first ever blueprint. I want to try and update it to allow for setting the incremental change in brightness/color temp/color, not just set values. If someone else wants to give that a shot, that would be awesome. This blueprint alone makes this $10 remote worth the price in my opinion.

blueprint:
  name: ZHA - Linkind 5-Key Remote Control
  description: Automate your Linkind 5-Key Remote Control using ZHA events.
  domain: automation
  input:
    remote:
      name: Remote
      description: Linkind 5-Key Remote Control to use
      selector:
        device:
          integration: zha
          manufacturer: lk
          model: ZBT-RGBWSwitch-D0801
    light:
      name: Light(s)
      description: The light(s) to control
      selector:
        target:
          entity:
            domain: light


  source_url: https://community.home-assistant.io/t/zha-linkind-5-key-remote-control-zbt-rgbwswitch-d0801/328735
mode: restart
max_exceeded: silent

trigger:
- platform: event
  event_type: zha_event
  event_data:
    device_id: !input 'remote'
action:
- variables:
    command: '{{ trigger.event.data.command }}'
    cluster_id: '{{ trigger.event.data.cluster_id }}'
    endpoint_id: '{{ trigger.event.data.endpoint_id }}'
    args: '{{ trigger.event.data.args }}'
- choose:
  - conditions:
    - '{{ command == ''move_to_level'' }}'
    - '{{ cluster_id == 8 }}'
    - '{{ endpoint_id == 1 }}'
    - '{{ args == [255, 3] }}'
    sequence:
      - service: light.turn_on
        target: !input 'light'
        data:
          brightness: 255
  - conditions:
    - '{{ command == ''move_to_level'' }}'
    - '{{ cluster_id == 8 }}'
    - '{{ endpoint_id == 1 }}'
    - '{{ args == [191, 3] }}'
    sequence:
      - service: light.turn_on
        target: !input 'light'
        data:
          brightness: 191
  - conditions:
    - '{{ command == ''move_to_level'' }}'
    - '{{ cluster_id == 8 }}'
    - '{{ endpoint_id == 1 }}'
    - '{{ args == [127, 3] }}'
    sequence:
      - service: light.turn_on
        target: !input 'light'
        data:
          brightness: 127
  - conditions:
    - '{{ command == ''move_to_level'' }}'
    - '{{ cluster_id == 8 }}'
    - '{{ endpoint_id == 1 }}'
    - '{{ args == [64, 3] }}'
    sequence:
      - service: light.turn_on
        target: !input 'light'
        data:
          brightness: 64
  - conditions:
    - '{{ command == ''move_to_level'' }}'
    - '{{ cluster_id == 8 }}'
    - '{{ endpoint_id == 1 }}'
    - '{{ args == [13, 3] }}'
    sequence:
      - service: light.turn_on
        target: !input 'light'
        data:
          brightness: 13
  - conditions:
    - '{{ command == ''on'' }}'
    sequence:
      - service: light.toggle
        target: !input 'light'
  - conditions:
    - '{{ command == ''off'' }}'
    sequence:
      - service: light.toggle
        target: !input 'light'
  - conditions:
    - '{{ command == ''move_to_color_temp'' }}'
    - '{{ cluster_id == 768 }}'
    - '{{ endpoint_id == 1 }}'
    - '{{ args == [153, 3] }}'
    sequence:
      - service: light.turn_on
        target: !input 'light'
        data:
          color_temp: 153
  - conditions:
    - '{{ command == ''move_to_color_temp'' }}'
    - '{{ cluster_id == 768 }}'
    - '{{ endpoint_id == 1 }}'
    - '{{ args == [200, 3] }}'
    sequence:
      - service: light.turn_on
        target: !input 'light'
        data:
          color_temp: 200
  - conditions:
    - '{{ command == ''move_to_color_temp'' }}'
    - '{{ cluster_id == 768 }}'
    - '{{ endpoint_id == 1 }}'
    - '{{ args == [250, 3] }}'
    sequence:
      - service: light.turn_on
        target: !input 'light'
        data:
          color_temp: 250
  - conditions:
    - '{{ command == ''move_to_color_temp'' }}'
    - '{{ cluster_id == 768 }}'
    - '{{ endpoint_id == 1 }}'
    - '{{ args == [370, 3] }}'
    sequence:
      - service: light.turn_on
        target: !input 'light'
        data:
          color_temp: 370
          
          
  - conditions:
    - '{{ command == ''move_to_color'' }}'
    - '{{ cluster_id == 768 }}'
    - '{{ endpoint_id == 1 }}'
    - '{{ args == [15944, 5065, 10] }}'
    sequence:
      - service: light.turn_on
        target: !input 'light'
        data:
          color_name: red
  - conditions:
    - '{{ command == ''move_to_color'' }}'
    - '{{ cluster_id == 768 }}'
    - '{{ endpoint_id == 1 }}'
    - '{{ args == [14416, 2637, 10] }}'
    sequence:
      - service: light.turn_on
        target: !input 'light'
        data:
          color_name: orange
  - conditions:
    - '{{ command == ''move_to_color'' }}'
    - '{{ cluster_id == 768 }}'
    - '{{ endpoint_id == 1 }}'
    - '{{ args == [8519, 2612, 10] }}'
    sequence:
      - service: light.turn_on
        target: !input 'light'
        data:
          color_name: yellow
  - conditions:
    - '{{ command == ''move_to_color'' }}'
    - '{{ cluster_id == 768 }}'
    - '{{ endpoint_id == 1 }}'
    - '{{ args == [8012, 22404, 10] }}'
    sequence:
      - service: light.turn_on
        target: !input 'light'
        data:
          color_name: green
  - conditions:
    - '{{ command == ''move_to_color'' }}'
    - '{{ cluster_id == 768 }}'
    - '{{ endpoint_id == 1 }}'
    - '{{ args == [7208, 53738, 10] }}'
    sequence:
      - service: light.turn_on
        target: !input 'light'
        data:
          color_name: homeassistant
  - conditions:
    - '{{ command == ''move_to_color'' }}'
    - '{{ cluster_id == 768 }}'
    - '{{ endpoint_id == 1 }}'
    - '{{ args == [29820, 33507, 10] }}'
    sequence:
      - service: light.turn_on
        target: !input 'light'
        data:
          color_name: blue
  - conditions:
    - '{{ command == ''move_to_color'' }}'
    - '{{ cluster_id == 768 }}'
    - '{{ endpoint_id == 1 }}'
    - '{{ args == [35406, 28508, 10] }}'
    sequence:
      - service: light.turn_on
        target: !input 'light'
        data:
          color_name: darkviolet
  - conditions:
    - '{{ command == ''move_to_color'' }}'
    - '{{ cluster_id == 768 }}'
    - '{{ endpoint_id == 1 }}'
    - '{{ args == [44563, 20315, 10] }}'
    sequence:
      - service: light.turn_on
        target: !input 'light'
        data:
          color_name: deeppink
1 Like

how to add?

1 Like

Nice, got this remote and works for my TPLink Kasa lights.

Well done

1 Like

Awesome, thanks!

Hi, sorry I missed this. Use the URL to add it to Home Assistant:
Configuration → Blueprints → Import Blueprint, and paste in the URL of this page.

Aaron, after seeing this blueprint I checked Amazon and they had these for $7.99, so I bought a few of them (more than my wife needs to know about… lol). Blueprints have been great for my other zigbee buttons. I can’t wait to try these out using your blueprint. So far impressed with the build quality. Thanks for doing the blueprint and I plan to check out your youtube channel…

1 Like

Thanks! Battery life is pretty good on these! I haven’t even tried to develop this blueprint further, but it works fine

1 Like

OK… I have been playing around with the remote…and I saw your post on reddit about the button on the right (looks like a stack of paper). I read in the tiny print booklet that comes with it that this is suppose to cycle or let you group lights and I’m sure just in the Linkind eco system… Anyway, I was watching the zha_events and it doesn’t look like there is any change in the events no matter how you cycle the right hand button. It would be supper cool if that button could allow you to cycle thru devices in HA, but I just don’t see a way by looking at the events being fired… So far I can use it on any smart bulb (works as expected), wled (turn on and off and dim…), tuya dimmer switches–I guess because they are all in the light domain. I am really new to HA and learning as I go… Thanks again for all the work on the blueprint!!

1 Like

Yeah, that’s what I noticed when I watched th zha_events. Apparently in Zigbee2MQTT all the buttons work, so I think it’s a matter of having the proper custom quirks developed for ZHA, which is beyond me. i may put in a pull request for it at some point and have the legends of the zha dev community see what they can do

If that grouping button would work it would open up a lot of possibilities. I didn’t know for sure but suspected it was being limited by ZHA.

1 Like