Help Writing an Automation

Hi Friends,

I’m trying to write an automation but I’ve ran out of ideas.

I have a scene called Dinner.

I wan’t that, when I activate scene.dinner it does an action, for example, Say a message on google home speaker.

But I’m stuck on how to capture the moment the scene is activated to start the action on google speaker. My last attempt was:
- id: ‘10’
alias: Spoken Dinner Message
trigger:
- entity_id: scene.dinner
platform: state
to: ‘on’
condition: []
action:
- data:
Message: Bon apetit!!
service: tts.google_say

It doesn’t throw an error but it simply doesn’t play a message or anything…

I can’t really tell what that automation does, please see the formatting guideline in the blue ribbon above each post.

Other than that, you could create an input_boolean, have your scene set it to true, then have an automation triggered by that input_boolean, do your TTS actions, then set the input_boolean false when it’s done

A scene entity’s state doesn’t change. But, like any service, an event will be fired when it’s called. You should use an event trigger that looks for the corresponding event:

- id: '10'
  alias: Spoken Dinner Message
  trigger:
    platform: event
    event_type: call_service
    event_data:
      service: turn_on
      domain: scene
      service_data:
        entity_id: scene.dinner
  action:
    service: tts.google_say
    data:
      message: Bon apetit!!