问题
I implemeneted my device by extending the Assistant as documented in instructions
I can see my device registered with the traits:
googlesamples-assistant-devicetool list --model
Device Model Id: assistant-19etc....
Project Id: assistant-19etc....
Device Type: action.devices.types.LIGHT
Trait action.devices.traits.OnOff
Trait action.devices.traits.StartStop
However when I say Ok Google, turn on as mentioned in here
I receive the event :
ON_RECOGNIZING_SPEECH_FINISHED:
with the text
turn on
but not the action
ON_DEVICE_ACTION:
Instead the assistant says to me:
Sorry power control is not yet supported
Is the Assitent library/service limited to regions, or is there any other limitation why I do not receive the actions back despite I followed the instructions and according to them all seems to work?
回答1:
After playing hours with assistant, and reading the docummenattion over and over, I found out , there is a hidden meaning and missing instructions hidden behind this sentence:
When you run the sample, it will generate a device instance for your particular device. This device instance will be associated with the device model that you specified to run the sample. Find the device instance ID in the output for the sample. You will use this ID to update your device so you can use Device actions.
device_model_id: my-model device_id: 1C3E1558B0023E49F71CA0D241DA03CF
What the document forgot to mention is that you must not only register the model but you also have to register the device as writen in reference
After registering the device with all the needed fields including nick I was able to receive the actions.
And this is exactly where you will need the device id from that sentence above... Somehow this step dropped off from the documantation :-)
googlesamples-assistant-devicetool register-device [OPTIONS]
Registers a device instance under an existing device model.
Device instance fields must start with a letter or number. The device ID
can only contain letters, numbers, and the following symbols: period (.),
hyphen (-), underscore (_), and plus (+). The device nickname can only
contain numbers, letters, and the space ( ) symbol.
Options:
--device TEXT Enter an identifier for a device instance.
If the device ID already exists, this
command will update the device instance. If
it does not exist, this command will create
a new device instance. This ID must be
unique within all of the devices registered
under the same Google Developer project.
[required]
--model TEXT Enter the identifier for an existing device
model. This new device instance will be
associated with this device model.
[required]
--nickname TEXT Enter a nickname for the device. You can use
this name when talking to your Assistant to
refer to this device.
--client-type [SERVICE|LIBRARY]
Select the type of the client. Use SERVICE
if using the Google Assistant Service or
LIBRARY if using the Google Assistant
Library. [required]
来源:https://stackoverflow.com/questions/48486092/google-actions-return-sorry-power-control-is-not-yet-supported