Skip to content

Instantly share code, notes, and snippets.

@azertyalex
Created November 23, 2022 15:59
Show Gist options
  • Save azertyalex/b5be76ee0377764ae36e06f9bef0bc89 to your computer and use it in GitHub Desktop.
Save azertyalex/b5be76ee0377764ae36e06f9bef0bc89 to your computer and use it in GitHub Desktop.
Home Assistant mqtt - Blueprint - IKEA TRADFRI 2 Button Dimmer
blueprint:
name: zigbee2mqtt IKEA 2-button remote
description: "This blueprint is for the IKEA on/off-remote switch when used with zigbee2mqtt.
It is for genral use so all buttons can be connected to any action of your choice.
Make sure to select the correct sensor for the remote."
domain: automation
input:
remote:
name: Remote
description: IKEA remote to use
selector:
entity:
integration: mqtt
domain: sensor
on_button_short:
name: On button short
description: Action to run when ON button SHORT press
default: []
selector:
action: {}
off_button_short:
name: Off button short
description: Action to run when OFF button SHORT pressed
default: []
selector:
action: {}
on_button_long:
name: On button long
description: Action to run when ON button LONG pressed (brightness up)
default: []
selector:
action: {}
off_button_long:
name: Off button long
description: Action to run when OFF button LONG pressed (brightness down)
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 == 'on' }}"
sequence: !input "on_button_short"
- conditions:
- "{{ command == 'off' }}"
sequence: !input "off_button_short"
- conditions:
- "{{ command == 'brightness_move_up' }}"
sequence: !input "on_button_long"
- conditions:
- "{{ command == 'brightness_move_down' }}"
sequence: !input "off_button_long"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment