potmat / homebridge-google-nest-sdm

A Homebridge plugin for Google Nest devices that uses the Google Smart Device Management API. Supports Cameras, Doorbells, Displays, and Thermostats. Includes support for HomeKit Secure Video.
ISC License
134 stars 15 forks source link

Error with event subscription stating Invalid resource name. #102

Closed Adelgiorno92 closed 9 months ago

Adelgiorno92 commented 10 months ago

I have gone through the entire setup process 4 times now. It is now showing up in HomeKit after I removed the child bridge. I even completely removed the cache devices before that and then uninstalled and reinstalled the whole plugin before the most recent attempt. But it is still throwing this error. I have clearly gone through the steps and even made sure to use the + link you provided, turned on Cloud Pub/Sub and added the GCP Project ID using the Project ID. Not sure if there is some functionality lost yet since I have been playing with it all day. Any thoughts on how I can clear this error?

[homebridge-google-nest-sdm] Plugin initialization failed, there was a failure with event subscription. Did you read the readme: https://github.com/potmat/homebridge-google-nest-sdm#where-do-the-config-values-come-from StatusError: Invalid resource name given (name=projects/sdm-prod/topics/enterprise-9b158fa0-6df3-4f1b-9dce-68397594a6bf). Refer to https://cloud.google.com/pubsub/docs/admin#resource_names for more information.

at MessageStream._onEnd (/var/lib/homebridge/node_modules/homebridge-google-nest-sdm/node_modules/@google-cloud/pubsub/src/message-stream.ts:289:20)
at MessageStream._onStatus (/var/lib/homebridge/node_modules/homebridge-google-nest-sdm/node_modules/@google-cloud/pubsub/src/message-stream.ts:330:12)
at ClientDuplexStreamImpl.<anonymous> (/var/lib/homebridge/node_modules/homebridge-google-nest-sdm/node_modules/@google-cloud/pubsub/src/message-stream.ts:184:38)
at Object.onceWrapper (node:events:628:26)
at ClientDuplexStreamImpl.emit (node:events:513:28)
at Object.onReceiveStatus (/var/lib/homebridge/node_modules/homebridge-google-nest-sdm/node_modules/@grpc/grpc-js/src/client.ts:695:16)
at Object.onReceiveStatus (/var/lib/homebridge/node_modules/homebridge-google-nest-sdm/node_modules/@grpc/grpc-js/src/client-interceptors.ts:424:48)
at /var/lib/homebridge/node_modules/homebridge-google-nest-sdm/node_modules/@grpc/grpc-js/src/call-stream.ts:330:24
at processTicksAndRejections (node:internal/process/task_queues:77:11) {

code: 3, details: 'Invalid resource name given (name=projects/sdm-prod/topics/enterprise-9b158fa0-6df3-4f1b-9dce-68397594a6bf). Refer to https://cloud.google.com/pubsub/docs/admin#resource_names for more information.', metadata: Metadata { internalRepr: Map(0) {}, options: {} }

Ben-Chapman commented 9 months ago

I ran into this same issue, and you're using the Pub/Sub topic name, when you need to use the Pub/Sub Subscription Name ¯\_(ツ)_/¯

I hope this helps!

potmat commented 9 months ago

@Ben-Chapman is right, as the readme and config screen say, the value should look like

projects/your-gcp-project-id/subscriptions/your-subscription-id