Any suggestion for a double click switch

Hi I have a KaKu switch and switch buttons in use.
I use that button to swict on my bedroomligts in friendly light mode.
now I try to create an automation where I can push that buton twice within some timeout to set the light bright.
So I created a trigger on the button for on.
Then 100ms delay
and then I wait for on again from unknown switchstate for 10 seconds

then in the trace I get:
Automation "stopped because only a single execution
pressing on , off, on

And I get the same error
When doing only on and off the automation wil continue without error, so it seems the 2nd wait for on is the guilty part. ??
is there any solution to this??

.

Share your attempted automation config.

Hi I tried this one:

alias: Slaapkamer dubbelklik is wit
description: ""
trigger:
  - platform: device
    device_id: 5ab7588692eda8af22cdba3ed5ace7f9
    domain: rfxtrx
    type: command
    subtype: "On"
condition: []
action:
  - wait_for_trigger:
      - platform: device
        device_id: 5ab7588692eda8af22cdba3ed5ace7f9
        domain: rfxtrx
        type: command
        subtype: "On"
    timeout:
      hours: 0
      minutes: 1
      seconds: 10
      milliseconds: 0
    enabled: true
  - service: light.turn_on
    data:
      brightness: 255
    target:
      entity_id:
        - light.milight_slaap_bovenspiegel
        - light.milight_slaap_onderspiegel
  - stop: ""
mode: single

And also tried this:

alias: Slaapkamer dubbelklik is wit
description: ""
trigger:
  - platform: device
    device_id: 5ab7588692eda8af22cdba3ed5ace7f9
    domain: rfxtrx
    type: command
    subtype: "On"
condition: []
action:
  - wait_for_trigger:
      - platform: device
        device_id: 5ab7588692eda8af22cdba3ed5ace7f9
        domain: rfxtrx
        type: command
        subtype: "Off"
      - platform: device
        device_id: 5ab7588692eda8af22cdba3ed5ace7f9
        domain: rfxtrx
        type: command
        subtype: "On"
    timeout:
      hours: 0
      minutes: 1
      seconds: 10
      milliseconds: 0
    enabled: true
  - service: light.turn_on
    data:
      brightness: 255
    target:
      entity_id:
        - light.milight_slaap_bovenspiegel
        - light.milight_slaap_onderspiegel
  - stop: ""
mode: single

This seems like a bug to me.

Even though you are waiting for the same trigger that triggers the automation, you are running the automation in single mode so re-triggering should be ignored while the automation is running. Instead the automation is being stopped.

You can report it as a new issue here:

But would running the automotin work in e restart mode work? I think that would just start it al over again?

Yep that won’t help.

@tom_l Reporting the issue was useless the topic is closed right after I posted is and I am sent back to the forum. A bit disappointing :frowning: I wrote to t @mib1185 That to my opinion this is a serious issue. But I doubt if they reopen it?
So my initial question stands. Any clue how to get sucht an automation running?

Can you post the closed issue link?

I now get a reply that i should create a feature request

Your issue was poorly explained. I have added a comment. Lets see what happens.

One more thing to try. Remove the stop action at the end of the actions. It does nothing as it is the end of the actions anyway. Also add continue_on_timeout: false.

alias: Slaapkamer dubbelklik is wit
description: ""
trigger:
  - platform: device
    device_id: 5ab7588692eda8af22cdba3ed5ace7f9
    domain: rfxtrx
    type: command
    subtype: "On"
condition: []
action:
  - wait_for_trigger:
      - platform: device
        device_id: 5ab7588692eda8af22cdba3ed5ace7f9
        domain: rfxtrx
        type: command
        subtype: "On"
    timeout:
      hours: 0
      minutes: 1
      seconds: 10
      milliseconds: 0
    enabled: true
    continue_on_timeout: false
  - service: light.turn_on
    data:
      brightness: 255
    target:
      entity_id:
        - light.milight_slaap_bovenspiegel
        - light.milight_slaap_onderspiegel
mode: single

Could it be because it’s device?
What happens if you use event or whatever other possible solutions to trigger this

Thanks:)
I am just a user not a SW develloper and not used to describe such a bug briefly
Your description is clear:)

Certainly worth a try.

1 Like

I have no clue what else could do the doubleclick.
There must be a timeout to finish the “ait for the 2nd click”
Because a single click should just switch the ligt on without any further action.

I also tried this

alias: Slaapkamer dubbelklik is wit
description: ""
trigger:
  - platform: device
    device_id: 871d35e5f69331803efcd124291a3ae2
    domain: rfxtrx
    type: command
    subtype: "On"
condition: []
action:
  - condition: state
    entity_id: switch.ac_0056fc3_10
    state: "on"
    for:
      hours: 0
      minutes: 1
      seconds: 0
  - service: light.turn_on
    data:
      brightness: 255
    target:
      entity_id:
        - light.milight_slaap_bovenspiegel
        - light.milight_slaap_onderspiegel
  - stop: ""
mode: single

but this resulted in:
Triggered by the event ‘rfxtrx_event’ at 6 maart 2023 om 15:18:21
Confirm Slaapkamer Bed is on for 1:00
Aborted at 6 maart 2023 om 15:18:21 (runtime: 0.01 seconds)

I think because the switch action that is seen is an event and not a state

Your logic is correct.
The issue I believe is the device platform.
It has issues and could be the reason.

Do you have a binary sensor for this switch? Or the switch itself as a entity?
Or is there an event? I don’t know what the device is so I’m just guessing here.
I posted pretty much the same automation as a solution yesterday, so the concept works.

@Hellis81 The purpose of your code is a bit different you want probably only to switch the bedligh on and not the rest.
I tried something similar

alias: Slaapkamer dubbelklik is wit
description: ""
trigger:
  - platform: device
    device_id: 871d35e5f69331803efcd124291a3ae2
    domain: rfxtrx
    type: command
    subtype: "On"
condition: []
action:
  - wait_for_trigger:
      - platform: device
        device_id: 871d35e5f69331803efcd124291a3ae2
        domain: rfxtrx
        type: command
        subtype: "Off"
    timeout:
      hours: 0
      minutes: 0
      seconds: 5
      milliseconds: 0
    continue_on_timeout: false
  - wait_for_trigger:
      - platform: device
        device_id: 871d35e5f69331803efcd124291a3ae2
        domain: rfxtrx
        type: command
        subtype: "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 again I get this message:

Triggered by the event 'rfxtrx_event' at 6 maart 2023 om 15:25:59
Stopped because only a single execution is allowed at 6 maart 2023 om 15:25:59 (runtime: 0.00 seconds)

Can you please try with something else than the device platform?
I really believe that is the cause of your issue.

So again:

@Hellis81 The device is a 'Klikaan-Klikuit" Switch that is used via RFXcom in HA.
I have no cue how to use anything else:S

You can just open up the device in devices and integrations and have a look at what it exposes.
I have never heard of Klikaan-Klikuit or RFXcom so I don’t know what it exposes