Skip to content

Instantly share code, notes, and snippets.

@kelvinmo
Last active September 7, 2024 12:04
Show Gist options
  • Save kelvinmo/a182de0703ca17bb2259c754db9afe88 to your computer and use it in GitHub Desktop.
Save kelvinmo/a182de0703ca17bb2259c754db9afe88 to your computer and use it in GitHub Desktop.
Home Assistant blueprint for Ikea Somrig remote with zigbee2mqtt
blueprint:
name: IKEA Somrig (zigbee2mqtt)
description: Automate Ikea Somrig remote
source_url: https://gist.github.com/kelvinmo/a182de0703ca17bb2259c754db9afe88
domain: automation
input:
remote:
name: Remote
description: The remote to use
selector:
entity:
integration: mqtt
domain: switch
button_1_short_press:
name: Button 1 short press
description: Action to run on single press of Button 1
default: []
selector:
action: {}
button_1_long_press:
name: Button 1 long press
description: Action to run on long press of Button 1
default: []
selector:
action: {}
button_1_double_press:
name: Button 1 double press
description: Action to run on double press of Button 1
default: []
selector:
action: {}
button_2_short_press:
name: Button 2 short press
description: Action to run on single press of Button 2
default: []
selector:
action: {}
button_2_long_press:
name: Button 2 long press
description: Action to run on long press of Button 2
default: []
selector:
action: {}
button_2_double_press:
name: Button 2 double press
description: Action to run on double press of Button 2
default: []
selector:
action: {}
mode: restart
max_exceeded: silent
trigger:
- platform: state
entity_id: !input "remote"
attribute: action
action:
- variables:
command: "{{ trigger.to_state.state }}"
- choose:
- conditions:
- "{{ command == '1_short_release' }}"
sequence: !input button_1_short_press
- conditions:
- "{{ command == '1_long_release' }}"
sequence: !input button_1_long_press
- conditions:
- - "{{ command == '1_double_press' }}"
sequence: !input button_1_double_press
- conditions:
- "{{ command == '2_short_release' }}"
sequence: !input button_2_short_press
- conditions:
- "{{ command == '2_long_release' }}"
sequence: !input button_2_long_press
- conditions:
- - "{{ command == '2_double_press' }}"
sequence: !input button_2_double_press
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment