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

Notifications from HA are not working for me #2

Closed
danielbrunt57 opened this issue Dec 21, 2021 · 15 comments
Closed

Notifications from HA are not working for me #2

danielbrunt57 opened this issue Dec 21, 2021 · 15 comments

Comments

@danielbrunt57
Copy link

Installation and configuration was straightforward and everything seems fine. I created two sensors in Hass Agent and they are visible and working in HA via MQTT but when I run notify.windows_11_hass_agent nothing happens in my Windows 11.

image

image

image

image

image

@LAB02-Admin
Copy link
Member

Just to get the basics out of the way:

  • Did you create a firewall rule during onboarding?
    • Otherwise you can run netsh advfirewall firewall add rule name="HASS.Agent Notifier" dir=in action=allow protocol=TCP localport=5115 from an elevated command prompt
  • Is HASS.Agent not hidden in the systray overflow (in other words, is the tray icon visible next to the clock)?
    • If not, you can drag the icon there
  • Are there any errors visible in Home Assistant's log?
  • Are there any errors visible in HASS.Agent's logs (subfolder 'Logs', if you used the installer it's %appdata%\LAB02 Research\HASS.Agent\Logs)

@danielbrunt57
Copy link
Author

danielbrunt57 commented Dec 21, 2021

I did allow it to create a firewall rule even though my Windows firewall is disabled...
image
Hass Agent is visible in systray:
image
No errors in HA.
No errors in Hass.Agent Logs:

2021-12-20 22:17:57.894 -08:00 [INF] [SYSTEM] Application shutdown complete
2021-12-20 22:18:07.327 -08:00 [INF] [LOG] Coderr exception reporting disabled
2021-12-20 22:18:07.328 -08:00 [INF] [PROGRAM] Extended logging disabled
2021-12-20 22:18:07.575 -08:00 [INF] [SETTINGS] Config storage path: C:\Users\Daniel\AppData\Roaming\LAB02 Research\HASS.Agent\Config
2021-12-20 22:18:07.687 -08:00 [INF] [SETTINGS] Configuration loaded
2021-12-20 22:18:07.698 -08:00 [INF] [SETTINGS_QUICKACTIONS] Loaded 0 entities
2021-12-20 22:18:07.716 -08:00 [INF] [SETTINGS_COMMANDS] Loaded 1 entities
2021-12-20 22:18:07.723 -08:00 [INF] [SETTINGS_SENSORS] Loaded 2 entities
2021-12-20 22:18:07.727 -08:00 [INF] [NOTIFIER] Initializing local API ..
2021-12-20 22:18:07.737 -08:00 [INF] [MQTT] Connecting ..
2021-12-20 22:18:07.776 -08:00 [INF] [HOTKEY] Completed bind for global quickaction hotkey
2021-12-20 22:18:07.815 -08:00 [INF] [HASS_API] Home Assistant version: 2021.12.3
2021-12-20 22:18:07.827 -08:00 [INF] [MQTT] Connected
2021-12-20 22:18:08.058 -08:00 [INF] [NOTIFIER] API listening on port 5115
2021-12-20 22:18:08.328 -08:00 [INF] [HASS_API] System connected with https://edited
2021-12-20 22:18:09.951 -08:00 [INF] [MQTT] Initial registration completed
2021-12-20 22:28:07.385 -08:00 [INF] [SENSORS] Modified sensor: LastActive
2021-12-20 22:28:07.556 -08:00 [INF] [SENSORS] Modified sensor: SessionState
2021-12-20 22:28:07.579 -08:00 [INF] [SETTINGS_SENSORS] Stored 2 entities
2021-12-20 22:41:42.524 -08:00 [INF] [SENSORS] Modified sensor: LastActive
2021-12-20 22:41:42.691 -08:00 [INF] [SENSORS] Modified sensor: SessionState
2021-12-20 22:41:42.692 -08:00 [INF] [SETTINGS_SENSORS] Stored 2 entities

@LAB02-Admin
Copy link
Member

LAB02-Admin commented Dec 21, 2021

Hm, okay. Seems like you connect to Home Assistant through the duckdns.org address (I removed it from your message for privacy reasons). Is Home Assistant on the same network as your PC? If there's a router/firewall between, it could be dropping the connection.

Did you manually disable your firewall, or did your antivirus did that? Some antivirus software override Windows firewall, for instance ESET.

If you have the Terminal & SSH addon installed, you can try to ping your IP from there using ping 192.168.1.64:

image

@danielbrunt57
Copy link
Author

danielbrunt57 commented Dec 21, 2021

Windows Firewall is definitely disabled. Yes ping works; I do network support for a living!
I only use Windows Defender AV.
***.duckdns.org resolves to my local IP as I run my own PowerDNS server and has a local DNS zone for it.

I tried increasing logging level for hass_agent_notifier but nothing appears from it in the HA log...

logger:
  default: warn
  logs:
    custom_compnents.hass_agent_notifier: debug
2021-12-21 01:41:01 WARNING (SyncWorker_4) [homeassistant.loader] We found a custom integration sonoff which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2021-12-21 01:41:01 WARNING (SyncWorker_2) [homeassistant.loader] We found a custom integration o365 which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2021-12-21 01:41:01 WARNING (SyncWorker_3) [homeassistant.loader] We found a custom integration hass_agent_notifier which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2021-12-21 01:41:01 WARNING (SyncWorker_7) [homeassistant.loader] We found a custom integration homeseer which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2021-12-21 01:41:01 WARNING (SyncWorker_1) [homeassistant.loader] We found a custom integration alexa_media which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2021-12-21 01:41:34 WARNING (MainThread) [androidtv.adb_manager.adb_manager_async] Couldn't connect to 192.168.1.91:5555. TcpTimeoutException: Connecting to 192.168.1.91:5555 timed out (1.0 seconds)
2021-12-21 01:41:34 WARNING (MainThread) [homeassistant.components.androidtv.media_player] Could not connect to Bedroom TV at 192.168.1.91:5555 using Python ADB implementation with adbkey='/config/.storage/androidtv_adbkey'
2021-12-21 01:41:34 WARNING (MainThread) [homeassistant.components.media_player] Platform androidtv not ready yet: None; Retrying in background in 30 seconds
2021-12-21 01:41:34 ERROR (MainThread) [frontend.js.latest.202112200] https://***.duckdns.org/hacsfiles/custom-ui/custom-ui.js:219:9 Uncaught TypeError: Cannot read properties of undefined (reading 'state')
2021-12-21 01:41:34 ERROR (MainThread) [frontend.js.latest.202112200] https://***.duckdns.org/hacsfiles/custom-ui/custom-ui.js:219:9 Uncaught TypeError: Cannot read properties of undefined (reading 'state')
2021-12-21 01:41:34 ERROR (MainThread) [frontend.js.latest.202112200] https://***.duckdns.org/hacsfiles/custom-ui/custom-ui.js:219:9 Uncaught TypeError: Cannot read properties of undefined (reading 'state')
2021-12-21 01:41:34 ERROR (MainThread) [frontend.js.latest.202112200] https://***.duckdns.org/hacsfiles/custom-ui/custom-ui.js:219:9 Uncaught TypeError: Cannot read properties of undefined (reading 'state')
2021-12-21 01:41:34 ERROR (MainThread) [frontend.js.latest.202112200] https://***.duckdns.org/hacsfiles/custom-ui/custom-ui.js:219:9 Uncaught TypeError: Cannot read properties of undefined (reading 'state')
2021-12-21 01:41:34 ERROR (MainThread) [frontend.js.latest.202112200] https://***.duckdns.org/hacsfiles/custom-ui/custom-ui.js:219:9 Uncaught TypeError: Cannot read properties of undefined (reading 'state')
2021-12-21 01:41:34 ERROR (MainThread) [frontend.js.latest.202112200] https://***.duckdns.org/hacsfiles/custom-ui/custom-ui.js:219:9 Uncaught TypeError: Cannot read properties of undefined (reading 'state')
2021-12-21 01:41:36 ERROR (MainThread) [frontend.js.latest.202112200] https://***.duckdns.org/hacsfiles/custom-ui/custom-ui.js:219:9 Uncaught TypeError: Cannot read properties of undefined (reading 'state')
2021-12-21 01:41:36 ERROR (MainThread) [frontend.js.latest.202112200] https://***.duckdns.org/hacsfiles/custom-ui/custom-ui.js:219:9 Uncaught TypeError: Cannot read properties of undefined (reading 'state')
2021-12-21 01:41:36 ERROR (MainThread) [frontend.js.latest.202112200] https://***.duckdns.org/hacsfiles/custom-ui/custom-ui.js:219:9 Uncaught TypeError: Cannot read properties of undefined (reading 'state')
2021-12-21 01:41:36 WARNING (MainThread) [homeassistant.components.sensor] Setup of sensor platform mqtt is taking over 10 seconds.
2021-12-21 01:41:36 WARNING (MainThread) [homeassistant.components.sensor] Setup of sensor platform command_line is taking over 10 seconds.
2021-12-21 01:41:47 WARNING (MainThread) [homeassistant.setup] Setup of sonoff is taking over 10 seconds.
2021-12-21 01:41:47 WARNING (MainThread) [homeassistant.config_entries] Config entry 'UPnp/IGD' for upnp integration not ready yet; Retrying in background
2021-12-21 01:45:00 WARNING (MainThread) [homeassistant.helpers.template] Template variable warning: 'mappingproxy object' has no attribute 'battery_alert_disabled' when rendering '{%- set show_unavailable = ( states.input_boolean.show_unavailable_batteries.state == 'on' ) %} {%- set high = states('input_number.battery_alert_threshold_max') | float(default=0) %} {%- set low = states('input_number.battery_alert_threshold_min') | float(default=0) %} {%- set ns = namespace(cnt=0) %} {%- for s in expand('group.battery_status') %}
{%- if s.state in ['unknown'] and not (s.attributes.battery_alert_disabled or s.attributes.restored) %}
{%- set ns.cnt = ns.cnt + 1 %}
{%- elif s.state in ['unavailable'] and show_unavailable and not (s.attributes.battery_alert_disabled or s.attributes.restored) %}
{%- set ns.cnt = ns.cnt + 1 %}
{%- else %}
{%- if s.state.lower() in ['low', 'medium', 'high'] %}
{%- if s.state.lower() == 'low' %}
{%- set ns.cnt = ns.cnt + 1 %}
{%- endif %}
{%- elif low < s.state | float(default=0) < high %}
{%- set ns.cnt = ns.cnt + 1 %}
{%- endif %}
{%- endif %}
{%- endfor %} {{ ns.cnt > 0 }}'

@LAB02-Admin
Copy link
Member

I do network support for a living!

Great, good to know, I'll answer accordingly :)

HA changed the way HTTP-based logs should be created in the 2021.12 release. I'll prepare an update for the notifier integration with the new logging enabled, so hopefully we can get some more useful info. I'll let you know when it's ready.

If you want, you could open a browser on another machine on the network and go to http://192.168.1.64:5115. You'll get a HASS.Agent Active message if it's accepting connections, but I think that's not the problem since HASS.Agent logs are all good.

@LAB02-Admin
Copy link
Member

I've updated the integration to reenable all logging. After you've updated and rebooted Home Assistant, whenever you send a message, you should see the following:

Debug Output

@danielbrunt57
Copy link
Author

HASSs.Agent is active:
image
Updated to v2021.12.21 but still nothing in HA logs:

2021-12-21 07:54:05 WARNING (MainThread) [slixmpp.stringprep] Using slower stringprep, consider compiling the faster cython/libidn one.
2021-12-21 07:54:07 WARNING (MainThread) [homeassistant.components.webhook] Received message for unregistered webhook fbceb98ec86148252198351c167ea0e9bb5ba75a204d7a42f0bfaa981cf79e63 from cloud
2021-12-21 07:54:13 WARNING (MainThread) [homeassistant.components.sensor] Setup of sensor platform command_line is taking over 10 seconds.
2021-12-21 07:54:13 WARNING (MainThread) [homeassistant.setup] Setup of coronavirus is taking over 10 seconds.
2021-12-21 07:54:13 ERROR (MainThread) [homeassistant.components.coronavirus] Timeout fetching coronavirus data
2021-12-21 07:54:14 ERROR (MainThread) [custom_components.localtuya.common] [303...340] Connect to 192.168.1.50 failed
Traceback (most recent call last):
File "/config/custom_components/localtuya/common.py", line 141, in _make_connection
self._interface = await pytuya.connect(
File "/config/custom_components/localtuya/pytuya/__init__.py", line 637, in connect
_, protocol = await loop.create_connection(
File "/usr/local/lib/python3.9/asyncio/base_events.py", line 1056, in create_connection
raise exceptions[0]
File "/usr/local/lib/python3.9/asyncio/base_events.py", line 1041, in create_connection
sock = await self._connect_sock(
File "/usr/local/lib/python3.9/asyncio/base_events.py", line 955, in _connect_sock
await self.sock_connect(sock, address)
File "/usr/local/lib/python3.9/asyncio/selector_events.py", line 502, in sock_connect
return await fut
File "/usr/local/lib/python3.9/asyncio/selector_events.py", line 537, in _sock_connect_cb
raise OSError(err, f'Connect call failed {address}')
ConnectionResetError: [Errno 104] Connect call failed ('192.168.1.50', 6668)
2021-12-21 07:54:14 WARNING (MainThread) [homeassistant.setup] Setup of timer is taking over 10 seconds.
2021-12-21 07:54:14 WARNING (MainThread) [homeassistant.setup] Setup of input_select is taking over 10 seconds.
2021-12-21 07:54:14 WARNING (MainThread) [homeassistant.setup] Setup of input_text is taking over 10 seconds.
2021-12-21 07:54:15 WARNING (MainThread) [homeassistant.setup] Setup of input_boolean is taking over 10 seconds.
2021-12-21 07:54:15 WARNING (MainThread) [homeassistant.setup] Setup of input_number is taking over 10 seconds.
2021-12-21 07:54:15 WARNING (MainThread) [homeassistant.components.switch] Setup of switch platform mqtt is taking over 10 seconds.
2021-12-21 07:54:17 WARNING (MainThread) [homeassistant.components.media_player] Setup of media_player platform androidtv is taking over 10 seconds.
2021-12-21 07:54:18 WARNING (MainThread) [homeassistant.components.sensor] Setup of sensor platform sleep_as_android is taking over 10 seconds.
2021-12-21 07:54:26 WARNING (MainThread) [homeassistant.components.webhook] Received message for unregistered webhook fbceb98ec86148252198351c167ea0e9bb5ba75a204d7a42f0bfaa981cf79e63 from cloud
2021-12-21 07:54:44 WARNING (MainThread) [homeassistant.config_entries] Config entry 'UPnp/IGD' for upnp integration not ready yet; Retrying in background
2021-12-21 08:00:00 WARNING (MainThread) [homeassistant.helpers.template] Template variable warning: 'mappingproxy object' has no attribute 'battery_alert_disabled' when rendering '{%- set show_unavailable = ( states.input_boolean.show_unavailable_batteries.state == 'on' ) %} {%- set high = states('input_number.battery_alert_threshold_max') | float(default=0) %} {%- set low = states('input_number.battery_alert_threshold_min') | float(default=0) %} {%- set ns = namespace(cnt=0) %} {%- for s in expand('group.battery_status') %}

Hmmmm, might help if I could spell/type...

custom_compnents.hass_agent_notifier: debug

@danielbrunt57
Copy link
Author

image

Could Windows 11 be the issue?

@LAB02-Admin
Copy link
Member

I'm using W11 as well so should be fine. However, the popups could be blocked. You can check by going to configuration -> system -> notifications, and check if HASS.Agent is allowed to show notifications:

image

@danielbrunt57
Copy link
Author

It wasn't listed, rebooted and still not listed...

image

@danielbrunt57
Copy link
Author

I am troubleshooting this now...

image

@danielbrunt57
Copy link
Author

I've resolved the greyed out issue but HASS.Agent is not listed...

image

https://answers.microsoft.com/en-us/windows/forum/all/notifications-greyed-out-problem-notifications/6b357fc5-1671-4a55-ab18-f062661d968b
#One of the very weird entries I found was "HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\CurrentVersion\PushNotifications" for some odd reason I had NoToastApplicationNotification set to 1. The odd part is that I NEVER turned off notifications. So how that entry got to be placed in there is beyond me.

@LAB02-Admin
Copy link
Member

That's weird :\

Can you try sending another notification? Perhaps (hopefully) it'll get added now.

@danielbrunt57
Copy link
Author

Tried...and it worked!

image

and listed now!

image

@LAB02-Admin
Copy link
Member

Great! Glad you got it working 👍

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

2 participants