ZHA - Lidl/Livarnolux/Tuya/Silvercrest 4 button remote

blueprint:
  source_url: https://github.com/Damian666/HomeAssistant/blob/main/blueprints/automation/Damian666/Lidl_4Button_Remote_Switch.yaml
  name: ZHA - Lidl 4 Button Remote Switch
  description: Automate your Lidl/LivarnoLux 4 Button Remote Switch using ZHA events.
  domain: automation

  input:
    Lidl_4Button_Remote:
      name: Lidl 4Button Remote
      description: Select the Lidl 4 Button Remote to use
      selector:
        device:
          integration: zha
          manufacturer: _TYZB01_bngwdjsr
          model: TS1001
          multiple: false
    button_one_short_press:
      name: Single Press
      description: Action to run on button 1 (OFF/0) single press
      default: []
      selector:
        action: {}
    button_two_short_press:
      name: Single Press
      description: Action to run on button 2 (ON/1) single press
      default: []
      selector:
        action: {}
    button_three_short_press:
      name: Single Press
      description: Action to run on button 3 (Bright) single press
      default: []
      selector:
        action: {}
    button_four_short_press:
      name: Single Press
      description: Action to run on button 4 (Dim) single press
      default: []
      selector:
        action: {}
mode: restart
max_exceeded: silent
trigger:
- platform: event
  event_type: zha_event
  event_data:
    device_id: !input 'Lidl_4Button_Remote'
action:
- variables:
    command: '{{ trigger.event.data.command }}'
    args: '{{ trigger.event.data.args }}'
    stepmode: '{{trigger.event.data.params.step_mode}}'
- choose:
  - conditions: '{{ command == ''off'' }}'
    sequence: !input 'button_one_short_press'
  - conditions: '{{ command == ''on'' }}'
    sequence: !input 'button_two_short_press'
  - conditions: '{{  command == ''step'' and stepmode == ''StepMode.Up'' }}'
    sequence: !input 'button_three_short_press'
  - conditions: '{{  command == ''step'' and stepmode == ''StepMode.Down'' }}'
    sequence: !input 'button_four_short_press'

image

Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled.

For everyone that just like me bought the Lidl starter set, but ditched the gateway.

This blueprint enables us to use the remote again with ZHA

Please let me know if there are issues, or stuff I could do better code wise :wink:

2 Likes

Hey Damian. I was about to share my blueprint and then saw yours. Good work! You’re missing out on 2 options, which are longpress_plus and longpress_minus (longpresses on buttons ON/OFF dont do anything). Add them and you have a solid blueprint. I also advice you to share the complete code in your 1st post and adding Tuya and Silvercrest to the name or description. Keep up the good work!!

The pieces of code that could be added (for more functionality):

#under input:
    longpress_plus_action:
      name: Longpress +
      description: Action to run when + is longpressed
      default: []
      selector:
        action: {}
    longpress_minus_action:
      name: Longpress -
      description: Action to run when - is longpressed
      default: []
      selector:
        action: {}

and…

variables:
  ...
  longpress_plus_action: !input "longpress_plus_action"
  longpress_minus_action: !input "longpress_minus_action"

aaand under actions:

      - conditions:
          - '{{ command == "step" }}'
          - "{{ args == [1, 51, 10] }}"
        sequence: !input "minus_action"
      - conditions:
          - '{{ command == "move" }}'
          - "{{ args == [0, 51,] }}"
        sequence: !input "longpress_plus_action"
      - conditions:
          - '{{ command == "move" }}'
          - "{{ args == [1, 51,] }}"
        sequence: !input "longpress_minus_action"```
1 Like

yea, i did not get that far yet, nice man. ill add it :slight_smile:

1 Like

this blueprint doesnt work for me - only buttons 1 and 2 function. buttons 3 and 4 dont function at all

the args parsing just wasn’t working at all for me so only the main buttons worked. This revised version works for me - it uses a new variable ‘stepmode’ to pull out the actions. Incidentally the strings ‘StepMode.Up’’ and ‘‘StepMode.Down’’ are not visible when viewing the zha_event in dev tools. I only spotted them when closely examing the trace

blueprint:
  name: ZHA - Lidl 4 Button Remote
  description: Automate your Lidl 4 Button Remote using ZHA events.
  domain: automation
  input:
    Lidl_4Button_Remote:
      name: Lidl 4Button Remote
      description: Select the Lidl 4 Button Remote to use
      selector:
        device:
          integration: zha
          manufacturer: _TYZB01_bngwdjsr
          model: TS1001
          multiple: false
    button_one_short_press:
      name: Single Press
      description: Action to run on button 1 (OFF/0) single press
      default: []
      selector:
        action: {}
    button_two_short_press:
      name: Single Press
      description: Action to run on button 2 (ON/1) single press
      default: []
      selector:
        action: {}
    button_three_short_press:
      name: Single Press
      description: Action to run on button 3 (Bright) single press
      default: []
      selector:
        action: {}
    button_four_short_press:
      name: Single Press
      description: Action to run on button 4 (Dim) single press
      default: []
      selector:
        action: {}
mode: restart
max_exceeded: silent
trigger:
- platform: event
  event_type: zha_event
  event_data:
    device_id: !input 'Lidl_4Button_Remote'
action:
- variables:
    command: '{{ trigger.event.data.command }}'
    args: '{{ trigger.event.data.args }}'
    stepmode: '{{trigger.event.data.params.step_mode}}'
- choose:
  - conditions: '{{ command == ''off'' }}'
    sequence: !input 'button_one_short_press'
  - conditions: '{{ command == ''on'' }}'
    sequence: !input 'button_two_short_press'
  - conditions: '{{  command == ''step'' and stepmode == ''StepMode.Up'' }}'
    sequence: !input 'button_three_short_press'
  - conditions: '{{  command == ''step'' and stepmode == ''StepMode.Down'' }}'
    sequence: !input 'button_four_short_press'
    

There are two other “commands” stop and move which I’m going to add support for but not at 1:52 am.

Hope this is useful. credit to original author.

More presses would be available if the quirck gets an update to report the repeated presses on the ON buttion.

I hope u are still alive and well Tachikoma :smiley: It’s been a while since that 1:52 :grin:

The one that u are referring to is the MoveMode for buttons 3 and 4 when longpressing them.
Add the following to make the blueprint more complete:

under input...
    button_three_long_press:
      name: B3 Long Press
      description: Action to run on button 3 (Bright) longpress
      default: []
      selector:
        action: {}
    button_four_long_press:
      name: B4 Long Press
      description: Action to run on button 4 (Dim) longpress
      default: []
      selector:
        action: {}

under variables...
    movemode: '{{trigger.event.data.params.move_mode}}'

under choose...  
  - conditions: '{{  command == ''move'' and movemode == ''MoveMode.Up'' }}'
    sequence: !input 'button_three_long_press'
  - conditions: '{{  command == ''move'' and movemode == ''MoveMode.Down'' }}'
    sequence: !input 'button_four_long_press'

cheers for the update :slight_smile:

Thanks for this nice automation. I was looking for it because I removed my LIDL hub and exchanged it with the Conbee II stick. However… the blueprint doesn’t work for me. I imported it and connected the automation for the LIDL remote and one bulb. Not any of the buttons shows a reaction. How can I check what’s wrong with my settings?

Edit: I reconnected the remote by pushing 0 and 1 for about 5 seconds. Now the “on” and “off” automation works again. Dimming is for later.