Push button help please

I’ve been searching through posts without finding what I’m looking for, Sorry
I would like to use the Button card to switch an entity on for about 3 seconds, then off.
( its a solenoid controlled water spray to deter a troublesome cat , its bullying my two cats )I’m not sure what the “default action” is on the Button Card
the nearest config example moved to gihub and became very vague.
All I’m looking for is
on Button pressed call switch on service for the entity
wait 3seconds
call switch off service for the entity

Write a script and call that from the button.

Script location ? automations.yaml

Use the UI. It’s good these days.

Will end up looking like this, but with your switch (sorry, misremembered your handle):

Thanks , script in OK and it runs, but clicking on the button linked to the script just brings up another box and I have to click on “run”

OOPs my fault , I select default action and not toggle, toggle works

1 Like

Hi Richard please take the time to mark the answer as solution, you do that by selecting the three dots under the post:


Then select the check box:


By doing so this can be useful to other users as well and prevents that someone else steps in and still tries to help you.

1 Like

Richard, thanks for responding to my post!
You have mistakenly marked my question as the solution while credit goes to @Troon