HASS.Agent-Integration icon indicating copy to clipboard operation
HASS.Agent-Integration copied to clipboard

Media player entity not created

Open bcutter opened this issue 2 years ago • 26 comments

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?

bcutter avatar Apr 02 '23 18:04 bcutter

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

fillefilip8 avatar Apr 03 '23 19:04 fillefilip8

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 avatar Apr 03 '23 22:04 bcutter

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 avatar Apr 03 '23 22:04 bcutter

Hello.

bcutter avatar Apr 06 '23 19:04 bcutter

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?

loryanstrant avatar Apr 06 '23 23:04 loryanstrant

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

bcutter avatar Apr 08 '23 15:04 bcutter

@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.

loryanstrant avatar Apr 08 '23 22:04 loryanstrant

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 avatar Apr 21 '23 15:04 bcutter

Bump-i-di-bump

bcutter avatar May 25 '23 13:05 bcutter

@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

dbeltman avatar May 30 '23 21:05 dbeltman

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.

samkatakouzinos avatar Jun 14 '23 17:06 samkatakouzinos

@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.

sbdobrescu avatar Sep 06 '23 12:09 sbdobrescu

@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...

bcutter avatar Sep 07 '23 10:09 bcutter

@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

sbdobrescu avatar Sep 07 '23 14:09 sbdobrescu

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:

https://github.com/LAB02-Research/HASS.Agent-Integration/issues/23#issuecomment-1495060384

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.

bcutter avatar Sep 07 '23 14:09 bcutter

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.

Bajkot avatar Sep 23 '23 10:09 Bajkot

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.

DrR0X-glitch avatar Nov 07 '23 10:11 DrR0X-glitch

@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.

amadeo-alex avatar Nov 07 '23 10:11 amadeo-alex

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

kuligs2 avatar Aug 07 '24 19:08 kuligs2

Did you try the forked version?

bcutter avatar Aug 07 '24 23:08 bcutter

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

kuligs2 avatar Aug 08 '24 06:08 kuligs2

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.

bcutter avatar Aug 08 '24 08:08 bcutter

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 avatar Dec 15 '24 08:12 ElEmFurt

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.

ElEmFurt avatar Dec 15 '24 19:12 ElEmFurt

Did not work for me. Ticking the box is not persistent, and the hass.agent/media_player/devicename topic is never created for that machine.

bcutter avatar Feb 23 '25 01:02 bcutter