0

I am developing a speech recognition for a custom device using Google Assistant SDK. I am using Action SDK to create custom actions.

In my example the Google Assistant doesn't recognize actions in german language in case these actions are marked with "locale": "de" and the assistants language is set to german. I recognized that query patterns are understood clearly, but the event is not triggered. If everything is set to english the events are triggered.

action.json

{
    "locale": "de",
    "manifest": {
        "displayName": "Blink Licht",
        "invocationName": "Blink Licht",
        "category": "PRODUCTIVITY"
    },
    "actions": [
        {
            "name": "com.acme.actions.blink_light",
            "availability": {
                "deviceClasses": [
                    {
                        "assistantSdkDevice": {}
                    }
                ]
            },
            "intent": {
                "name": "com.acme.intents.blink_light",
                "parameters": [
                    {
                        "name": "number",
                        "type": "SchemaOrg_Number"
                    },
                    {
                        "name": "light_target",
                        "type": "LightType"
                    }
                ],
                "trigger": {
                    "queryPatterns": [
                        "lasse das $LightType:light_target $SchemaOrg_Number:number mal blinken"
                    ]
                }
            },
            "fulfillment": {
                "staticFulfillment": {
                    "templatedResponse": {
                        "items": [
                            {
                                "simpleResponse": {
                                    "textToSpeech": "Das Licht $light_target.raw blinkt $number mal"
                                }
                            },
                            {
                                "deviceExecution": {
                                    "command": "com.acme.commands.blink_light",
                                    "params": {
                                        "lightKey": "$light_target",
                                        "number": "$number"
                                    }
                                }
                            }
                        ]
                    }
                }
            }
        }
    ],
    "types": [
        {
            "name": "$LightType",
            "entities": [
                {
                    "key": "LIGHT",
                    "synonyms": [
                        "Licht",
                        "LED",
                        "Glühbirne"]
                }
            ]
        }
    ]
}

hotword.py - snipped of event processing

def process_event(event, device_id):
    """Pretty prints events.

    Prints all events that occur with two spaces between each new
    conversation and a single space between turns of a conversation.

    Args:
        event(event.Event): The current event to process.
        device_id(str): The device ID of the new instance.
    """
    if event.type == EventType.ON_CONVERSATION_TURN_STARTED:
        print()

    print(event)

    if (event.type == EventType.ON_CONVERSATION_TURN_FINISHED and
            event.args and not event.args['with_follow_on_turn']):
        print()
    if event.type == EventType.ON_DEVICE_ACTION:
        for command, params in process_device_actions(event, device_id):
            print('Do command', command, 'with params', str(params))  # 
            if command == "com.acme.commands.blink_light":
                number = int(params['number'])
                for i in range(int(number)):
                    print('Device is blinking.')

Project language in action console is German: enter image description here

To update and make the action available for testing I used "gaction CLI".

The question: Why is the event/command "com.acme.commands.blink_light" in hotword.py not triggered in case using german language?

Thanks in anticipation!

Luk
  • 1
  • 2
  • When you mark your Assistant as German, is that through the Google Assistant settings on your phone? When you don't have `locale: "de"` in your action package do the commands trigger when you speak to it in German? – Nick Felker Mar 19 '18 at 17:44
  • 1. Yes, I mark the Assistant as German through the Google Assistant settings on my phone. – Luk Mar 20 '18 at 09:57
  • 2. If I remove `locale: "de"` in the action package, I am not able to test. After `./gactions test ...` the following error appears: `Pushing the app for the Assistant for testing... ERROR: Failed to test the app for the Assistant ERROR: Request contains an invalid argument. Field Violations: # Field Description 1 Could not find draft details for 'de' locale` – Luk Mar 20 '18 at 10:05
  • Is your project language in the Actions console German? – Nick Felker Mar 20 '18 at 16:57
  • Yes, it is (see edit) – Luk Mar 21 '18 at 08:40
  • Can you set the language in the console to US English, keep the locale field out of your action package, and try deploying it again? – Nick Felker Mar 21 '18 at 17:52

1 Answers1

0

Here's how I solved this problem: 1. Go to your action on google console and pick the project you're having this trouble with. 2. In the 'Overview' section you'll see a window with the languages of your action on top, and at their right a 'Modify languages' in blue. Click it and then delete the langauge you're not using, english in this case.

At least that worked for me.

Giorgio Maritano
  • 341
  • 1
  • 3
  • 12