Closed felipecrs closed 1 month ago
This is the only event that fires in such case:
--myboundary
Content-Type: text/plain
Content-Length: 74
Code=SIPRegisterResult;action=Pulse;index=0;data={
"Success" : false
}
--myboundary
At least it appears to be consistent.
According to my tests, the same event is not triggered when SIP is connected normally.
I think it's a good idea to also check for this event to consider the doorbell button pressed. @rroller, what do you think?
@felipecrs if you need all events from Dahua VTO including doorbell button press, you can try my integration which is just about events and commands, it's should works without active SIP connection.
Hi @myhomeiot, that is really helpful. Thank you.
But I have some automations based on this integration and would prefer not to change it.
I believe this is just a corner case that can be fixed by adding one extra condition here:
@felipecrs It's already check the BackKeyLight
code which generated if someone press the doorbell button, so it's should work.
You can check if your VTO sends this event without SIP server setup.
You can check if your VTO sends this event without SIP server setup.
Isn't this what I did?
This is the only event that fires in such case:
--myboundary Content-Type: text/plain Content-Length: 74 Code=SIPRegisterResult;action=Pulse;index=0;data={ "Success" : false } --myboundary
At least it appears to be consistent.
I was using the following command:
curl -s --digest -u admin:$DAHUA_PASSWORD "http://192.168.1.203/cgi-bin/eventManager.cgi?action=attach&codes=[All]&heartbeat=5"
Also, if the VTO was sending out the BackKeyLight
code event I suppose the button press sensor would be working.
Please let me know if I did something wrong.
I was using the following command:
I check events from my VTO using this command and it's doesn't show any BackKeyLight
events at all, I think this is a limitation of eventManager.cgi HTTP. But this integration definitely receives it using DHIP connection. The question is if it's still generated when no active SIP connection.
Oh, I see. Do you know of an easy way to subscribe to all events, including these BackKeyLight
, so that I can test here?
Oh, I see. Do you know of an easy way to subscribe to all events, including these
BackKeyLight
, so that I can test here?
I think the simplest way will be installing my integration (it's can work in parallel with this integration) and check all coming dahua_vto
events from Developer Tools->Events or by this simple automation Dahua VTO All Events
Sounds good. I will report back once I have the data for this test. Thank you!
I sitll have this issue, anyone else?
I sitll have this issue, anyone else?
Also when the doorbell is disconnected from SIP?
Ok, @myhomeiot I finished testing events using your integration. The result is:
The SIPRegisterResult
is just fired from time to time, I guess it's the VTO attempting to connect to the SIP server.
This means the VTO is useless when not connected to a SIP server and nothing can be done to capture the button press in such case, I think, therefore I am closing this issue.
However, it is not very difficult to run the Asterisk add-on to have a SIP server the doorbell can connect to. That's what I do.
@felipecrs Thanks for the update! Can you try to use VTO local SIP server if you have this option?
This is what I was trying first. Same results. No event emitted. And immediately after pressing the button the doorbell says "The call was not answered". Which is the same as when the doorbell is not connected to SIP.
I think for this option to work, it needs a VTH connected. Or some extension connected to the VTO SIP Server so the VTO can call it.
@felipecrs I am really interested in your efforts to integrate the Dahua VTOs with HA and am already really impressed with your progress.
This said I am struggling to understand the issue you are having with capturing the button presses. While I am not using @myhomeiot integration right now (may switch if need be), since it was predated by https://github.com/rroller/dahua which worked as well, there is really no issue in getting the button presses into HA.
It may be that I am missing some important detail here. If you could please explain, maybe we can figure it out.
BTW, my SIP is also set up to be enabled on device and I don't have a Dahua VTH panel, nor any panel for this matter. Just using the VTO as a camera and a dumb doorbell ringer.
@convicte, this is surprising to me. Can you please share some more details?
What did you fill in this page exactly?
What number is the VTO configured to call? Default is 9901 I think.
What does the VTO say (voice prompt) when you press the button? Is it "Calling now"?
And finally, you mean the binary_sensor.button_press is working normally for you when using the built-in SIP Server and no VTH?
Maybe it has something to do with firmware version. I am using latest from Dahua website,
DHI-VTO2202F-P-S2 4.600.0000000.0.R,build:2022-08-13
Or maybe my model behaves differently than yours.
I have a VTO2202F-P-S2, and I am building a guide to make it work with Home Assistant without the VTH or the Cloud services.
Everything works great, including the button press sensor of this integration.
However, if I disconnect the SIP server, the button press sensor no longer changes/fires. Which is sad for me because this means I need a full-blown Asterisk server just for this.
So, I wonder if there's any alternative.
I will try capturing the event logs later.