Google home voice command don't trigger scene event

Hi!
I’m trying to make an automation that triggers when a scene is invoked by voice command using Google Home.

trigger:
  - platform: event
    event_type: call_service
    event_data:
      domain: scene
      service: turn_on
      service_data:
        entity_id: scene.tv_power

The voice command works, the script is invoked by the voice command, but it seems that the event is not emitted, therefore the automation does not work.
Also in Settings-Automations … next to the script it does not appear that it has been called although it does what is planned.
Could it be a bug, am I doing something wrong, or is it just not working?
If I test the script in the settings (click on activation), it triggers the automation as expected.

Thanks for any help!

I tried to create a proxy script to be called by the voice command.
In that script, the scene.tv_power was activated, but the automation was still not triggered

What is the full event when you listen to it in devtools > events?

I don’t have much experience with HA, I try to study as much as possible.
In dev tools → event I triggered an event with the following data:

{domain: scene, service: turn_on, service_data: {entity_id: scene.tv_power}}

This is the response in subscribe windows for event type call_service:

event_type: call_service
data:
  domain: scene
  service: turn_on
  service_data:
    entity_id: scene.tv_power
origin: REMOTE
time_fired: "2023-10-20T20:30:34.548934+00:00"
context:
  id: 01HD7CGP1MQB60BB3Q3JE0B1CA
  parent_id: null
  user_id: 0d323d9889a14d9db1ef1ecedc0e981e

followed by

event_type: call_service
data:
  domain: scene
  service: turn_on
  service_data:
    entity_id:
      - scene.led_on
origin: LOCAL
time_fired: "2023-10-20T20:30:39.563643+00:00"
context:
  id: 01HD7CGP1SCGCMBM535HNDSNBT
  parent_id: 01HD7CGP1MQB60BB3Q3JE0B1CA
  user_id: null

Everything work as expected.

This is automation:

alias: Turn led on when TV is on
description: 
trigger:
  - platform: event
    event_type: call_service
    event_data:
      domain: scene
      service: turn_on
      service_data:
        entity_id: scene.tv_power
condition:
  - condition: sun
    after: sunset
action:
  - delay:
      hours: 0
      minutes: 0
      seconds: 5
      milliseconds: 0
  - service: scene.turn_on
    target:
      entity_id: scene.led_on
    metadata: {}

Don’t trigger the event yourself, see what is returned when you invoke it on your Google Home.
Your trigger has to match that.

Ok, sorry.
I tested again, don’t receive any event.

If you don’t receive an event when you trigger it through your Google Home, you also can’t use it as a trigger :slight_smile:

Does the state of the scene change when you trigger it through GH? In that case you can use a state trigger.

The state for the scene doesn’t change either

But it does correctly apply the scene?

Yes.
If i go to scene and click activate to scene tv_power then automation is trigger and led is on.

Solved!
I found where the problem was.
The devices I want to control are both with infrared control on a tuya IR blaster. In google home I find scenes defined on the SmartLife (Tuya) application that coincide with those that appear in HA, which confused me.
Moreover, in configure.yaml I have exposed to google home only the script and not the scenes.
Therefore, when configuring Google Home, the scene invoked was not from HA but directly from the Tuya app, therefore logically, it had no way to trigger an event in HA.
I did a test with a scene defined in HA, I exposed the scenes to google and the automation works perfectly.

Now the annoying thing is that the scenes in HA which are the same as those in Tuya, appear twice in Google Home. Once he takes them from HA and the second time from Tuya, which is crazy.
I can’t even delete HA scenes imported from Tuya, so I will most likely try to change the original firmware to OpenBkt and ditch the Tuya integration.
Anyway, for a smart socket I use Local Tuya.