Search code examples
node.jsactions-on-googlegoogle-smart-home

Empty request from Google Smart Home SDK


I'm creating web server to connect my DIY smart home devices to Google Home app.

After authorisation and token request Google server makes POST request to fullfillment URL, but request is empty for some reason. According to documentation, it must be SYNC request, but it does not contain any values, even request ID.

There is error "Couldn't update the setting. Check your Internet connection." on my phone after request.

So why does it happen and how I can fix it?

const app=smarthome({ debug: true, });

app.onSync( async (body) => {
    return {
        requestId: body.requestId,
        payload: {
            agentUserId: "agentUserId",
            devices                       // devices list
        }
    };
});

server.post("/request", app);

Solution

  • Oh, I forgot to include body-parser 'cause I'm using general web server instead of actions-on-google API. LOL

    Case closed.