Newbie Help for creating automations

Complete newbie to home assistant and automation but was looking to get some help creating an automation for a Golf Simulator

Ideally, I would want a button on my dashboard that I can press to turn on all of my devices.

As it stands I have the following devices and automations I am looking to streamline into one button

Turn TV on (Integration already added to dashboard)
Turn Projector on (Planning to do via Wake-on LAN)
Turn Computer on (Planning to do via Wake-on LAN)
Turn Launch Monitor on (Controlled via Kasa Smart Plug, integration already added to dashboard)

Have you worked through the docs?

If it’s your first automation, I’d suggest starting with a dashboard button to turn the TV on, then when it’s working you can add additional actions. Will you want to turn everything off again? If so, an input_boolean might be better than a button.

Use entities, states and services, not device ids.

I have the two automations that don’t require the wake on LAN already setup in my dashboard and I have them grouped together.

image
Was just looking for direction to get these to essentially work together with either one click or press.

Definetly will want to have an action to similarly turn everything off but wanted to start but just getting everything on

Well, I may be wrong, but it looks as if those are switches, not automations.

An automation is a little bit of code that would not appear on the dashboard. It would have…

  • a trigger - say an input_boolean changing to “on”. (This is what would go on your dashboard.)
  • conditions - optional and not needed in this case
  • actions - turn on each of the switches

You can have as many actions as you like - which is what you’re after, I think.

To set this up in the UI first you would go to Settings | Devices & Services | Helpers and create a toggle (input boolean) helper. Essentially, this is an on/off switch.

Then you would go to Settings | Automations & Scenes | Automations, then Create Automation and “Start with an empty automation”. That will give you something like this:

The trigger would be the state of your input_boolean changing to “on” (all these things are in drop-down lists - you don’t have to type them out):

To turn on the smart plug, the action would be to call the service switch.turn_on for the target entity switch.smart_plug_1 (or whatever the entity name is):

Save that and the smart plug will turn on whenever the input_boolean on your dashboard is turned on. If the other entities are also switches you can add them as targets to the same service call. If they are something else - media_player for example - you would add a second action calling the service media_player.turn_on.

To turn everything off, create a separate automation triggered by the same input_boolean turning off, with service calls switch.turn_off etc. Later on you can combine them into one automation if you want, but there’s no particular advantage to that.

1 Like