sensor.emby_upcoming_media icon indicating copy to clipboard operation
sensor.emby_upcoming_media copied to clipboard

KeyError: "ViewCategories" on setup

Open hanerd opened this issue 4 years ago • 5 comments

I can't get the sensor to actually install on HA .114 and Emby 4.4.3. It fails setup with the following error:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 184, in _async_setup_platform
    await asyncio.shield(task)
  File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/emby_upcoming_media/sensor.py", line 85, in setup_platform
    categories = client.get_view_categories()
  File "/config/custom_components/emby_upcoming_media/client.py", line 41, in get_view_categories
    return self.data["ViewCategories"]
KeyError: 'ViewCategories'```

hanerd avatar Aug 28 '20 23:08 hanerd

I am having the same issue..

mhertel avatar Dec 01 '20 22:12 mhertel

Same issue here. I previously had this working fine, then moved house and changed a bunch of network settings. Aside from updating the Emby configuration to the new IP, no Emby-specific settings have changed. My logs are identical to @hanerd's aside from the line numbers, but happy to help with other logs/troubleshooting.

boardwarp avatar Dec 20 '20 01:12 boardwarp

Same problem here. I am under Emby 4.5.4.0 via a Docker image hosted on a NAS (IP: 192.168.0.240) and HA 2020.12.2 supervisor hosted via a Docker image on an RPi (IP 192.168.0.252). Did you find a solution or a workaround?

Squale76 avatar Jan 03 '21 08:01 Squale76

To work around the problem, you must connect to Emby via the account used by HA. Then go to Profile, get the URL that points to this page. It will be in this form: http://<emby_host_ip>: 8096/web/index.html #!/settings/profile.html?userId=<user_id>&serverId=<server_id> Retrieve the user_id that you put in the parameters in the HA configuration file configuraiton.yaml with this code :

sensor:
- platform: emby_upcoming_media
  api_key: YOUR_EMBY_API_KEY
  user_id: <user_id>
  host: <ip address of emby host>

Squale76 avatar Jan 03 '21 10:01 Squale76

To work around the problem, you must connect to Emby via the account used by HA...

This worked perfectly for me, thanks!

boardwarp avatar Apr 05 '21 23:04 boardwarp