Closed muddro1 closed 3 years ago
Issues that don't provide the information requested in the troubleshooting docs may not get a reply and may be closed until the info is provided. Please, include as much of the requested info as possible so that I can replicate and investigate your issue.
When pasting in your config/code/errors always place 3 backticks ```
above the first line and after the last line. Doing this will format it correctly.
Hi
seeing the same error :
2021-08-26 13:33:29 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry None for plex_assistant
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 293, in async_setup
result = await component.async_setup_entry(hass, self) # type: ignore
File "/config/custom_components/plex_assistant/__init__.py", line 79, in async_setup_entry
pa = await hass.async_add_executor_job(pa_executor, server, list(start_script.keys()))
File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 52, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/plex_assistant/__init__.py", line 75, in pa_executor
get_devices(hass, _pa)
File "/config/custom_components/plex_assistant/helpers.py", line 50, in get_devices
for entity in list(hass.data["media_player"].entities):
KeyError: 'media_player'
i may have found the culprit, but no idea to solve it i yesterday installed a new media_player in config, if i comment it out, then plex assistant works if i add the config back, plex assistant throws an error
media_player:
- platform: linkplay
host: !secret arylica50
name: Luidspeker_Buiten
volume_step: 5
sources:
{}
hey @muddro1 what other media_players do you have in your config? this plex assistant seems to fail because its in conflict with a media_player
Looks like this would be the culprit
media_player:
- platform: androidtv
name: Shield TV
host: 192.168.40.50
yeah, something wrong , not sure what, i fixed it with excluding that media player in the function
in helpers.py
line 49 and forward, added this line : if not entity == media_player.luidspeker_buiten:
so i exclude that specific media player from that function
so it looks like :
def get_devices(hass, pa):
for entity in list(hass.data["media_player"].entities):
if not entity == media_player.luidspeker_buiten:
info = str(entity.device_info.get("identifiers", "")) if entity.device_info else ""
dev_type = [x for x in ["cast", "sonos", "plex", ""] if x in info][0]
if not dev_type:
continue
try:
name = hass.states.get(entity.entity_id).attributes.get("friendly_name")
except AttributeError:
continue
pa.devices[name] = {"entity_id": entity.entity_id, "device_type": dev_type}
Probelm is thats the mediaplayer I would use plex assistant with.
ah ok :-)
i have no idea why its failing :-( we need some assiance from @maykar
I just submitted a PR (https://github.com/maykar/plex_assistant/pull/143) that I think fixes the issue (it fixed it for me). I think the problem is sometimes plex_assistant starts before the media_player component. The PR makes it wait for media_player to start. You can try editing your manifest.json file and restart HA and see if it works for you.
That could be it indeed, thnx
I just submitted a PR (#143) that I think fixes the issue (it fixed it for me). I think the problem is sometimes plex_assistant starts before the media_player component. The PR makes it wait for media_player to start. You can try editing your manifest.json file and restart HA and see if it works for you.
Seems to have fixed it for me and solution makes sense. Thanks!
Can be closed now :-)
Consitently get the following error: