rroller / dahua

Dahua Camera and Doorbell Home Assistant Integration
MIT License
369 stars 71 forks source link

Button Press doesn't work anymore #358

Open Aspage opened 1 month ago

Aspage commented 1 month ago

Hello!

Ever since (I think) HA 2024.5.x the button press on the doorbell doesn't register anymore. Maybe more isn't working anymore either, but I'm only using the cameras (still works!) and the doorbell press event.

Would be amazing if this could be fixed!

HA: 2024.5.x Doorbell: DHI-VTO3211D-P4-S2

smol84 commented 1 month ago

Also not working for me

smol84 commented 1 month ago

I also enabled debugging as well as monitoring events - nothing coming up at all...

Aspage commented 1 month ago

Did the same thing. Didn't see any events firing after button press.

smol84 commented 1 month ago

Found these errors in the HA log file 2024-05-30 12:58:14.381 WARNING (MainThread) [homeassistant.helpers.frame] Detected that custom integration 'dahua' callsasync_add_job, which is deprecated and will be removed in Home Assistant 2025.4; Please review https://developers.home-assistant.io/blog/2024/03/13/deprecate_add_run_job for replacement options at custom_components/dahua/__init__.py, line 85: hass.async_add_job(, please create a bug report at https://github.com/rroller/dahua/issues 2024-05-30 12:58:14.427 WARNING (MainThread) [homeassistant.components.light] Entity None (<class 'custom_components.dahua.light.DahuaInfraredLight'>) is using deprecated supported features values which will be removed in HA Core 2025.1. Instead it should use <LightEntityFeature: 1> and color modes, please create a bug report at https://github.com/rroller/dahua/issues and reference https://developers.home-assistant.io/blog/2023/12/28/support-feature-magic-numbers-deprecation 2024-05-30 12:58:14.428 WARNING (MainThread) [homeassistant.components.light] None (<class 'custom_components.dahua.light.DahuaInfraredLight'>) does not set supported color modes, this will stop working in Home Assistant Core 2025.3, please create a bug report at https://github.com/rroller/dahua/issues

derekcentrico commented 1 month ago

Anyone get button press working? I'm using an EmpireTech DB2X-WP. Button events not going through. Happy to toss @rroller a coffee to fix. :-)

rroller commented 1 month ago

I'm so sorry everyone. I've been busy and not able to dig into this. I will make it a top priority soon. I'll try for this weekend

derekcentrico commented 1 month ago

Not a problem, I know it's voluntary. Figured a bribe may help.

Events and logs aren't helpful aside from the logs stating that the add-on isn't compliant with recently depreciated and removed Core changes.

I enabled SIP Server on my doorbell. It's pushing events again. Didn't need it before.

lluiscab commented 1 month ago

@derekcentrico Facing the same issue here but my doorbell has always had the SIP server enabled. Did you change anyhing else?

derekcentrico commented 1 month ago

@lluiscab I disabled/cleared the SIP settings (basically a factory reset on device so that cleared) and re-enabled with the SIP server on the local doorbell if that helps. Not sure at which point this made it function but SIP running on the local doorbell makes it work. If I disable it it stops working.

Jumbles123 commented 1 month ago

Can confirm Disabling SIP stops button press from working on mine - VTO2211G-WP. I may be a numpty but in the log when the button is pressed i get "Doorbell Button Pressed detected sound" and then 30 seconds later i get "Doorbell Button Pressed cleared (no sound detected)" Is that normal behavior? I only just got the button press working so am unsure.

derekcentrico commented 1 month ago

Sure, so my log says that as well. The 30 second delay, I think, is related to the SIP calling a home device (theoretically but not happening unless you have those base stations).

CodeMasterTalon commented 1 month ago

Since the change to schedule_update_ha_state the integration is now using a hard fix value of 30 seconds to poll the VTO for any updates. This can be changed by updating SCAN_INTERVAL_SECONDS = timedelta(seconds=30) under init.py. I updated this setting to 2 seconds and the doorbell press works faster. Home Assistance is now polling the doorbell every 2 seconds. The async_schedule_update_ha_state() seems like it was waiting for the doorbell to push a message to home assistance instead of waiting for polling interval to happen.

rroller commented 1 month ago

So far I can't reproduce this. I have a VTO2202F, I press the button and I immediately get a button press event. I do have SIP enabled... image

Testing now with it disabled...

lluiscab commented 1 month ago

After updating to Home Assistant 2024.6.1 (not sure if that had anything to do with it) and restarting the VTO, I'm receiving the button press event again. Regardless of what the real cause for this issue might be, it feels like there's some error checking / reconnecting logic missing from this component in order to handle this kind of issues more smoothly, maybe we could get a "Connection to VTO lost" notification or similar.

rroller commented 1 month ago

Can confirm, the button press doesn't work when SIP is disabled.

rroller commented 1 month ago

https://github.com/rroller/dahua/releases/tag/0.9.55 released to fix a few of the deprecation warnings above. I'm not able to apply a fix for the button press as I've not been able to reproduce the issue yet

Aspage commented 1 month ago

To make things more complicated:

but of course, thanks to rrollerr for this integration! I'm very grateful for it!

JoshDev commented 1 month ago

Could this be related to - https://github.com/rroller/dahua/issues/230

I.e. Dahua disabled the button presses on their end with a firmware upgrade?

Aspage commented 1 month ago

Guys, I don't know about you, but after installing HA 2024.06.2 or 2024.06.03 (I installed them at the same time, so not sure which one), I suddenly get buttonpress-events again!

For me, the problem seems to be solved! Was an HA issue afterall, it seems.

Can anybody confirm?

derekcentrico commented 1 month ago

Guys, I don't know about you, but after installing HA 2024.06.2 or 2024.06.03 (I installed them at the same time, so not sure which one), I suddenly get buttonpress-events again!

For me, the problem seems to be solved! Was an HA issue afterall, it seems.

Can anybody confirm?

Still borked on my install. See my post above yours.

Aspage commented 1 month ago

Guys, I don't know about you, but after installing HA 2024.06.2 or 2024.06.03 (I installed them at the same time, so not sure which one), I suddenly get buttonpress-events again! For me, the problem seems to be solved! Was an HA issue afterall, it seems. Can anybody confirm?

Still borked on my install. See my post above yours.

That post was from 2 weeks ago. Did you upgrade your HA to the latest 2024.6.3? That's what apparently fixed it for me.

smol84 commented 3 weeks ago

I updated and still not working. Gobe back to the dahua vto integration instead which isn't as good but at least it works with button press