Skip to content

Instantly share code, notes, and snippets.

@alansaid
Last active February 3, 2022 21:50
Show Gist options
  • Select an option

  • Save alansaid/280cabd69eaa8e9afc4d3d250fdf35c8 to your computer and use it in GitHub Desktop.

Select an option

Save alansaid/280cabd69eaa8e9afc4d3d250fdf35c8 to your computer and use it in GitHub Desktop.

Revisions

  1. alansaid revised this gist Feb 3, 2022. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions aqara-opple2button.yaml
    Original file line number Diff line number Diff line change
    @@ -110,7 +110,7 @@ action:
    - '{{ event == "1_release" }}'
    sequence: !input 'button_left_hold_release'
    - conditions:
    - '{{ event == "1_long press" }}'
    - '{{ event == "1_hold" }}'
    sequence: !input 'button_left_hold_in'

    # ---------------------------- BUTTON TOP RIGHT ----------------------------
    @@ -127,6 +127,6 @@ action:
    - '{{ event == "2_release" }}'
    sequence: !input 'button_right_hold_release'
    - conditions:
    - '{{ event == "2_long press" }}'
    - '{{ event == "2_hold" }}'
    sequence: !input 'button_right_hold_in'

  2. alansaid renamed this gist Jan 26, 2022. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  3. alansaid revised this gist Jan 26, 2022. 1 changed file with 6 additions and 5 deletions.
    11 changes: 6 additions & 5 deletions oppe2button.yaml
    Original file line number Diff line number Diff line change
    @@ -50,35 +50,35 @@ blueprint:

    # ---------------------------- BUTTON TOP RIGHT ----------------------------
    button_right_single_press:
    name: Reft button - Single press
    name: Right button - Single press
    description: Action to run on a single press of the right button
    default: []
    selector:
    action: {}

    button_right_double_press:
    name: Reft button - Double press
    name: Right button - Double press
    description: Action to run on a double press of the right button
    default: []
    selector:
    action: {}

    button_right_triple_press:
    name: Reft button - Triple press
    name: Right button - Triple press
    description: Action to run on a triple press of the right button
    default: []
    selector:
    action: {}

    button_right_hold_release:
    name: Reft button - Hold release
    name: Right button - Hold release
    description: Action to run when right button was held in and released
    default: []
    selector:
    action: {}

    button_right_hold_in:
    name: Reft button - Hold in
    name: Right button - Hold in
    description: Action to run when right button is held in
    default: []
    selector:
    @@ -129,3 +129,4 @@ action:
    - conditions:
    - '{{ event == "2_long press" }}'
    sequence: !input 'button_right_hold_in'

  4. alansaid created this gist Jan 26, 2022.
    131 changes: 131 additions & 0 deletions oppe2button.yaml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,131 @@
    blueprint:
    name: ZHA - Aqara Opple - Wireless Scene Switch 2 Button
    description: 'Control anything using Aqara Opple two button remote'
    domain: automation
    input:
    remote:
    name: Remote
    description: Opple remote to use
    selector:
    device:
    integration: zha
    manufacturer: LUMI
    model: lumi.remote.b286opcn01

    # ---------------------------- BUTTON TOP LEFT ----------------------------
    button_left_single_press:
    name: Left button - Single press
    description: Action to run on a single press of the left button
    default: []
    selector:
    action: {}

    button_left_double_press:
    name: Left button - Double press
    description: Action to run on a double press of the left button
    default: []
    selector:
    action: {}

    button_left_triple_press:
    name: Left button - Triple press
    description: Action to run on a triple press of the left button
    default: []
    selector:
    action: {}

    button_left_hold_release:
    name: Left button - Hold release
    description: Action to run when left button was held in and released
    default: []
    selector:
    action: {}

    button_left_hold_in:
    name: Left button - Hold in
    description: Action to run when left button is held in
    default: []
    selector:
    action: {}

    # ---------------------------- BUTTON TOP RIGHT ----------------------------
    button_right_single_press:
    name: Reft button - Single press
    description: Action to run on a single press of the right button
    default: []
    selector:
    action: {}

    button_right_double_press:
    name: Reft button - Double press
    description: Action to run on a double press of the right button
    default: []
    selector:
    action: {}

    button_right_triple_press:
    name: Reft button - Triple press
    description: Action to run on a triple press of the right button
    default: []
    selector:
    action: {}

    button_right_hold_release:
    name: Reft button - Hold release
    description: Action to run when right button was held in and released
    default: []
    selector:
    action: {}

    button_right_hold_in:
    name: Reft button - Hold in
    description: Action to run when right button is held in
    default: []
    selector:
    action: {}

    mode: restart
    max_exceeded: silent
    trigger:
    - platform: event
    event_type: zha_event
    event_data:
    device_id: !input 'remote'
    action:
    - variables:
    event: '{{ trigger.event.data.command }}'
    - choose:

    # ---------------------------- BUTTON TOP LEFT ----------------------------
    - conditions:
    - '{{ event == "1_single" }}'
    sequence: !input 'button_left_single_press'
    - conditions:
    - '{{ event == "1_double" }}'
    sequence: !input 'button_left_double_press'
    - conditions:
    - '{{ event == "1_triple" }}'
    sequence: !input 'button_left_triple_press'
    - conditions:
    - '{{ event == "1_release" }}'
    sequence: !input 'button_left_hold_release'
    - conditions:
    - '{{ event == "1_long press" }}'
    sequence: !input 'button_left_hold_in'

    # ---------------------------- BUTTON TOP RIGHT ----------------------------
    - conditions:
    - '{{ event == "2_single" }}'
    sequence: !input 'button_right_single_press'
    - conditions:
    - '{{ event == "2_double" }}'
    sequence: !input 'button_right_double_press'
    - conditions:
    - '{{ event == "2_triple" }}'
    sequence: !input 'button_right_triple_press'
    - conditions:
    - '{{ event == "2_release" }}'
    sequence: !input 'button_right_hold_release'
    - conditions:
    - '{{ event == "2_long press" }}'
    sequence: !input 'button_right_hold_in'