Rotary dimmer as volume control SOLVED

Not sure if the quetsion is pointed at me. I am not using Deconz but zigbee2mqtt so sorry, cannot help you with Deconz

I found the solution here:


So now itā€™s all very nice! And more rotary dimmers/volume controls are on their way.

In case itā€™s useful to anyone, I adapted Xydixā€™s nifty code to work with Zigbee2mqtt rather than deCONZ.

Hereā€™s the automation part - no change to the scripts. I added an extra boolean flag (ā€˜updownā€™) to indicate whether the volume was increasing or decreasing because the ā€˜rotate_stopā€™ payload will be triggered in both cases. Hacky and doubtless not the proper way to do it (my programming skills are minimal), but it works. Thanks again Xydix for the original code. Replace ā€˜zigbee2mqtt/Symfonisk IKEA volumeā€™ with whatever the name of your Symfonisk remote is in MQTT.

  - alias: symfonisk raise volume on
    initial_state: 'on'
    trigger:
    - platform: mqtt
      topic: 'zigbee2mqtt/Symfonisk IKEA volume'
    condition:
    - condition: template
      value_template: "{{ 'rotate_right' in trigger.payload }}"

    action:
      - service: input_boolean.turn_off
        entity_id: input_boolean.symfonisk_volume
      - service: script.turn_on
        entity_id: script.symfonisk_raise_volume
      - service: input_boolean.turn_off
        entity_id: input_boolean.symfonisk_updown
          
  - alias: symfonisk raise volume off
    initial_state: 'on'
    trigger:
    - platform: mqtt
      topic: 'zigbee2mqtt/Symfonisk IKEA volume'
    condition:
    - condition: template
      value_template: "{{ 'rotate_stop' in trigger.payload }}"
    - condition: state
      entity_id: input_boolean.symfonisk_updown
      state: 'off'
      
    action:
      - service: input_boolean.turn_on
        entity_id: input_boolean.symfonisk_volume
          
  - alias: symfonisk lower volume on
    initial_state: 'on'
    trigger:
    - platform: mqtt
      topic: 'zigbee2mqtt/Symfonisk IKEA volume'
    condition:
    - condition: template
      value_template: "{{ 'rotate_left' in trigger.payload }}"

    action:
      - service: input_boolean.turn_on
        entity_id: input_boolean.symfonisk_volume
      - service: script.turn_on
        entity_id: script.symfonisk_lower_volume
      - service: input_boolean.turn_on
        entity_id: input_boolean.symfonisk_updown        

  - alias: symfonisk lower volume off
    initial_state: 'on'
    trigger:
    - platform: mqtt
      topic: 'zigbee2mqtt/Symfonisk IKEA volume'
    condition:
    - condition: template
      value_template: "{{ 'rotate_stop' in trigger.payload }}"
    - condition: state
      entity_id: input_boolean.symfonisk_updown
      state: 'on'  

    action:
      - service: input_boolean.turn_off
        entity_id: input_boolean.symfonisk_volume
4 Likes

Hello robban,
Would it be possible, that you share a short Tutorial of your solution.
I would like to have the Same setup as you.
Thanks in advance.
Best regards,
Dominik

Here is my AppDaemon application https://github.com/Kane610/appdaemon-apps/blob/a08097a717c4b219850978931f9231b1fb4edd7b/symfonisk_controller.py

1 Like

Thank you for your quick reply, i will test it, when my controller arrive!

hi @Robban how are you?
how can I use this AppDaemon script?
any guide/help?
Thanks!

Set up appdaemon copy the app into the app folder configure an app i Arion wit on these parameters

[remote_id] -- [remote id]
[media_player_entity_id] -- [media player entity id]

Ummm typo?

hi @Pabs how are you?
I use your code, but with a single touch in volume button, the volume goes all up or all down.
Any advice?
Thanks!

Hi @pitoganzado - the code I posted was just the automation part, so did you define the necessary extra boolean in your configuration.yaml?

Something like (please excuse the formatting, donā€™t forget the necessary indentations):

input_boolean:
symfonisk_updown:
name: Symfonisk up or down
initial: off

@Pabs thanks, missing exactly that! Now works amazing!

I add Play/Pause, skip forward and skip backward to the code.
Maybe this can help someone, this is my entire package ( symfonisk.yaml ).
Just change the ā€œmedia_player.cozinha_2ā€ and the topic ā€˜zigbee2mqtt/Sonos Controladorā€™ to yours devices.

input_boolean:
  symfonisk_volume:
    name: Symfonisk Volume
    initial: off
  symfonisk_dummy_delay:
  symfonisk_updown:
    name: Symfonisk up or down
    initial: off

script:
  symfonisk_lower_volume:
    sequence:
      - condition: state
        entity_id: input_boolean.symfonisk_volume
        state: 'on'
    
      - service: input_boolean.turn_on
        entity_id: input_boolean.symfonisk_dummy_delay

      - service: input_boolean.turn_off
        entity_id: input_boolean.symfonisk_dummy_delay

      - service: media_player.volume_set
        entity_id: media_player.cozinha_2
        data_template:
          volume_level: '{{ states.media_player.cozinha_2.attributes.volume_level - 0.01 }}'

      - service: script.turn_off
        entity_id: script.symfonisk_lower_volume

      - service: script.turn_on
        entity_id: script.symfonisk_lower_volume

  symfonisk_raise_volume:
    sequence:

      - condition: state
        entity_id: input_boolean.symfonisk_volume
        state: 'off'

      - service: input_boolean.turn_on
        entity_id: input_boolean.symfonisk_dummy_delay

      - service: input_boolean.turn_off
        entity_id: input_boolean.symfonisk_dummy_delay

      - service: media_player.volume_set
        entity_id: media_player.cozinha_2
        data_template:
          volume_level: '{{ states.media_player.cozinha_2.attributes.volume_level + 0.01 }}'
  
      - service: script.turn_off
        entity_id: script.symfonisk_raise_volume

      - service: script.turn_on
        entity_id: script.symfonisk_raise_volume

automation:
  - alias: symfonisk skip forward
    initial_state: 'on'
    trigger:
    - platform: mqtt
      topic: 'zigbee2mqtt/Sonos Controlador'
    condition:
    - condition: template
      value_template: "{{ 'skip_forward' in trigger.payload }}"    
    action:
      - service: media_player.media_next_track
        entity_id: media_player.cozinha_2

  - alias: symfonisk skip backward
    initial_state: 'on'
    trigger:
    - platform: mqtt
      topic: 'zigbee2mqtt/Sonos Controlador'
    condition:
    - condition: template
      value_template: "{{ 'skip_backward' in trigger.payload }}"    
    action:
      - service: media_player.media_previous_track
        entity_id: media_player.cozinha_2

  - alias: symfonisk play/pause
    initial_state: 'on'
    trigger:
    - platform: mqtt
      topic: 'zigbee2mqtt/Sonos Controlador'
    condition:
    - condition: template
      value_template: "{{ 'play_pause' in trigger.payload }}"    
    action:
      - service: media_player.media_play_pause
        entity_id: media_player.cozinha_2

  - alias: symfonisk raise volume on
    initial_state: 'on'
    trigger:
    - platform: mqtt
      topic: 'zigbee2mqtt/Sonos Controlador'
    condition:
    - condition: template
      value_template: "{{ 'rotate_right' in trigger.payload }}"

    action:
      - service: input_boolean.turn_off
        entity_id: input_boolean.symfonisk_volume
      - service: script.turn_on
        entity_id: script.symfonisk_raise_volume
      - service: input_boolean.turn_off
        entity_id: input_boolean.symfonisk_updown
          
  - alias: symfonisk raise volume off
    initial_state: 'on'
    trigger:
    - platform: mqtt
      topic: 'zigbee2mqtt/Sonos Controlador'
    condition:
    - condition: template
      value_template: "{{ 'rotate_stop' in trigger.payload }}"
    - condition: state
      entity_id: input_boolean.symfonisk_updown
      state: 'off'
      
    action:
      - service: input_boolean.turn_on
        entity_id: input_boolean.symfonisk_volume
          
  - alias: symfonisk lower volume on
    initial_state: 'on'
    trigger:
    - platform: mqtt
      topic: 'zigbee2mqtt/Sonos Controlador'
    condition:
    - condition: template
      value_template: "{{ 'rotate_left' in trigger.payload }}"

    action:
      - service: input_boolean.turn_on
        entity_id: input_boolean.symfonisk_volume
      - service: script.turn_on
        entity_id: script.symfonisk_lower_volume
      - service: input_boolean.turn_on
        entity_id: input_boolean.symfonisk_updown        

  - alias: symfonisk lower volume off
    initial_state: 'on'
    trigger:
    - platform: mqtt
      topic: 'zigbee2mqtt/Sonos Controlador'
    condition:
    - condition: template
      value_template: "{{ 'rotate_stop' in trigger.payload }}"
    - condition: state
      entity_id: input_boolean.symfonisk_updown
      state: 'on'  

    action:
      - service: input_boolean.turn_off
        entity_id: input_boolean.symfonisk_volume
2 Likes

Thank you for your appdaemon code. Works like a charm!

How to configure apps.yaml and remote and symfonsik ID?
I get the following failure

2020-01-28 06:24:44.930091 INFO AppDaemon: Terminating Symfonisk_Controller
2020-01-28 06:24:44.937578 INFO AppDaemon: Reloading Module: /config/appdaemon/apps/symfonisk_controller.py
2020-01-28 06:24:44.951831 INFO AppDaemon: Initializing app Symfonisk_Controller using class SymfoniskController from module symfonisk_controller
2020-01-28 06:24:44.960769 INFO Symfonisk_Controller: {'module': 'symfonisk_controller', 'class': 'SymfoniskController'}
2020-01-28 06:24:44.965225 WARNING Symfonisk_Controller: ------------------------------------------------------------
2020-01-28 06:24:44.967035 WARNING Symfonisk_Controller: Unexpected error running initialize() for Symfonisk_Controller
2020-01-28 06:24:44.968514 WARNING Symfonisk_Controller: ------------------------------------------------------------
2020-01-28 06:24:44.971692 WARNING Symfonisk_Controller: Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/appdaemon/app_management.py", line 145, in initialize_app
    await utils.run_in_executor(self, init)
  File "/usr/lib/python3.8/site-packages/appdaemon/utils.py", line 276, in run_in_executor
    response = future.result()
  File "/usr/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/appdaemon/apps/symfonisk_controller.py", line 26, in initialize
    self.remote = self.args["symfonisk_sound_controller_1"]
KeyError: 'symfonisk_sound_controller_1'
2020-01-28 06:24:44.973586 WARNING Symfonisk_Controller: ------------------------------------------------------------

Hope you can support me, thanks in advance

1 Like

Hi,

Just followed your example and made the necessary changes. I am able to successfully use the symfonisk volume controller to skip fwd (double tap), skip back (triple tap) and play/pause (single tap).

However, turning clockwise or counter clockwise does not affect volume. I donā€™t see any errors in the logs, the automatons and scripts are called accordingly when i turn or click the remote.

I am new to SYMFONISK, and thinking about getting it. Which route do you guys suggest going Zigbee2mqtt or Deconz route? Which is easier to set up and works smoother?

Can you share your devices.yaml configuration for the remote? Iā€™m using 0.01 but still having problems.

ok, got it resolvedā€¦ had a mistake in the script section.

Works fine now. Thanks for the help

Iā€™ve just copied&pasted this into my configuration and did the search&replace as noted in the comment from @pitoganzado. Volume control works perfectly for me! Thank you very much! :slight_smile:

Hi,

got the symfonisk volume working ok, using conbee/zha/node-red, but when I tap the button once, I get three zha events in rapid succession (sub second). Iā€™m stumped, does anyone have any suggestions how I investigate further?
Thanks.