0

I'm building automation for a Nest thermostat. The automation infrastructure is attempting to use GCP's Pub/Sub and Cloud Functions services.

When creating a new project on Google's Device Access Console I don't see a way to update the Pub/Sub topic. Technically, there is an edit button, but the topic text field is greyed out and the string can't be changed. Nor do I see a way to access the auto-populated topic from inside my GCP project. As a result, I don't see how I can build a Function subscriber to the topic from my GCP project.

Interestingly, there is a way to create a Pub/Sub subscriber because that interface provides a method to manually enter the Pub/Sub topic that is shown on the Device Access Console. I've done this and verified that device data flows correctly.

There is no manual entry option when creating a Function that subscribes to a topic.

When I click on the topic listed on the Pub/Sub Subscriber, I'm presented with an error message,

You do not have sufficient permissions to view this page

enter image description here

How can I build a Cloud Function that responds to Pub/Sub events for the device?

Greg
  • 2,559
  • 4
  • 28
  • 46
  • just spotted this nugget in the documentation - "Publishing messages to an SDM topic is not supported. Use traits to get the current state of resources or to send commands." This may imply that I can't do what I want, and I need to find another way to chain the message bus to a topic I do have control over. – Greg Dec 20 '20 at 15:44
  • while it's not possible to edit the topic, you can use a *push* subscriber in GCP Pub/Sub to route the event to a Cloud Function. – Greg Dec 21 '20 at 22:17
  • I realize this is sort of old, but did you ever find a way to trigger a cloud function from the topic created in Device Access? I am attempting something similar, and hitting the same roadblock. – CoreyT May 25 '21 at 15:31
  • i never did. i used push. – Greg May 26 '21 at 16:21

0 Answers0