core icon indicating copy to clipboard operation
core copied to clipboard

nest_event triggers on end, not on start of DoorbellChime event thread (20s delay)

Open mfrassl opened this issue 2 years ago • 29 comments

The problem

After pressing the door bell button, it takes a couple of seconds for the event to fire.

Looking at the nest integration debug data, I noticed that the nest_event fires on the 'eventThreadState': 'ENDED' event, and not on the 'eventThreadState': 'STARTED' event. Not sure if this is by design, but I would say it is unexpected for a doorbell.

In the example logs below, it took 20s between pressing the dorr bell button and receiving the nest_event in home assistant.

I'm using a Nest Doorbell (battery), which is connected to power.

What version of Home Assistant Core has the issue?

2023.2.0

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

nest

Link to integration documentation on our website

No response

Diagnostics information

home-assistant_nest_2023-01-28T20-02-59.234Z.log

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

mfrassl avatar Feb 03 '23 02:02 mfrassl

It's much faster if the camera is triggered by motion before pressing the button. My testing yesterday was just pressing the button, without being in the view of the camera.

mfrassl avatar Feb 04 '23 02:02 mfrassl

Hey there @allenporter, mind taking a look at this issue as it has been labeled with an integration (nest) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of nest can trigger bot actions by commenting:

  • @home-assistant close Closes the issue.
  • @home-assistant rename Awesome new title Change the title of the issue.
  • @home-assistant reopen Reopen the issue.
  • @home-assistant unassign nest Removes the current integration label and assignees on the issue, add the integration domain after the command.

(message by CodeOwnersMention)


nest documentation nest source (message by IssueLinks)

home-assistant[bot] avatar Feb 13 '23 16:02 home-assistant[bot]

There was a change made because of the opposite problem: notifications before event media was ready and users getting broken notifications. That is, notification will fire as soon as media is available.

Agree we need some changes here. I think the main problem is we need to separate these things so media may be separate from events or there is a way to tell if the event has media or not etc

allenporter avatar Feb 13 '23 16:02 allenporter

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

I guess the new event entity might also be applicable here.

dynasticorpheus avatar Jul 28 '23 05:07 dynasticorpheus

Nest events can definitely migrate to the new event entity. Maybe it's a good chance to introduce new types at the same time.

allenporter avatar Jul 28 '23 19:07 allenporter

Just wanted to share my temporary workaround to bypass the delay as this might be of help to others as well. Exposed my external chime (switch) to google assistant component and created an automation script on home.google.com using device.event.DoorbellPress to trigger it.

edit: @n00bcodr updated above as to not further spam this issue

dynasticorpheus avatar Aug 07 '23 06:08 dynasticorpheus

@dynasticorpheus can you please give more details about your workaround?

n00bcodr avatar Aug 07 '23 10:08 n00bcodr

Is there any hope for this getting better? 20 sec is long long time to wait for the ring.....

anordnes avatar Sep 06 '23 21:09 anordnes

Yeah I'm playing around with moving these to a new event entity and separating the doorbell press event from the media arrived event.

I want to make sure to think this through to not mess it up and make it easy to use...

allenporter avatar Sep 07 '23 02:09 allenporter

20 seconds sounds much longer than I expected fwiw. If you have disgosttthst could be useful to understand.

allenporter avatar Sep 07 '23 02:09 allenporter

I am thinking through how the events should look:

  • doorbell pressed (no media)
  • "doorbell media"? "Press ended"?

Also want a generic design that works for camera and motion events too. However I think those may not need two separate events since they are only about media...

allenporter avatar Sep 07 '23 02:09 allenporter

20 seconds sounds much longer than I expected fwiw. If you have disgosttthst could be useful to understand.

Love to help. Not sure about disgosttthst…. What do you need me to share?

anordnes avatar Sep 07 '23 04:09 anordnes

Sorry hah, was on mobile... should have been "Diagnostics"

allenporter avatar Sep 07 '23 06:09 allenporter

Im at work now. Will share something later.

anordnes avatar Sep 07 '23 06:09 anordnes

@allenporter Will there be any update on this . Over 20 seconds delay for the sonos chime is not good

anordnes avatar Oct 09 '23 14:10 anordnes

@anordnes I've made a prototype of an event entity and I think its a matter of settling on the API now.

The main issue is how to best signal events that have media vs events that do not, and how multiple events for the same "occurrence" are handled -- e.g. one event with no media, one event with media, how do you tell the difference, etc.

I was thinking something like an "event_started" that doesn't necessarily contain media and "event_ended" that does contain media, or something like that.

allenporter avatar Oct 09 '23 15:10 allenporter

Just want to share a workaround. Create a helper, an input.boolean. Expose this to google assitent in the voiceassistents settings in HA. In the google Home app, Add/update entities from home assistant i and choose the input.boolean. Create a new automation in google home when doorbell pushed set input.boolean to on. Then create an automation in HA with input.boolean as a trigger, play a sound or blink the light or someting, and let the automation wait 30 second before turning off the input.boolean. If you turn it off too soon the automation will trigger again. (Maybe for the same reason that HA delays the event?)

anordnes avatar Oct 20 '23 14:10 anordnes

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

I think this is still to be solved whenever time and energy allows

dynasticorpheus avatar Jan 25 '24 20:01 dynasticorpheus

Agreed, this still is important and worth resolving with a new event entity.

allenporter avatar Jan 26 '24 03:01 allenporter

@anordnes thanks so much for that suggestion. That makes all the difference in the world; it makes using HA with the Nest Doorbell from unusable to usable; it's very fast now, even faster than the Google Home Notification itself.

bviolier avatar Jan 27 '24 09:01 bviolier

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

gently but hopefully keeping this alive, when the universe has time!

dynasticorpheus avatar Apr 26 '24 16:04 dynasticorpheus

Agreed, still important.

allenporter avatar Apr 27 '24 03:04 allenporter

No it does not belong here. Please file a separate issue or post in community forums for support.

allenporter avatar Jul 08 '24 16:07 allenporter

The solution from @anordnes works well! WAF achieved! :) Thanks.

corvy avatar Jul 16 '24 08:07 corvy

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

I think event platform was introduced to resolve this issue hence my comment to keep this open.

dynasticorpheus avatar Oct 14 '24 11:10 dynasticorpheus

Yes, forgot to close this out. The event platform now gives instant doorbell events, without waiting for media to be fetched. See https://www.home-assistant.io/integrations/nest/#event for documentation.

This should now be complete.

allenporter avatar Oct 14 '24 14:10 allenporter