core icon indicating copy to clipboard operation
core copied to clipboard

Xbox Live component doesn't report errors when setting up sensors

Open duckpuppy opened this issue 9 years ago • 7 comments

Make sure you are running the latest version of Home Assistant before reporting an issue.

You should only file an issue if you found a bug. Feature and enhancement requests should go in the Feature Requests section of our community forum:

Home Assistant release (hass --version): 0.51.2

Python release (python3 --version): Python 3.4.2

Component/platform: Xbox Live

Description of problem: Prior to 0.50 (I jumped from 0.49 to 0.50 to 0.51 fairly quickly, so I'm still pinpointing where this might have heppened), the Xbox Live sensors worked for me. Now, no sensors are created by the component in the entity list. There are two XboxAPI calls made each time I restart HASS (I have two UIDs configured), but no more.

The component shows that it's being configured in the logs. The config check shows that the secrets are being read correctly, and this was a working config.

The problem, as it turns out, was that my oauth token had expired on XboxAPI. The error is reported back properly from XboxAPI, but the sensor silently throws the error away and does nothing. If there error were reported in the logs, then the user could take action to correct the problem.

2017-08-16 16:36:52 INFO (MainThread) [homeassistant.loader] Loaded sensor.xbox_live from homeassistant.components.sensor.xbox_live
<snip>
2017-08-16 16:37:05 INFO (MainThread) [homeassistant.components.sensor] Setting up sensor.xbox_live

There's nothing in the logs related to the sensor after this, and no errors.

Expected: Sensors are created for the Xbox Live UIDs configured.

Problem-relevant configuration.yaml entries and steps to reproduce:

- platform: xbox_live
  entity_namespace: xbox
  scan_interval: 300
  api_key: !secret xboxapi_key
  xuid:
    - !secret duckpuppy_uid
    - !secret mithrixz_uid

duckpuppy avatar Aug 16 '17 20:08 duckpuppy

To eliminate the secrets being the issue, I did edit the files and put the api_key and xuids directly in the config. No change.

duckpuppy avatar Aug 16 '17 20:08 duckpuppy

Looking at the code for the component, if XBoxAPI returns something other than success, it'll silently do nothing. This config was a working config, so I'm not sure what errors it could be returning, but I'll try to write up a quick test script later tonight or tomorrow to see what might be going on there.

I might also look at a PR for the component to log any errors so that they can be acted on.

duckpuppy avatar Aug 16 '17 21:08 duckpuppy

OK, the problem was that my XBox Live oauth token had expired on XboxApi. That should be reported as an error when setting up the sensor. I'll change the title of the ticket to be more in line with the real problem.

duckpuppy avatar Aug 17 '17 12:08 duckpuppy

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.

Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment :+1:

balloobbot avatar Oct 20 '17 16:10 balloobbot

This issue will be auto-closed because there hasn't been any activity for a few months. Feel free to open a new one if you still experience this problem 👍

balloobbot avatar Dec 11 '17 08:12 balloobbot

Can we reopen this issue? I'm still hitting it.

iliketoprogram14 avatar Dec 30 '17 00:12 iliketoprogram14

Thanks for fixing @ReneNulschDE!

iliketoprogram14 avatar Jan 18 '18 10:01 iliketoprogram14