I'm doing test suite.Refer to the test suite flow chart picture. Developer cloud can receive instructions sent by Google assistant. But when I do reportstate to homegraph, I get this exception. I don't know why?
I refer to this website https://developers.google.com/assistant/smarthome/develop/request-sync Step. Enable the Google homegraph API, create a service account key, and finally, call the API.
private void onDeviceAdded() throws IOException {
FileInputStream stream = new FileInputStream("service-account-key.json");
GoogleCredentials credentials = GoogleCredentials.fromStream(stream);
mySmartHomeApp.setCredentials(credentials);
RequestSyncDevicesResponse response = mySmartHomeApp.requestSync("my-self-user-id");
}
Exception i got:
io.grpc.StatusRuntimeException: UNAVAILABLE: io exception
at io.grpc.stub.ClientCalls.toStatusRuntimeException(ClientCalls.java:233)
at io.grpc.stub.ClientCalls.getUnchecked(ClientCalls.java:214)
at io.grpc.stub.ClientCalls.blockingUnaryCall(ClientCalls.java:139)
at com.google.home.graph.v1.HomeGraphApiServiceGrpc$HomeGraphApiServiceBlockingStub.requestSyncDevices(HomeGraphApiServiceGrpc.java:406)