#Running an automation with the press of a button

1 messages · Page 1 of 1 (latest)

haughty tiger
#

Hi, I wonder how to make a button do a "run actions" instead of "toggle".. I try to run my chain of automation, but it just toggles on/off without anything happening.
I have to click in to the automation and hit something called "run actions", very cumbersome. Can't seem to figure this out or google gives me no help either.

mental atlas
#

You can use automation.trigger

#

Better would be to put the actions in a script

fallen veldt
# haughty tiger Hi, I wonder how to make a button do a "run actions" instead of "toggle".. I try...

Hello @haughty tiger,

Your automation would have a trigger and whatever that action is, that would start the automation.
As Rob said if you just want to run something when a button is pushed, use that button as the trigger or just write a script and call it when you press a button.
Run actions just fakes the trigger while editing in the UI and is used for testing. That's not meant for daily use.

haughty tiger
#

What kind of button are we talking about? All the ones I've tried does the toggle thing.. I dont know scripting

fallen veldt
#

https://www.home-assistant.io/integrations/script/
A script is a form of automation that does not use a trigger. It just happens when you call it.
An automation requires a trigger and there are many kinds of triggers, including looking at the state of a (physical) button among many others.

Home Assistant

Instructions on how to setup scripts within Home Assistant.

#

Run thru the docs on getting started with the automation editor. If you get stuck, come back with what you have done.
https://www.home-assistant.io/docs/automation/basics/
and
https://community.home-assistant.io/t/the-home-assistant-cookbook-index/707144#automations-10.

Home Assistant

A breakdown of what an automation consists of.

haughty tiger
#

Those docs has a lot of chapters to read through! I have a spesific thing I am trying to acheive, and I want to learn these heavy programming topics bit by bit, over time

haughty tiger
mental atlas
#

It's a service call

#

You call it on your automation

haughty tiger
#

Great!, but where do you put these service calls? There must be a textbox somewhere to put it?

mental atlas
#

As an action for your button

haughty tiger
#

Ok one step closer, thanks. Button-place

mental atlas
haughty tiger
#

Ahh, no wonder why I struggle, because I don't have that choice

#

I was looking for some setting like that, before posting. Figured it had to be a place or a way to change the behaviour of the button/toggle somehow

#

Maybe there is an "expert setting" I need to activate some place first?

mental atlas
#

That is an entities card, not a button card

#

You asked for a button

haughty tiger
#

Yes, but I assumed that these toggles could be made to presses, very much like the two ones at the bottom. They have the "activate" function, but not the automation I made.

I was however able to do what you said on a single-button. That brings me a step closer to understanding it

mental atlas
#

You should make a script as suggested above