Any suggestion for a double click switch

@123 Thanks
Good to see how I can see an event and I tried this:

alias: Slaapkamer dubbelklik is wit
description: ""
trigger:
  - platform: device
    device_id: 871d35e5f69331803efcd124291a3ae2
    domain: rfxtrx
    type: command
    subtype: "On"
condition: []
action:
  - delay:
      hours: 0
      minutes: 0
      seconds: 0
      milliseconds: 100
  - wait_for_trigger:
      - platform: event
        event_type: rfxtrx_event
        event_data:
          packet_type: 17
          sub_type: 0
          id_string: 0056fc3:10
          values:
            command: "On"
    timeout:
      hours: 0
      minutes: 0
      seconds: 10
      milliseconds: 0
    continue_on_timeout: false
  - service: light.turn_on
    data:
      brightness: 255
    target:
      entity_id:
        - light.milight_slaap_bovenspiegel
        - light.milight_slaap_onderspiegel
  - stop: ""
mode: single

but still I get the same error|

Triggered by the event ‘rfxtrx_event’ at 6 maart 2023 om 16:39:05
Stopped because only a single execution is allowed at 6 maart 2023 om 16:39:05 (runtime: 0.00 seconds)

Your still using device platform

1 Like

@Hellis81 you are right but I also tried this:

alias: Slaapkamer dubbelklik is wit
description: ""
trigger:
  - platform: event
    event_type: rfxtrx_event
    event_data:
      packet_type: 17
      sub_type: 0
      type_string: AC
      id_string: 0056fc3:10
      values:
        command: "On"
condition: []
action:
  - delay:
      hours: 0
      minutes: 0
      seconds: 0
      milliseconds: 100
  - wait_for_trigger:
      - platform: event
        event_type: rfxtrx_event
        event_data:
          packet_type: 17
          sub_type: 0
          type_string: AC
          id_string: 0056fc3:10
          values:
            command: "On"
    timeout:
      hours: 0
      minutes: 0
      seconds: 10
      milliseconds: 0
    continue_on_timeout: false
  - service: light.turn_on
    data:
      brightness: 255
    target:
      entity_id:
        - light.milight_slaap_bovenspiegel
        - light.milight_slaap_onderspiegel
  - stop: gewone stop
mode: single

I still get the same result after I klick the 2nd time

Are you sure you are looking at the correct trace?
There should be two traces almost at the same time, one should have this message the other, the one before it is the one you should look at

1 Like

Ahhh now I see what you mean with the two traces
Never realized there was the other one.
I will investigate further but cannot do anymore today.
We have to leave till late
Thanks sofar!!!

This might a bit hacky. But works with my philips hue remote. Had to make it 1 second due to both Zigbee and the remote delay :smiley:
I had the same issue in a KNX installation and could only work with a logic module.
Its very basic in that the first click sets a helper to 1 and if nothing is pressed the delay will set the helper to 0. When you do press again the automation is restarted and first checks if the helper is set to on, when its on it will do the action and reset the helper to 0

Its low tech but works :smiley:

alias: DoubleClick Test
description: ""
trigger:
  - platform: device
    domain: mqtt
    device_id: a26f03d706ce19099bdcbffc3f5c1116
    type: action
    subtype: on-press
    discovery_id: 0x001788010965da9e action_on-press
condition: []
action:
  - choose:
      - conditions:
          - condition: state
            entity_id: input_boolean.doubleclick
            state: "on"
        sequence:
          - type: toggle
            device_id: 9b6af62963d4d029f3db6d8df5f2c6ca
            entity_id: switch.wcd_kerst_woonkamer
            domain: switch
          - service: input_boolean.turn_off
            data: {}
            target:
              entity_id: input_boolean.doubleclick
      - conditions:
          - condition: state
            entity_id: input_boolean.doubleclick
            state: "off"
        sequence:
          - service: input_boolean.turn_on
            data: {}
            target:
              entity_id: input_boolean.doubleclick
          - delay:
              hours: 0
              minutes: 0
              seconds: 1
              milliseconds: 0
          - service: input_boolean.turn_off
            data: {}
            target:
              entity_id: input_boolean.doubleclick
mode: restart
1 Like

Hi @123 en @Hellis81
I have been trying thing today and I get it somehow working but:
great help also @123

alias: Slaapkamer dubbelklik is wit
description: ""
trigger:
  - platform: event
    event_type: rfxtrx_event
    event_data:
      packet_type: 17
      sub_type: 0
      type_string: AC
      id_string: "0218577:1"
      values:
        command: "On"
condition: []
action:
  - device_id: 871d35e5f69331803efcd124291a3ae2
    domain: rfxtrx
    type: send_command
    subtype: "On"
  - delay:
      hours: 0
      minutes: 0
      seconds: 2
      milliseconds: 0
  - service: script.slaapkamer_licht_sfeer
    data: {}
  - wait_for_trigger:
      - platform: event
        event_type: rfxtrx_event
        event_data:
          packet_type: 17
          sub_type: 0
          type_string: AC
          id_string: "0218577:1"
          values:
            command: "On"
    timeout:
      hours: 0
      minutes: 0
      seconds: 5
      milliseconds: 0
    continue_on_timeout: false
  - service: light.turn_on
    data:
      brightness: 255
      color_temp: 153
    target:
      entity_id:
        - light.milight_slaap_bovenspiegel
        - light.milight_slaap_onderspiegel
        - light.milight_slaap_bed_hoofdeind
        - light.milight_slaap_plafond
  - stop: gewone stop
mode: single

The trace also shows what I expect.
I discovered I also had to decouple the Button from the light switch socket and that need so switch the wallplug socker ON and OFF by the automation
I need to do some more testing and optimizing but I think I am getting close

Thanks all sofar for all the help:)

@123
I think it uses pretty much what you suggested.
I tried something from remote (via the app when I was at work) but at that time I had no acces to the forum :woozy_face:
I have replaced the delay by switching on the light in friendly mode So that this is the default if not double clicked.
I think I only missed your

max_exceeded: silent

I added that but what does this line of code do?

But now I need to switch off the lights also from an automation niw HA
And that gives an other problem, a conflict if the double click automation is still running while I press the off button.

I triend something like tis in my light switch off automation:

action:
  - service: automation.turn_off
    data:
      stop_actions: true
    target:
      entity_id: automation.slaapkamer_dubbelklik_is_wit

But that does turn off the whole automation, but I also found I can turn it on again which seems to solve this problem.
I will do some more testing

I am still reading learning and sharing my thoughts/findings