'Internal error encountered when report state
I am trying the TV device type and I am getting "Internal error encountered" when sending the response to Google.
When I homegraph.devices.reportStateAndNotification with following payload
{
"requestId":"f7549700-aedf-433f-b558-53804c19b7b6",
"agentUserId":"61895a84e5dcfc75b21b5c43",
"payload":{
"devices":{
"states":{
"6192275c26ab9a11a26cdcfb":{
"online":true,
"on":true,
"currentInput":"hdmi_1",
"playbackState":"STOP",
"currentVolume":0,
"isMuted":false
}
}
}
}
}
Getting following error.
Error: Internal error encountered.
at Gaxios._request (/xxxx/api/node_modules/gaxios/build/src/gaxios.js:86:23)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:95:5)
at async JWT.requestAsync (/var/www/sinric_pro/api/node_modules/google-auth-library/build/src/auth/oauth2client.js:349:18)
I checked the Logs in the Google cloud console and couldn't find any errors reported as well. Hoping someone can point me out why
SYNC Response:
{
"status":200,
"headers":{
"content-type":"application/json;charset=utf-8"
},
"body":{
"requestId":"2275190106898401713",
"payload":{
"agentUserId":"61895a84e5dcfc75b21b5c43",
"devices":[
{
"id":"6192275c26ab9a11a26cdcfb",
"type":"action.devices.types.TV",
"traits":[
"action.devices.traits.OnOff",
"action.devices.traits.InputSelector",
"action.devices.traits.Channel",
"action.devices.traits.TransportControl",
"action.devices.traits.Volume"
],
"name":{
"defaultNames":[
"TV"
],
"name":"TV",
"nicknames":[
"TV"
]
},
"willReportState":true,
"roomHint":"Living Room",
"deviceInfo":{
"manufacturer":"Sinric Pro",
"model":"SinricPro television",
"hwVersion":"1.0",
"swVersion":"1.0"
},
"attributes":{
"transportControlSupportedCommands":[
"NEXT",
"PREVIOUS",
"PAUSE",
"STOP",
"RESUME",
"CAPTION_CONTROL"
],
"availableApplications":[
{
"key":"youtube",
"names":[
{
"name_synonym":[
"Youtube",
"Youtube_en"
],
"lang":"en"
}
]
},
{
"key":"netflix",
"names":[
{
"name_synonym":[
"NetFlix",
"netflix_en"
],
"lang":"en"
}
]
}
],
"availableInputs":[
{
"key":"hdmi1",
"names":[
{
"name_synonym":[
"HDMI 1",
"DVD player"
],
"lang":"en"
}
]
},
{
"key":"hdmi_2",
"names":[
{
"name_synonym":[
"HDMI 2",
"TV"
],
"lang":"en"
}
]
}
],
"availableChannels":[
{
"key":"ktvu2",
"names":[
"Fox",
"KTVU"
],
"number":"2"
},
{
"key":"abc1",
"names":[
"ABC",
"ABC East"
],
"number":"702.4-11"
}
],
"orderedInputs":false,
"volumeMaxLevel":100,
"volumeCanMuteAndUnmute":true,
"volumeDefaultPercentage":6,
"levelStepSize":2,
"commandOnlyVolume":false,
"supportActivityState":false,
"supportPlaybackState":true
}
}
]
}
}
}
Query:
"inputs": [
{
"intent": "action.devices.QUERY",
"payload": {
"devices": [
{
"id": "6192275c26ab9a11a26cdcfb"
}
]
}
}
],
"requestId": "6671070061963216968"
}
Query Response:
{
"status": 200,
"headers": {
"content-type": "application/json;charset=utf-8"
},
"body": {
"requestId": "6671070061963216968",
"payload": {
"devices": {
"6192275c26ab9a11a26cdcfb": {
"status": "SUCCESS",
"online": false,
"on": false,
"currentInput": "hdmi_1",
"playbackState": "STOP",
"currentVolume": 0,
"isMuted": false
}
}
}
}
}
Solution 1:[1]
An internal error occurs when the web server you're trying to access is misconfigured in some way that prevents it from responding properly to what you're asking it to do. The use of an external library can also sometimes cause an internal error like this error,
Error: Internal error encountered.
at Gaxios._request (/xxxx/api/node_modules/gaxios/build/src/gaxios.js:86:23)
at runMicrotasks ()
You can make sure the content being sent is right by using a tool like curl or postman as it looks like the current state is not being reported to the HomeGraph API. Please follow the steps in the link https://developers.google.com/assistant/smarthome/develop/report-state?hl=en to correctly report state and update the HomeGraph API
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Anish Yadav |
