Vivint Doorbell Integration

MAAAAAN, thank you, @wmaker , your work with that helped me A LOT to solve my doorphone problem.
i’ve even forked your repository here: GitHub - augustodinizl/doorvivint-card: Home Assistant Video Doorbell Card for Vivint Doorbell (yeah, i will change name later, since my fork will be used for “generic SIP doorphone”).
Since i’m not using a VIVINT doorphone, i’m using a simple (over an ATA) doorphone, i have one question, my doorphone have two relays, and i’m using that to open two doors…
But my doorphone uses DTMF commands to change that relay states and i couldn´t be able to send that dtmf tones during a call.
Can you please help me to understand where do i place the code to send that DTMF tones?

Good question…I don’t know really as it was not part of the doordroid nor my doorvivint project… would have to do more research to help out. Just taking a quick look, I came across the following, so you can probably take a look at the source code and see if there is something useful.

https://webrtc.github.io/samples/src/content/peerconnection/dtmf/

Note that WebRTC can not generate tones per se, but sends RTP packets to the remote end describing what tones to play. As long as the remote end can understand these packets and generate a tone itself, then you should be able to take some of this sample code and work with it.

thanks for the fast response man, i know that the jssip can send the “tones” to the asterisk and asterisk handles that, my question is: where in the code, i can send that info to asterisk forward it to my doorphone as a dtmf tone

Can this be used for any SIP doorbell or only Vivint? i have a akovox system that i want to try and integrate.

I think you’re asking where specifically in the doorvivint js code does one add support for DTMF generation?..I don’t know really, but using the link I referenced above, one could use the example js code to possible figure it out. Once at the link, use Chrome’s “Inspect” and look at the “Source” tab and navigate you way to the source code, or look at it here:
https://webrtc.github.io/samples/src/content/peerconnection/dtmf/js/main.js

From my original post way above…The DoorVivint lovelace card is for a general purpose SIP Doorbell. The app_rtsp_sip is an Asterisk application that works on a split audio stream where RTSP is used to setup and send audio from the doorbell to app_rtsp_sip, and app_rtsp_sip uses SIP to set up the audio stream in the reverse direction. The only reason its specific to Vivint, is that the SIP code I wrote in app_rtsp_sip was tested against the Vivint Doorbell. It may actually work with another RTSP/SIP based endpoint, but there could be interop issues.

I made a few changes to get it working with my cameras (Reolink and H.VIEW):

Thanks for your work on this!

man, thanks for your help, i got it working… now i’m working on the internationalization of the code, and as soon i can finish it, i will release it as a post here

Not sure who all is in my position, but I have https running on my Home Assistant and prefer to stay with native HA things as much as I can for fear of cool features being abandoned or the author run over a bus, etc. If it helps, great, if not, well no harm done.

First thing is to create a long-lived access token in Home Assistant.
Then I added the following to one of my configuration.yaml files that I ripped off of the dev docs:

template:
  trigger:
    platform: event
    event_type: doorbell_press
  binary_sensor:
    - name: Doorbell recently pressed
      auto_off: 5
      state: "true"

Next, telnet into the doorbell, copy play_sound over to /mnt/flash and it with the following command:

echo -ne "POST /api/events/doorbell_press HTTP/1.1\r\nHost: <HA_FQDN>:8123\r\nAuthorization: Bearer <BEARER_TOKEN_HERE>\r\nContent-Type: application/json\r\nConnection: close\r\n\r\n" | openssl s_client -quiet -connect <HA_FQDN>:8123

This allowed me to do a POST (or GET if needed) with https enabled on HA. Thanks @wmaker for finding the persistence in rcS.d! I now have an automation to send a notification to our phones with the screenshot of the camera when it’s pressed. I also wasn’t too thrilled with having to spin up an entire Asterisk server for a doorbell (also wasn’t having much luck with it anyhow), so my next project will be to throw a raspberry pi at my OnQ Intercom System using mumble or something and just talk to folks through my existing speaker. I may play with sip someday, but for me, this seams like the path of least resistance.

That app_rtsp_sip, looks very interesting…

@wmaker does it still work with latest asterisk versions?

With that app, is it possible to send video to a softphone?

So when the intercom dials an extension, can I add the RTSP so the endpoint (sofphone) can see the rtsp stream?

I haven’t done any work on this in about two years, so I really don’t know.

No.

I don’t know enough about video intercom systems to say.
However, take a look at this issue that someone else was asking about this with intercom systems to see if it helps answer your question.

Yeah, that was me a while ago, I now back busy with this asterisk project :+) I forgot about it…

I created a second issue on your GitHub, can you have a look at it? :slight_smile:

But what I still don’t understand, why can you only see video when you call an extension, and not when you are being called? What’s the difference?

Thnx!!

I have found that not all of the vivint doorbells are the same as seen in the posts on this thread. Mine did not have persistent storage for rcS.d located at /mnt/flash/etc/rcS.d . I have found a simpler way of modifying the bellbutton script permanently though.
I just went into the /usr/bin directory and entered “mount -o rw,remount /”. This remounted the directory as writable. I modified the bellbutton script, and rebooted. I checked and my changes were persistent. The root fs is persistent, but certain directories (such as etc) are temporary. This can be seen in fstab. Hope this helps others as it sorted out my persistence issue very easily.

Just wanted to show my appreciation for this post from airlancet.
I was able to follow the other posts to setup the Home assistant integration (thanks everyone)
The problem being that the suggestions for making the script change survive powercut/reboot wouldn’t work for my Camera. No persistent storage for /mnt/flash/etc/rcS.d

The simple suggestion of making /usr/bin writable, and then modifying the script directly works perfectly after reboot, and is actually much simpler than using the mounting solution.

@wmaker

Can you write a line for me to use that uses a token? I’m using @jarvistek 's method of calling a event, but he uses ssl. There’s a lag, Trying to make the event call, call my ip address locally (non-ssl) instead of going through my domain name.

I’m not sure how to use httpClient in the way you wrote to include the token in a header inside play_sound

Its been a long time, so I don’t really remember the in(s) and out(s) of httpclient. However in my original posting, the httpclient is sending a webhook using http and I have an automation that detects the reception of the webhook. That should work for you as well.

Appreciate you chiming back in after so long, so web hook still works 3 years later? Okay I’ll go ahead and try that route instead. Thanks

Back after about 3 years. My setup was working flawlessly, posting images on an SMB share, it was ringing through my RP4->Google Hub… yeah. It just worked.

Then about three weeks ago my girlfriend knocked the doorbell off the wall… She put it back, but it stopped working. No idea! I’d accidentally power-cycled it before and it came back fine, but this time, it didn’t. Wasn’t connecting to my network, so I factory reset it.

So what I recall (from 3 years ago) was that the device broadcast its own WiFI SSID, I connected to that, and reconfigured it to connect to my router. It’s not doing that anymore. Instead it plays a little recording “Connecting to your Vivint system”… which of course doesn’t work, because I don’t have a Vivint system. Eventually it times out and the LED goes red. If I hold it down again it again announces it’s trying to connect to the Vivint system, but it doesn’t broadcast an SSID and doesn’t attempt to connect to a router that has WPS.

Darnit! I had this thing dialed in and now I can’t even get it onto my WiFi. Any tips?