I'm kind of new to working with Hubitat but am at the point I'm trying to use someone elses custom device driver that is having an issue and I'm trying to debug it. I'm using the Xbox One Smartglass Driver and the developer isn't using Hubitat anymore and they can't work on it, so I'm working on debugging the console off command that used to work, but possibly due to the Xbox REST server being newer now ??? Its not returning the device_status back to the driver as expected. Or something else changed since he wrote it.
The rest server is passing a json object back to the browser that is correct, but the line of code that reads it back into the Hubitat device driver is showing up as a null object.
httpGet([uri:"http://${restIp}:$restPORT/device?addr=$xboxIP"], { response ->
xboxStatus = response.data.devices[liveID].device_status // Storing Device Status in Variable
This is the call and xboxStatus should be set to "Available".
If I put the call directly into a browser: http://10.1.10.33:1234/device?addr=10.1.10.50
It returns this json object:
[{"liveid":"F4000D8D96E5A3F6","ip_address":"10.1.10.50","connection_state":"Disconnected","pairing_state":"NotPaired","device_status":"Available","last_error":0,"authenticated_users_allowed":true,"console_users_allowed":false,"anonymous_connection_allowed":true,"is_certificate_pending":false}]
But xboxStatus does not get set and if I add a debug log statement to add it to the log
log.debug response.data.devices[liveID].device_status
It logs an error that its a null object.
What should I be looking for here? Can someone point me at documentation on how the response variable should be written? Or if its something else point me in the right direction.