HASS.Agent: Windows client to receive notifications, use commands, sensors, quick actions and more!

Hi,

I’m a complete novice with HA and this is my first post here so please be gentle.

I think this project is great after seeing it mentioned on Everything Smart Home’s Youtube channel as one of his “8 Simple Smart Home Automations Anyone Can Do!” it was something I wanted to implement in to my set up (RPI 4/ HA Core 2022.6.4).

Now I’ve followed the documentation and installed HASS.Agent release 2022.11.4.

This is probably down to something i’ve done, or not configured correctly but I’m a bit stuck and I’m hoping someone may be able to help.

OK, my issue is that I’m not seeing my PC as a Device or any of the Entities within Home Assistant.

I’ve installed the Windows client and it appears to be all ok

I’ve managed to setup the HASS.Agent Notifiction service through HACS and tested that I’m getting a test notification

So as far as I can tell, everything is connected up properly.
HASS.Agent logs show that its connecting to my HA instance also (If I’m reading them correctly)

2022-06-10 11:35:56.637 +01:00 [INF] [SETTINGS_QUICKACTIONS] Loaded 1 entities
2022-06-10 11:35:56.653 +01:00 [INF] [SETTINGS_COMMANDS] Loaded 9 entities
2022-06-10 11:36:01.691 +01:00 [INF] [SETTINGS_SENSORS] Loaded 11 entities
2022-06-10 11:36:01.695 +01:00 [INF] [NOTIFIER] Ready
2022-06-10 11:36:01.696 +01:00 [INF] [MQTT] Identifying as device: DESKTOP.HOME
2022-06-10 11:36:01.696 +01:00 [INF] [MEDIA] Ready
2022-06-10 11:36:01.697 +01:00 [INF] [LOCALAPI] Initializing ..
2022-06-10 11:36:01.697 +01:00 [INF] [SERVICE] Local install path: C:\Program Files (x86)\LAB02 Research\HASS.Agent Satellite Service\
2022-06-10 11:36:01.702 +01:00 [INF] [HOTKEY] Completed bind for global quickaction hotkey
2022-06-10 11:36:01.706 +01:00 [INF] [MQTT] Connecting ..
2022-06-10 11:36:01.783 +01:00 [INF] [MQTT] Connected
2022-06-10 11:36:01.837 +01:00 [INF] [HASS_API] Home Assistant version: 2022.6.4
2022-06-10 11:36:02.092 +01:00 [INF] [LOCALAPI] listening on port 5115
2022-06-10 11:36:03.553 +01:00 [INF] [HASS_API] System connected with http://homeassistant.local:8123
2022-06-10 11:36:03.734 +01:00 [INF] [MQTT] Initial registration completed

I have noticed there does appear to be an issue shown in the MQTT Addon Logs, but this appears to be a bug following the latest release.

1654858561: Client <unknown> disconnected, not authorised.
1654858567: New connection from 172.30.32.1:40452 on port 1883.
error: received null username or password for unpwd check

However using MQTT Explorer I can see that the messages are coming through from my PC to MQTT

I’m afraid I’m at a loss at what I need to do and i’m sure its something i’ve missed somewhere.

Thanks in advance from an inexperienced but keen new user.

Not something like your MQTT integration has auto-discover turned off is it? Seems strange that you can see the MQTT messages but homeassistant can’t… Maybe check your core_device/entity data files too to make sure HASS hasn’t added then hidden/disabled them

1 Like

Hi,
Thanks for responding; i’ve checked the MQTT Integration settings and it appears that “enable discovery” is enabled already.

Is Auto-Discovery another setting somewhere?

image

Hi @SkoobyDu,

Let’s try to work out some possible issues. Did you by chance change the ‘discovery prefix’ in either your integration or HASS.Agent? They need to be the same:

Hi @SamKr

Thank you for taking the time to respond; please see below my copy of your screen shot; I left everything as default I believe.

Hi @SamKr
When you say “integration” which integration do you mean?

This is what my MQTT Integration config screen looks lie; should I have anything in here?

Good morning! Thanks for this client @SamKr . It’s been working great for getting some of the data into home assistant. I am running into a snag with the media player side of things.

My settings in configuration.yaml

#Hass Agent Media Player
media_player: 
  name: "********** PC"
  platform: hass_agent_mediaplayer
  host: http://192.168.0.170
  port: 5115

When I visit it from another device on a browser, I do get the page saying “HASS.Agent Active”

I see it in my homeassistant but it says the status is 'unavailable"

My HASS.Agent MediaPlayer integration is on 2022.5.7. All my settings are on default. Anyone else facing this issue knows how to solve it? Am I missing something?

Hi @Noob25930, thanks!

Could you please change the host to 192.168.0.170, reboot, and try again?

Well if you didn’t change that knowingly, it’s probably ok as-is.

Can you please make sure you have at least one sensor configured, and then through MQTT Explorer get the relevant topics & content you’re seeing, and post them here.

Also, could you please double-check if there are errors in Home Assistant’s log.

Hi, I’m just checking that I don’t need to add anything to my configuration.yaml file? I did for the notification, but I haven’t added anything else.

I’ve checked my HA logs and there s the following:

Logger: homeassistant.components.mqtt.discovery
Source: components/mqtt/discovery.py:109
Integration: MQTT (documentation, issues)
First occurred: 13:03:41 (3104 occurrences)
Last logged: 13:09:02

Received message on illegal discovery topic 'homeassistant/sensor/DESKTOP.HOME/desktop_home_network_bfb2b9c9963d42f88155c51e545c4c60_dhcp_addresses/config'
Received message on illegal discovery topic 'homeassistant/sensor/DESKTOP.HOME/desktop_home_network_bfb2b9c9963d42f88155c51e545c4c60_dns_enabled/config'
Received message on illegal discovery topic 'homeassistant/sensor/DESKTOP.HOME/desktop_home_network_bfb2b9c9963d42f88155c51e545c4c60_dns_suffix/config'
Received message on illegal discovery topic 'homeassistant/sensor/DESKTOP.HOME/desktop_home_network_bfb2b9c9963d42f88155c51e545c4c60_dns_addresses/config'
Received message on illegal discovery topic 'homeassistant/sensor/DESKTOP.HOME/desktop_home_network_total_network_card_count/config'

I have @SamKr. Initially, that’s the settings I used but, in that case, I get no entity at all in home assistant. I tried it again right now, same results.

Could you please change your device’s name in HASS.Agent, the dot in DESKTOP.HOME might be causing trouble. You can do so in the configuration screen → general → device name.

3 Likes

So to be sure, this is your exact config (the port is default so you can drop it):

media_player: 
  name: "********** PC"
  platform: hass_agent_mediaplayer
  host: 192.168.0.170

Yes, same settings. I dropped the port settings on my configuartion. I also had changed the DESKTOP.HOME already. its only one word. I am kinda puzzled as to what it could be. I looked at the github and no one seems to have the same issue as me. I know my ports are opened on the firewall too since everything else is working just fine.

I have my settings as below and now I am not seeing the media player entity at all.

media_player: 
  name: "********** PC"
  platform: hass_agent_mediaplayer
  host: 192.168.0.170

@SamKr You absolute legend!!!

Following your instruction, I’ve just altered the device name to replace the dot with an underscore and as if by magic my PC is now showing under devices.

Thank you so much for taking the time to help me today.

1 Like

Do you have more media_player entities configured in the same file? Perhaps give it a name in the first row, I have it configured as such:

media_player test_vm:
  platform: hass_agent_mediaplayer
  name: "hass.agent test mediaplayer"
  host: 192.168.1.2

Are there any errors in HA’s logs? You could try enabling debug logging by adding this to your configuration.yaml:

logger:
  default: warning
  logs:
    custom_components.hass_agent_mediaplayer: debug

I use the Log Viewer addon for easy viewing.

Yay! Very glad it’s fixed! You’re very welcome :smiley:

1 Like

I have browser mod installed but no other media players, nevertheless, I changed my settings to yours to replicate. I install log viewer (thanks for that, before this I never needed to get down into the weeds, will keep this) . I have posted my log below

  File "/config/custom_components/hass_agent_mediaplayer/media_player.py", line 119, in update
    self._volumeLevel = int(response.text)
ValueError: invalid literal for int() with base 10: 'Method Not Implemented: Get /media'

I should add that I am on windows 11 and a beta tester on it.

Ah, did you install the latest beta? Because the stable release doesn’t contain the media component yet:

I uninstalled the one I had installed. It was not the beta, but I reinstalled anyways to see if the issue was just me resetting everything. The one I have now is v2022.11.4

Still the error in the logs:

   result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/hass_agent_mediaplayer/media_player.py", line 119, in update
    self._volumeLevel = int(response.text)
ValueError: invalid literal for int() with base 10: 'Method Not Implemented: Get /media'

Thank you for trying to help but I think there has to be something with my setup. I will keep tinkering around with it and if I find what it is, will definitely post back here.