Two-way audio and doorbell with 2N intercom systems #1243
Replies: 3 comments 5 replies
-
Thank you so much for figuring all of this out. Small point for 2N IP Verso, which can have a full keypad installed. Enter "%1" as the KeyPressed event to action on the (first) doorbell button only. |
Beta Was this translation helpful? Give feedback.
-
If I change the IP Verso 2.0 to doorbell in scrypted Onvif plugin, the HomeKit extension says the camera can’t be exposed to HomeKit anymore. Is there a trick to do that anyway? |
Beta Was this translation helpful? Give feedback.
-
Hi, thanks for this write-up. I've gone through the steps but it's not exactly working; I need to ask a few questions to get some context, since I am new to Scrypted.
Thanks in advance! |
Beta Was this translation helpful? Give feedback.
-
Instructions to set up Scrypted with an 2N intercom (e.g. IP Solo, IP Vario) supporting two-way audio and doorbell functionality.
Make sure your 2N device is on the latest firmware. Earlier firmwares had issues with ONVIF not completely working and video feeds randomly freezing (required device restart). Since version 2.35 some of the necessary features such as ONVIF, automations and custom sounds no longer require an additional Gold license.
ONVIF two way-audio
Log in to your 2N device. First we need to configure some intercom streaming settings so that two-way audio works.
In the "Services", click "Streaming".
Expand the "Transmission Quality Settings" section
Expand the "Fixed Streaming Profiles" section
In Scrypted, install the
@scrypted/onvif
plugin if you don't already have itOpen the "ONVIF Camera Plugin" and click "Add New" to add the 2N intercom. Fill in all the relevant details including the account username/password as configured in the 2N streaming settings.
Once the device is created, make sure "Two Way Audio" is checked (it should be by default). Unfortunately this device doesn't support ONVIF doorbell events so we'll need to set up a manual webhook for doorbells later on.
Next we need to configure the streams. It's been observed that some 2N devices may put the MJPEG stream in
PROFILE1
and H.264 stream inPROFILE2
which will cause issues when trying to use it with HomeKit.To figure out which stream we want, click "Streams" and then enable all 3 profiles as prebuffered streams and save.
Then click between all the different streams and find the one that has a "Detected Video/Audio Codecs" as
h264/pcm_mulaw
which is fully compatible with HomeKit without transcoding.It may be most likely
PROFILE1
orPROFILE2
(you may also have multiple profiles, it doesn't matter we just need one).After confirming which profile you need, go back to the "Manage" tab and deselect all the other profiles for "Prebuffered Streams" and set everything to your desired profile and save.
Then switch back to your desired profile and change the "RTSP Parser" to "Scrypted (UDP)". Without changing this the audio stream won't work correctly.
At this point the device should work perfectly as a camera with two-way audio. The next step is to make it a doorbell.
Doorbell
We should first change the device type from "Camera" to "Doorbell" in the "Edit" tab and save. This will allow it to appear as a doorbell in HomeKit later.
Install the
@scrypted/webhook
and@scrypted/dummy-switch
plugins if you don't already have it.Open the "Dummy Switch Plugin" and click "Add New" to create a new dummy switch. Name it appropriately.
Change the "Reset Sensor" to "1" and save as we want this switch to behave like a button which gets toggled on and then off automatically from the button press on the 2N intercom.
Under "Extensions", enable the "Webhook" plugin so we can create a webhook that we can trigger from the 2N intercom.
In the "Webhook" tab, click the "Create webhook" dropdown and select "OnOff" as we want to create a webhook that can turn on the switch. Click "Save".
To find the created webhook URL, click on the "Console" button
In the console section that expands, make a note of the "Insecure Local Base URL". (You can copy this the whole output using the "Copy" button in the header, then paste into a text editor to copy the URL directly)
In my case it is
http://192.168.1.2:11080/endpoint/@scrypted/webhook/public/84/853dcf676198c598
. Because we'll want to trigger this "switch" to turn on from the button press, we will want to call/turnOn
.The combined URL becomes
http://192.168.1.2:11080/endpoint/@scrypted/webhook/public/84/853dcf676198c598/turnOn
. Record this somewhere since we'll need it later to configure in the 2N automation.Then go back to the ONVIF device we previously set up, click on "Extensions" and enable "Custom Doorbell Button"
Click on the "Custom Doorbell Button" tab and select the dummy switch we just created, and save.
Now we need to set up the 2N intercom to trigger the Scrypted switch via the webhook.
(Since we'll be using the call button to trigger the doorbell now, clear any existing SIP calling user you may have set up for the main unit button)
In the "Services" and "Automation" menu, click the "Edit" button on an function that's not being used.
Drag the "KeyPressed" event (which is used to catch the button press event), "SendHttpRequest" action (to send the webhook call) and "PlayUserSound" action (to play a doorbell sound) options to the work area. Connect the "Event" from the "KeyPressed" to the "SendHttpRequest" and "PlayUserSound" events.
In the "SendHttpRequest" box, paste the Scrypted webhook URL we previously saved (make sure it has the
/turnOn
at the end).In the "PlayUserSound" box, set the sound you want to play when someone clicks on the button (because the traditional SIP calling sound won't be triggered). In my case I uploaded a custom user sound so I can enter in
1
for the first custom user sound. You can also set*1
for a built-in ringtone. See 2N documentation for more information.Name the function and save it.
Enable the function and save. Make sure it is "Running"
Because we've disabled the SIP calling functionality, by default pressing the main unit button will trigger a dialling error sound (which will be played on top of the custom sound we defined in the automation).
We can disable this in the "User Sounds" menu. Change the "Dialing Error Signaling" to "Silence" and save.
Add to HomeKit
Now that everything is set up. Go back to Scrypted and the ONVIF camera device. In the "Extensions" tab, enable "HomeKit". Then click on the "HomeKit" tab, then "Pairing" and scan the QR code with your iOS device.
If a QR code doesn't appear, the HomeKit plugin takes a while to initialize a new device so refresh after a few seconds.
Test two-way audio and pressing the 2N intercom should trigger a doorbell notification.
Switch relay control
If you have a electromagnetic door/gate strike attached to the 2N intercom as a switch relay, you can use my homebridge-2n-helios-switch Homebridge plugin to unlock/lock the switch in HomeKit.
Beta Was this translation helpful? Give feedback.
All reactions