Report State API implementation

googleassistant
Tags: #<Tag:0x00007f1e51698a18>
(Kiran Patil) #1

Hi,

I am trying to setup openhab-google-assistant for testing and I came to know that to publish the Google Action, we need to setup Report State.

From the project README, I could not find any information how to setup Remote state but in code it is disabled as shown in below link.

I also noticed that “openHAB” is present as part of Google assistant Smart Home service.

Could you also please clarify, how did you register “openHAB” without ReportState ?

Because now there is a third party company which is doing all this verification step in partner with google.

Thanks.

3 Likes

(Kiran Patil) #2

@MARZIMA, could you please throw some light on it ?

0 Likes

(Mehmet Arziman) #3

openHAB integration was there before ReportState.
The rest you wrote is your own stuff and I don’t see any connection to openHAB.

0 Likes

(Kiran Patil) #4

Hi,

We are trying to implement Report State API, which we would like to share with the community.

Now we are getting below issue, which we could not resolve.

Could you please help us to resolve this issue ?

We have added below lines to openhab.js file

const {smarthome} = require('actions-on-google');
const app = smarthome({
});

Please find the below console output.

smartfueb_march_gmail_com@instance-1-ubuntu16:/home/smartfueb_march/openhab-google-assistant/functions$ gcloud beta functions deploy openhabGoogleAssistant --stage-bucket smart_test1 --trigger-http

Deploying function (may take a while - up to 2 minutes)...failed.
ERROR: (gcloud.beta.functions.deploy) OperationError: code=3, message=Function failed on loading user code. Error message: Code in file index.js can't be loaded.
Is there a syntax error in your code?
Detailed stack trace: TypeError: smarthome is not a function
at Object.<anonymous> (/user_code/openhab.js:23:13)
at Module._compile (module.js:577:32)
at Object.Module._extensions..js (module.js:586:10)
at Module.load (module.js:494:32)
at tryModuleLoad (module.js:453:12)
at Function.Module._load (module.js:445:3)
at Module.require (module.js:504:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/user_code/index.js:18:17)
at Module._compile (module.js:577:32)
1 Like

(Kiran Patil) #5

We could resolve the issue of smarthome is not function by using below commands and changing the package.json file to 2.6.0.

$ sudo npm install -g actions-on-google@latest

0 Likes

(Chiranjeevi B) #6

when can we expect this implementation to openHAB, even I am trying to implement the report state but I am getting 404 error saying that Requested entity was not found in docs they are saying it is because of agentUserId, I am not getting what I am missing… please help me out on this.

thanks in advance

1 Like