Action to run script

Hello,

again something simple I think, but I can’t find answer by searching.

I have a script calling a notifier service that is writing an email.

If I just do in an automation:

  action:
  - service: script.email_hello

the script won’t run. What is the right expression here?

Thank you,
Bernd

What you have is one of two options (yours is correct BTW, unless the script requires parameters to be passed to it?)

  action:
  - service: script.email_hello

or

  action:
  - service: script.turn_on
    entity_id: script.email_hello

The difference between them is explained here: https://www.home-assistant.io/integrations/script/#waiting-for-script-to-complete

2 Likes

That’s correct. Make sure to check your logs for errors.

Thank you both for the quick answer!
I guess I have just reloaded the script but not the automation and so nothing happend, when I launched the automation from the settings page.

Also the link to the docs is usefull - thank you!

1 Like