LAB02-Research / HASS.Agent-Integration

HASS.Agent's Home Assistant integration. Adds notifications and mediaplayer capabilities to HASS.Agent - a Windows based client (companion app) for Home Assistant.
MIT License
113 stars 21 forks source link

Media player entity not created #23

Open bcutter opened 1 year ago

bcutter commented 1 year ago

I have two devices using HASS.Agent:

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:

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 commented 1 year ago

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

bcutter commented 1 year ago

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 commented 1 year ago

OK, that's interesting: the checkbox disappears.

  1. grafik

  2. grafik

  3. Hit save and YES grafik

  4. 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 commented 1 year ago

Hello.

loryanstrant commented 1 year ago

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 commented 1 year ago

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

loryanstrant commented 1 year ago

@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 commented 1 year ago

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 commented 1 year ago

Bump-i-di-bump

dbeltman commented 1 year ago

@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 commented 1 year ago

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 commented 1 year ago

@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 commented 1 year ago

@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 commented 1 year ago

@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 commented 1 year ago

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.

Bajkot commented 1 year ago

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 commented 11 months ago

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 commented 11 months ago

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

@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 commented 2 months ago

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 commented 2 months ago

Did you try the forked version?

kuligs2 commented 2 months ago

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 commented 2 months ago

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.