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.
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
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.