Instantly share code, notes, and snippets.
Created Nov 23, 2022
Home Assistant mqtt - Blueprint - IKEA TRADFRI 2 Button Dimmer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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