Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Media player entity not created #23

Open
bcutter opened this issue Apr 2, 2023 · 24 comments
Open

Media player entity not created #23

bcutter opened this issue Apr 2, 2023 · 24 comments

Comments

@bcutter
Copy link

bcutter commented Apr 2, 2023

I have two devices using HASS.Agent:

  • 1st one working fine, integration set up notification service and media player entity exist
  • 2nd one: integration only created the notification service but not the media player entity.

During HA Core restart and autodiscovery of the HASS.Agent integration for 2nd device, there was no audio program running (other than for the 1st device).

So after the initial integration adding I tried several times:

  • start a program like Spotify and play music
  • restart HA
  • reload HASS.Agent integration for 2nd device

Nothing helped, there's no media player entity showing up for that device.

In MQTT browser I still only see one entry in hass.agent / media_player.

Is there a certain rain dance ceremony needed for adding the media player?

@fillefilip8
Copy link
Collaborator

Is the Media Player enabled in the configuration for the second device?
image

@bcutter
Copy link
Author

bcutter commented Apr 3, 2023

Oh man... no it wasn't. What a shame. I was sure either I configured both machines completely identically or it was enabled by default.

HASS.Agent is now restarted. What's needed to make the entity appear in the HASS.Agent integration in HA? I try to avoid restarting HA Core if possible...
Note: reloading the integration from the UI did not make the media player entity appear.

@bcutter
Copy link
Author

bcutter commented Apr 3, 2023

OK, that's interesting: the checkbox disappears.

grafik

grafik

  1. Hit save and YES
    grafik

  2. Turn back to settings / media player:
    grafik


Main screen:

grafik

As you can see, local API is not enabled. The media settings section states "local API is needed", but that seems to be an outdated information. Proof: on machine number 1 the media player is working very well and it also does not use the local API.

@bcutter
Copy link
Author

bcutter commented Apr 6, 2023

Hello.

@loryanstrant
Copy link

Actually I have the same issue on a recent installation. HA has been restarted several times since the HASS.Agent install, as has the Windows PC that is running the agent.
All the other sensors are there and fine, but the media player is not showing up - yet it has for previous Windows devices.
Are there any other local permissions we can look at providing?

@bcutter
Copy link
Author

bcutter commented Apr 8, 2023

@loryanstrant is your GUI setting keeping the tick? As stated my affected client does not.

@loryanstrant
Copy link

@loryanstrant is your GUI setting keeping the tick? As stated my affected client does not.

My tick stays there, but it doesn't do anything.

@bcutter
Copy link
Author

bcutter commented Apr 21, 2023

it doesn't do anything

Like the progress in this issue 😄
Unfortunately there seems to be nothing from a user perspective to test or provide. Sit & wait mood activated...

@bcutter
Copy link
Author

bcutter commented May 25, 2023

Bump-i-di-bump

@dbeltman
Copy link

@bcutter maybe this helps you.

I had this issue for quite a while and was able to solve it by removing an old reference of my previous computer in the MQTT server. It retained the computer (different name) in the hass.agent/media_player topic, and after removing the entire hass.agent topic, removing the hass.agent integration in homeassistant, restarting homeassisant and adding it using the auto-discovery made it all work again.

Use https://github.com/thomasnordquist/MQTT-Explorer to connect to your MQTT server and check to see if there is any old/different PC names under the hass.agent/media_player topic

@samkatakouzinos
Copy link

It retained the computer (different name) in the hass.agent/media_player topic, and after removing the entire hass.agent topic, removing the hass.agent integration in homeassistant, restarting homeassisant and adding it using the auto-discovery made it all work again.

Thank you, this helped me.

@sbdobrescu
Copy link

@bcutter maybe this helps you.

I had this issue for quite a while and was able to solve it by removing an old reference of my previous computer in the MQTT server. It retained the computer (different name) in the hass.agent/media_player topic, and after removing the entire hass.agent topic, removing the hass.agent integration in homeassistant, restarting homeassisant and adding it using the auto-discovery made it all work again.

Use https://github.com/thomasnordquist/MQTT-Explorer to connect to your MQTT server and check to see if there is any old/different PC names under the hass.agent/media_player topic

You are a life saver! Thank you for sharing this.

@bcutter
Copy link
Author

bcutter commented Sep 7, 2023

@bcutter maybe this helps you.

I had this issue for quite a while and was able to solve it by removing an old reference of my previous computer in the MQTT server. It retained the computer (different name) in the hass.agent/media_player topic, and after removing the entire hass.agent topic, removing the hass.agent integration in homeassistant, restarting homeassisant and adding it using the auto-discovery made it all work again.

Use https://github.com/thomasnordquist/MQTT-Explorer to connect to your MQTT server and check to see if there is any old/different PC names under the hass.agent/media_player topic

Unfortunately this did not work out for me: in the hass.agent topic there's only one media player topic - the one from the other machine working fine.

The issue is, that this media player topic is not created at all for the machine...

@sbdobrescu
Copy link

@bcutter maybe this helps you.
I had this issue for quite a while and was able to solve it by removing an old reference of my previous computer in the MQTT server. It retained the computer (different name) in the hass.agent/media_player topic, and after removing the entire hass.agent topic, removing the hass.agent integration in homeassistant, restarting homeassisant and adding it using the auto-discovery made it all work again.
Use https://github.com/thomasnordquist/MQTT-Explorer to connect to your MQTT server and check to see if there is any old/different PC names under the hass.agent/media_player topic

Unfortunately this did not work out for me: in the hass.agent topic there's only one media player topic - the one from the other machine working fine.

The issue is, that this media player topic is not created at all for the machine...

If it's not created, then you have to start over. But before you go that route, make sure that media player is enabled in the Hass Agent on the machine that's missing. I'd start here:

Close HASS.Agent
Uninstall the addon from Home Assistant (HA)
Restart HA
Install the addon
Restart HA
Start HASS.Agent

@bcutter
Copy link
Author

bcutter commented Sep 7, 2023

That's a wild route. Next to killing my working machine this way, it also ignores the discovered behavior in HASS.Agent on the endpoint itself:

#23 (comment)

Before purging the whole (working) environment I would like to make sure it's not an endpoint thing - which it tastes like at the moment.

@Bajkot
Copy link

Bajkot commented Sep 23, 2023

Tried all of solutions, mentioned here. Nothing worked. Media_player topic is not created. And the Media checkbox dissappears after hass.agent restart.

Don't know what to do.

@DrR0X-glitch
Copy link

Tried all of solutions, mentioned here. Nothing worked. Media_player topic is not created. And the Media checkbox dissappears after hass.agent restart.

Don't know what to do.

I know it's been a while but I would suggest making a github issue over on the Hass agent github(the app one). Because if no mqtt message is being added then it is nothing Todo with the integration and this repo.

@amadeo-alex
Copy link

@Bajkot @bcutter could you please enable the debug logging option and upload logs from the "scenario" where the checkbox dissapears? Basically:

  • enable extended logging
  • tick the media player checkbox
  • wait a few seconds
  • restart HASS.Agent

@DrR0X-glitch is right that if the MQTT mesage is not published this is most likely a HASS.Agent issue and not the integration's fault.
The provided logs will allow me to verify this and have some starting point for the investigation - I'll create a HASS.Agent issue then to cover this.

@kuligs2
Copy link

kuligs2 commented Aug 7, 2024

for me its still not working.. im out of ideas what to do.. everythiing is up to date, still no media players from windows 11 pc

@bcutter
Copy link
Author

bcutter commented Aug 7, 2024

Did you try the forked version?

@kuligs2
Copy link

kuligs2 commented Aug 8, 2024

Did you try the forked version?

what fork? Agent fork or the integration in HA fork?

Can you point me to that fork?

I used the HACS the agent integration that is 3months old (it says that in the HACS store page).

Then i got the client for windows from official https://github.com/hass-agent/HASS.Agent repo

@bcutter
Copy link
Author

bcutter commented Aug 8, 2024

Then i got the client for windows from official https://github.com/hass-agent/HASS.Agent repo

Yes that's the actively maintained fork. The original repo we're tracking this issue here seems to be currently unmaintained.

@ElEmFurt
Copy link

So I see the topics published in MQTT Explorer
image
But I don't see media player in HA, what am I missing? Please help I did try deleting the topics and reinstalling the integration and it didn't work.

@ElEmFurt
Copy link

So after a lot of searching, I stumbled upon this thread.

Uninstalling the existing HASS.Agent integration in HA (also removing all existing entities) and then reinstalling the one here (mentioned in the thread above) worked. I now have the media player entity in HA and can control music playing in a chrome browser on my windows machine from HA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests