Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save cooljimy84/f1f2da3a6b214879b82bf06a68d89264 to your computer and use it in GitHub Desktop.
Save cooljimy84/f1f2da3a6b214879b82bf06a68d89264 to your computer and use it in GitHub Desktop.
Home Assistant Blueprints: ZHA version for controlling media players with an Ikea Symfonisk GEN2
blueprint:
# Adapted for the GEN2 square remote by James Crook
# Based on https://gist.github.com/erkr/a437ebcb98a2b5ba2deebabd02f5ffae Eric Kreuwels
name: ZHA - IKEA Symfonisk sound controller GEN2 for media
description: 'Control media with an IKEA Symfonisk sound controller GEN2 (Square one)
Single press will toggle Play/Pause on your selected media player.
Single dot and double dots are not working due to errors in zigpy March 2023
WARNING (MainThread) [zigpy.zcl] [0x125C:1:0xfc7f] Unknown cluster command 1 b \x02\x01
WARNING (MainThread) [zigpy.zcl] [0x125C:1:0xfc7f] Unknown cluster command 1 b \x01\x01'
domain: automation
input:
remote:
name: Remote
description: IKEA Symfonisk controller GEN2 to use
selector:
device:
integration: zha
manufacturer: IKEA of Sweden
multiple: false
media_player:
name: Media Player
description: The media player to control
selector:
target:
entity:
domain: media_player
source_url: https://community.home-assistant.io/t/zha-ikea-symfonisk-sound-controller-gen2-the-square-one/542402
mode: single
max_exceeded: silent
trigger:
- platform: event
event_type: zha_event
event_data:
device_id: !input remote
action:
- variables:
command: '{{ trigger.event.data.command }}'
cluster_id: '{{ trigger.event.data.cluster_id }}'
endpoint_id: '{{ trigger.event.data.endpoint_id }}'
args: '{{ trigger.event.data.args }}'
- choose:
- conditions:
- '{{ command == ''toggle'' }}'
- '{{ cluster_id == 6 }}'
- '{{ endpoint_id == 1 }}'
sequence:
- service: media_player.media_play_pause
target: !input media_player
- conditions:
- '{{ command == ''move_with_on_off'' }}'
- '{{ cluster_id == 8 }}'
- '{{ endpoint_id == 1 }}'
- '{{ trigger.event.data.params.move_mode == 0}}'
sequence:
- service: media_player.volume_up
target: !input media_player
- delay: 1
- conditions:
- '{{ command == ''move_with_on_off'' }}'
- '{{ cluster_id == 8 }}'
- '{{ endpoint_id == 1 }}'
- '{{ trigger.event.data.params.move_mode == 1 }}'
sequence:
- service: media_player.volume_down
target: !input media_player
- delay: 1
- conditions:
- '{{ command == ''step'' }}'
- '{{ cluster_id == 8 }}'
- '{{ endpoint_id == 1 }}'
- '{{ trigger.event.data.params.step_mode == 0 }}'
sequence:
- service: media_player.media_next_track
target: !input media_player
- conditions:
- '{{ command == ''step'' }}'
- '{{ cluster_id == 8 }}'
- '{{ endpoint_id == 1 }}'
- '{{ trigger.event.data.params.step_mode == 1 }}'
sequence:
- service: media_player.media_previous_track
target: !input media_player
@cooljimy84
Copy link
Author

Changed options to work with GEN2 remote.

@cooljimy84
Copy link
Author

forgot to uncomment comments and added next and previous buttons

@garrit-schroeder
Copy link

The buttons to next / previous track does not work for me.
(I have not updated firmare of music control device.)

@cooljimy84
Copy link
Author

I've updated the blueprint to remove the single and double dots option all together. I had someone on the HASS forums say they had issues as well.

@garrit-schroeder
Copy link

garrit-schroeder commented Mar 17, 2023

Thank you for your reply. Could you clarify for me why you introduced a delay of 1 for the volume sequences? With my fork I removed the delay and it is working way smoother.

@garrit-schroeder
Copy link

Using the updated version of this blueprint, the next / previous buttons work.

@cooljimy84
Copy link
Author

My daughter likes to press buttons really really quickly, i thought that limiting the up/down would slow down the process of ramping up and down with her button mashing.
I think I've changed it to milliseconds: 200 on volume down so she can quickly turn it down if its loud.

@garrit-schroeder
Copy link

Thanks for the clarification. Do you have any idea on when the update for zha with the additional buttons will be available?

@cooljimy84
Copy link
Author

The pull request was submitted 3 days ago. Not sure how often they merge & update tho.

zigpy/zha-device-handlers#2273

@flowcool
Copy link

Hello,

I cannot use your blueprint as we don't have some manufacturer & Device:

"manufacturer": "IKEA",
"model": "SYMFONISK sound remote gen2 (E2123)",
"sw_version": "1.0.012"

Do you believe it is feasible to adapt a bit the blue print ?

@cooljimy84
Copy link
Author

It might be, tho i suspect bits might change as they merge the changes for the extra buttons.
I've changed it to not require "SYMFONISK sound remote gen2" as the model (tho this might cause issues with people selecting gen1 round knob devices)

Hopefully that should help you.

@flowcool
Copy link

ahhh super cool ! I'll test this straight away :) Many thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment