Skip to content

Instantly share code, notes, and snippets.

@crowbarsolutions
Created June 5, 2024 16:47
Show Gist options
  • Save crowbarsolutions/8f974c4bd7c76b4c50efef2731141306 to your computer and use it in GitHub Desktop.
Save crowbarsolutions/8f974c4bd7c76b4c50efef2731141306 to your computer and use it in GitHub Desktop.
blueprint:
# Custom control via IKEA Symfonisk Gen2
# Based on https://community.home-assistant.io/t/z2m-ikea-symfonisk-gen2-e2123-media-control-v1-55/559523 Shawsky
name: Z2M - IKEA Symfonisk sound controller GEN2 custom actions
description:
'Trigger custom actions with an IKEA Symfonisk sound controller GEN2 via Zigbee2MQTT (Z2M)'
domain: automation
input:
remote:
name: Remote
description: The IKEA Symfonisk controller GEN2 to use
selector:
device:
filter:
- integration: mqtt
manufacturer: IKEA
model: SYMFONISK sound remote gen2 (E2123)
- integration: mqtt
manufacturer: IKEA
model: SYMFONISK sound remote, gen 2 (E2123)
base_topic:
name: Zigbee2MQTT Base mqtt topic
description: The base topic configured in Zigbee2MQTT. If you haven't changed this, leave the default here ("zigbee2mqtt")
default: zigbee2mqtt
play_pause:
name: Play/Pause
description: Action to run on play/pause press
default: []
selector:
action: {}
previous_track:
name: Previous Track
description: Action to run on previous track press
default: []
selector:
action: {}
next_track:
name: Next Track
description: Action to run on next track press
default: []
selector:
action: {}
volume_up:
name: Volume Up
description: Action to run on volume up press
default: []
selector:
action: {}
volume_up_long_press:
name: Volume Up (Long)
description: Action to run on volume up long press
default: []
selector:
action: {}
volume_down:
name: Volume Down
description: Action to run on volume down press
default: []
selector:
action: {}
volume_down_long_press:
name: Volume Down (Long)
description: Action to run on volume down long press
default: []
selector:
action: {}
single_dot:
name: Single Dot (Single)
description: Action to run on single dot press
default: []
selector:
action: {}
single_dot_double_press:
name: Single Dot (Double)
description: Action to run on single dot double press
default: []
selector:
action: {}
single_dot_long_press:
name: Single Dot (Long)
description: Action to run on single dot long press
default: []
selector:
action: {}
double_dot:
name: Double Dot (Single)
description: Action to run on double dot press
default: []
selector:
action: {}
double_dot_double_press:
name: Double Dot (Double)
description: Action to run on double dot double press
default: []
selector:
action: {}
double_dot_long_press:
name: Double Dot (Long)
description: Action to run on double dot long press
default: []
selector:
action: {}
mode: restart
max_exceeded: silent
trigger_variables:
base_topic: !input base_topic
controller: !input remote
trigger:
- platform: mqtt
topic: "{{ base_topic }}/+/action"
condition:
- condition: template
value_template: "{{ trigger.topic == base_topic+'/'+device_attr(controller, 'name')+'/action' }} "
action:
- variables:
controllertopic: "{{ base_topic }}/{{ device_attr(controller, 'name') }}/action"
- choose:
- conditions:
- "{{ trigger.payload != ''}}"
- "{{ trigger.topic == controllertopic }}"
sequence:
- choose:
# Play/Pause Press
- conditions: "{{ trigger.payload == 'toggle' or trigger.payload == 'play_pause' }}"
sequence: !input play_pause
# Previous Track Press
- conditions: "{{ trigger.payload == 'track_previous' }}"
sequence: !input previous_track
# Next Track Press
- conditions: "{{ trigger.payload == 'track_next' }}"
sequence: !input next_track
# Volume Up Press
- conditions: "{{ trigger.payload == 'volume_up' }}"
sequence: !input volume_up
# Volume Up Long Press
- conditions: "{{ trigger.payload == 'volume_up_hold' }}"
sequence: !input volume_up_long_press
# Volume Down Press
- conditions: "{{ trigger.payload == 'volume_down' }}"
sequence: !input volume_down
# Volume Down Long Press
- conditions: "{{ trigger.payload == 'volume_down_hold' }}"
sequence: !input volume_down_long_press
# Single Dot Press
- conditions: "{{ trigger.payload == 'dots_1_short_release' }}"
sequence: !input single_dot
# Single Dot Double Press
- conditions: "{{ trigger.payload == 'dots_1_double_press' }}"
sequence: !input single_dot_double_press
# Single Dot Long Press
- conditions: "{{ trigger.payload == 'dots_1_long_press' }}"
sequence: !input single_dot_long_press
# Double Dot Press
- conditions: "{{ trigger.payload == 'dots_2_short_release' }}"
sequence: !input double_dot
# Double Dot Double Press
- conditions: "{{ trigger.payload == 'dots_2_double_press' }}"
sequence: !input double_dot_double_press
# Double Dot Long Press
- conditions: "{{ trigger.payload == 'dots_2_long_press' }}"
sequence: !input double_dot_long_press
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment