0

I don't have any idea why he could not create the instance.

First it says:

C:\Users\Thomas\Desktop>googlesamples-assistant-pushtotalk --device-id                         assi
INFO:root:Connecting to embeddedassistant.googleapis.com
WARNING:root:Device config not found: [Errno 2] No such file or directory: 'C:\\.....\\AppData\\...
INFO:root:Registering device
ERROR:root:Option --device-model-id required when registering a device instance.

Next try with --device-model-id

C:\Users\Thomas\Desktop>googlesamples-assistant-pushtotalk --device-model-id assi
INFO:root:Connecting to embeddedassistant.googleapis.com
WARNING:root:Device config not found: [Errno 2] No such file or directory: 'C:\\Users\\Thomas\\AppData\\Roaming\\googlesamples-assistant\\device_config.json'
INFO:root:Registering device
ERROR:root:Option --project-id required when registering a device instance.

And next try with --project-id

C:\Users\Thomas\Desktop>googlesamples-assistant-pushtotalk --device-model-id assi --project-id evil-assist
INFO:root:Connecting to embeddedassistant.googleapis.com
WARNING:root:Device config not found: [Errno 2] No such file or directory: 'C:\\Users\\Thomas\\AppData\\Roaming\\googlesamples-assistant\\device_config.json'
INFO:root:Registering device
ERROR:root:Failed to register device: {
  "error": {
    "code": 400,
    "message": "Could not create the device instance. Client type need to be specified as SDK_LIBRARY or SDK_SERVICE.",
    "status": "INVALID_ARGUMENT"
  }
}

I also registered the device as shown on developers.google.com.

C:\Users\Thomas\Desktop>googlesamples-assistant-devicetool list --model
Device Model Id: assi
        Project Id: evil-assist
        Device Type: action.devices.types.LIGHT
        Trait action.devices.traits.OnOff

And

C:\Users\Thomas\Desktop>googlesamples-assistant-devicetool list --device
Device Instance Id: assi
    Nickname: assi
    Model: assi

Any ideas why it doesn't work?

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Thomas Mayer
  • 1
  • 1
  • 1

3 Answers3

0

Fund a solution..

Update the Library using

python -m pip install --upgrade google-assistant-sdk[samples]

I updated it 2 days ago, it seems that there was a bug in that version. Now it works.

Thomas Mayer
  • 1
  • 1
  • 1
0

SDK library was updated to 0.4.1 to fix this issue.

https://github.com/googlesamples/assistant-sdk-python/commit/f00df5ff40672942bdc6d1b27c10c49076f994f2

0

You should update library as Thomas Mayer mentioned.

googlesamples-assistant-devicetool

changed slightly. To create device instance id there's command:

googlesamples-assistant-devicetool --project-id myand
roidthings-5dba4 register-device --device 123456 --model myandroidthings-xxxxxx-myproduct-yyyyyy --client-type LIBRARY

Apart from that https://developers.google.com/assistant/sdk/guides/library/python/ seems to be up to date

Last option depends on platform you support: https://developers.google.com/assistant/sdk/overview#features SERVICE is for All gRPC platforms. LIBRARY is for linux-armv7l and linux-x86_64

PrzemekTom
  • 1,328
  • 1
  • 13
  • 34