imhotep / hass-unifi-access

Unifi Access Integration for Home Assistant
Apache License 2.0
62 stars 15 forks source link

No Longer Logging Doorbell Presses or Exit #42

Closed JDogg016 closed 2 months ago

JDogg016 commented 3 months ago

This is the log I receive

Logger: custom_components.unifi_access.coordinator Source: helpers/update_coordinator.py:318 integration: Unifi Access First occurred: June 22, 2024 at 1:11:10 PM (271 occurrences) Last logged: 10:51:24 AM

Timeout fetching Unifi Access Coordinator data

jasonhollis commented 3 months ago

I'm sure it's a stupid question but what do I need to do to get to the event data for the custom component?

I have

logger: default: info logs: custom_components.unifi_access.coordinator: info

Setup in the config.yaml. But I don't see anything in the main log.
CleanShot 2024-06-25 at 14 50 07@2x If I enable debug logging in the integration I'm also not seeing the event data there either. @JDogg016 as Dogg has mentioned I'm also not getting anything from the G2 Pro doorbell.

CleanShot 2024-06-25 at 14 53 58@2x

JDogg016 commented 2 months ago

Correct. There is nothing in any log when an 'exit_event' occurs. Thus the problem. Until about 1 months ago this worked allowing you to trigger automations on exit_events (as opposed to entry_events)

imhotep commented 2 months ago

@JDogg016 can you share actual logs (ie /config/home-assistant.log)? What you posted seems to be coming from your home assistant front-end. That would require access to your home assistant host via ssh I cannot reproduce the issue in my setup.

JDogg016 commented 2 months ago

When I enable debug logging, I get the following logs when I unlock the door.

2024-07-10 06:41:10.675 INFO (SyncWorker_17) [custom_components.unifi_access.hub] Getting door updates from Unifi Access https://192.168.7.1:12445 Use Polling True 2024-07-10 06:41:10.756 DEBUG (MainThread) [custom_components.unifi_access.coordinator] Finished fetching Unifi Access Coordinator data in 0.080 seconds (success: True)

To be clear. This attribute has not fired since June 8 (even though I go through the door and initiate this event multiple times per day.

image

imhotep commented 2 months ago

@JDogg016 events only work without polling enabled. Do you have polling enabled?

JDogg016 commented 2 months ago

It would seem so, unless there is a different polling option somewhere else.

image

imhotep commented 2 months ago

@JDogg016 I was asking about whether the integration uses polling to fetch data (vs websocket). Home Assistant will pull entities for updates by default. The only way to find out is to remove the integration and add it back (reconfigure it). I may add a Configure screen at some point to enable changing behavior after adding the integration.

jasonhollis commented 2 months ago

It does not look like simply disabling polling sorted me out. I'm getting no notifications now.

imhotep commented 2 months ago

@jasonhollis How did you disable polling? Again if it’s on the screen that @JDogg016 posted, that won’t do anything useful. It has to be done when the integration is initially set up. So you have to remove the integration and add it again. Short of more logs I won’t be able to do much and I can’t reproduce the issue in my setup.

JDogg016 commented 2 months ago

I removed and reloaded the configuration with the same result. No entry/exit logs. No doorbell logs either.

imhotep commented 2 months ago

@JDogg016 again without logs I won’t be able to do much. Please provide those.

JDogg016 commented 2 months ago

This is resolved. My apologies as I misread your prior post and enabled polling when I reinstalled the add-on.

Disabling polling brought the event logging back. You may close the comments if you feel necessary and thank you for your prompt reply.

jasonhollis commented 2 months ago

Team,

My installation is remote. I can easily hit the box via Tailscale, but I can't run around opening doors, so I have to wait for events. I have uninstalled and reinstalled it without polling on. I have not uninstalled HACS. Short of running debug logging from the integration for a long period, how should I configure the logging? I'm assuming that with the proper configuration, I should be able to go to /configs/home-assistant.log?
home-assistant.log custom_components.unifi_access.hub.log

Does this look correct from config.yaml:

logger: default: info logs: custom_components.unifi_access.coordinator: debug custom_components.hacs: info aiogithubapi: info

imhotep commented 2 months ago

@jasonhollis the easiest way is to:

enable logging
jasonhollis commented 2 months ago

I'm not at the location where everything is running, so I can't open the door. I will be over there in a few days. I've just left debug logging on, and this is the file:

I do know that this data will represent several unlocks today. I'm not sure that the doorbell was rung. Hopefully this provides some sort of insight.

custom_components.unifi_access.hub.log

imhotep commented 2 months ago

@jasonhollis it looks like you're not getting any "access.logs.add" (for entry/exits) or "access.remote_view" (doorbell) messages. It will be hard to debug if you're not on site but I could send you a patch in order to get a little more information.

imhotep commented 2 months ago

@jasonhollis closing this one. Feel free to reopen if/when you have more info.