Toggle, delay, toggle

Hi All,

I’m trying to make a switch toggle, then pause for a second, then toglgle again. I am not an expert in YAML, so I hope this can be fixed by simply correcting my (newby/nooby :slight_smile: ) code below.

This is what I tried in several combinations, but so far, no luck.

show_name: true
show_icon: false
type: button
tap_action:
  action: toggle
  delay: '00:00:02'
  action: toggle
entity: switch.keuken_plafondlamp
name: TEST
hold_action:
  action: none

I added the
delay: ‘00:00:02’
action: toggle
part to the standard YAML code after creating the button.

Thanks in advance!!

Please see the pinned topic on how to ask a good question for formatting your post.

I think it is number 11 in that post.

Thanks jeffcrum for informing me. I can’t find the topic you are reffering to, but I think the format is in the post now.

Here is the post
How to help us help you - or How to ask a good question - Configuration - Home Assistant Community (home-assistant.io)

Yes, it is formatted correctly.

So, a button card can’t do that. But, it might be able to call a script that does multiple actions.

Thanks!

I won’t be wasting anymore time on the yaml in the card then.
I’ve got some automations running. Maybe I can start an automation from a button in Lovelace. That would be the easiest way for me :slight_smile:

If it is going to be executed from the front end with a button, just create a script. It’s the same thing as an automation but there is no trigger. Your button would just call the script and run it.

1 Like