Release after long press also triggers release after short press event

I have custom Friends of Hue button device, which has four buttons. Each button has four possible options:

  1. Pressed immediately
  2. Held down
  3. Released after short press
  4. Released after long press

I have set button 1 to Play/Pause my Sonos device, when trigger is ‘3. Released after short press’.
I have also set button 1 to increase volume on my Sonos device, when trigger is ‘2. Held down’.

Both work, but the issue is, that when I release the button after ‘2. Held down’, this triggers the ‘Released after short press’ event, and pauses playback. As I am holding down the button for more than 2 seconds, I would expect it to trigger ‘4. Released after long press’, which does not trigger anything.

What am I missing / doing wrong?

Thanks :slight_smile:

alias: Sonos Stuen Volume
description: ""
trigger:
  - device_id: c736d74adc0f5ff327e28eafc8d123e3
    domain: hue
    platform: device
    type: repeat
    subtype: 1
    unique_id: a7cd87ba-1dd3-4a70-a556-f2f0902672a9
    id: Stuen Sonos Vol op
  - device_id: c736d74adc0f5ff327e28eafc8d123e3
    domain: hue
    platform: device
    type: repeat
    subtype: 2
    unique_id: bf5d9d3b-600f-4428-82ac-f150f6d1f6f9
    id: Stuen Sonos Vol ned
  - device_id: c736d74adc0f5ff327e28eafc8d123e3
    domain: hue
    platform: device
    type: long_release
    subtype: 1
    unique_id: a7cd87ba-1dd3-4a70-a556-f2f0902672a9
    id: Stuen Sonos Vol op release
  - device_id: c736d74adc0f5ff327e28eafc8d123e3
    domain: hue
    platform: device
    type: long_release
    subtype: 2
    unique_id: bf5d9d3b-600f-4428-82ac-f150f6d1f6f9
    id: Stuen Sonos Vol ned release
  - device_id: c736d74adc0f5ff327e28eafc8d123e3
    domain: hue
    platform: device
    type: short_release
    subtype: 1
    unique_id: a7cd87ba-1dd3-4a70-a556-f2f0902672a9
    id: Stuen Sonos Play/Pause
condition: []
action:
  - choose:
      - conditions:
          - condition: trigger
            id: Stuen Sonos Vol op
        sequence:
          - repeat:
              while:
                - condition: trigger
                  id: Stuen Sonos Vol op
              sequence:
                - service: media_player.volume_up
                  data: {}
                  target:
                    entity_id: media_player.stue
                - delay:
                    hours: 0
                    minutes: 0
                    seconds: 0
                    milliseconds: 200
      - conditions:
          - condition: trigger
            id: Stuen Sonos Vol ned
        sequence:
          - repeat:
              while:
                - condition: trigger
                  id: Stuen Sonos Vol ned
              sequence:
                - service: media_player.volume_down
                  data: {}
                  target:
                    entity_id: media_player.stue
                - delay:
                    hours: 0
                    minutes: 0
                    seconds: 0
                    milliseconds: 200
      - conditions:
          - condition: trigger
            id: Stuen Sonos Play/Pause
        sequence:
          - service: media_player.media_play_pause
            data: {}
            target:
              entity_id: media_player.stue
mode: restart

1 Like

Hi - I’m having exactly the same problem. Did you find a solution for this?

Sorry for the very late reply.
Yes, I found a solution. You need to add a ‘Wait for’ event to you automation.
I hope this image is enough help.

Wait trigger

Thank you @storebatfar, your solution is working well for my setup with the hue smart button.

could you please explain me more on how you set this up? i have the same switch for 4 scenes but i would like to add longpress (3 sec) to make the blinds go down without activating one of the 4 scenes.

1 Like

Hej

I have the same (danish) problem. @storebatfar can you please show us your code or what you did?