In the debug there is also this WSS:178.5.65.253
what is this IP address?
From the debug, I have the impression that the registration of the PC/Tablet where the lovelace is running is not working.
Apart from that, I don’t see anything weird.
Hi, the WSS:178.5.65.253 ist the external IP Adress of my dynamic DNS Domain Name. I have tried both, local IP and the dynamic DNS Domain Name as sip server in config. Yes i think the doorpi-card does not register correct but i dont know why. In the browser dev console i see :
4doordroid-card.js:108 SIPPhone registered with SIP Server
doordroid-card.js:94 Loading SIPPhone
doordroid-card.js:163 initialized camera view
doordroid-card.js:108 SIPPhon
I am testing the lovelace doorpi-card from my windows 10 Laptop with chrome browser at the moment. Is there anything that i did forget ?
WSS is using TLS and can be picky about the certificate. You have to make sure that the certificate is accepted for the hostname/IP address you are using. If on your PC where lovelace is running you go to the WSS address you have configured in the card, does it work? It should raised an exception about the certificate that you have to approve.
Good Morning, yes i think so. I have installed the NGINX Home Assistant SSL Proxy and the Letsencrypt Plugin. I use the same certificates for Homeassasistant and Asterisk (FreePBX) Config. If i go to my Homeassistant or my WSS URL, it shows me the SSL Lock Icon in the Browser :
Hello I am having some trouble getting everything to work.
I have a Dahua VTO6221E-P to use as outside station unit.
I have HA running on raspi4. I have another raspi4 running freePBX. I have managed to connect the VTO unit to asterisk server on the freepbx. I can make calls between my pc(running microSIP) and the dahua VTO unit. I also tried making calls from my phone (android) running GS Wave to both Dahua VTO unit and the PC. These all seem to work fine.
I am having these issues. Any insight would be much appreciated.
- I am having trouble getting the HA part of it working. I have created a new certificate on freepbx using certificate manager and have added it to my computers trusted certificates. But have no luck with webRTC.
I have 4 extensions in asterisk (PC, phone, VTO unit + HA webtrc). They are all working unless I try to connect using webRTC. My chan_pjsip settings are as follows:
I tried connecting to the asterisk from browser using ctxSip - Javascript SIP client but I get this errors.
[2021-06-21 12:31:43] ERROR[19112] iostream.c: Problem setting up ssl connection: error:00000001:lib(0):func(0):reason(1), Internal SSL error
[2021-06-21 12:31:43] ERROR[19112] tcptls.c: Unable to set up ssl connection with peer '192.168.2.37:3614'
[2021-06-21 12:31:43] ERROR[19112] iostream.c: SSL_shutdown() failed: error:00000001:lib(0):func(0):reason(1), Internal SSL error
[2021-06-21 12:31:43] VERBOSE[19113] res_http_websocket.c: WebSocket connection from '192.168.2.37:27652' for protocol 'sip' accepted using version '13'
[2021-06-21 12:31:43] NOTICE[19113] chan_sip.c: Registration from '"WebRTC" <sip:[email protected]>' failed for '192.168.2.37:27652' - Wrong password
- I can’t get the door droid card working
I have placed both files on the HA and added them.
I am getting this error:
here is the card yaml I am using.
type: 'custom:doordroid-card'
title: DoorDroid
I am thinking that once I have the card working on HA it would be easier to start troubleshooting the webRTC connection(maybe?).
Edit: I can’t post multiple pictures so here an imgur link with relevant screenshots.
Webrtc requires WSS which in turn requires a valid certificate. You must use a DNS name and not an IP address for that. Is that what you are doing?
This is a rather common message from HA. Something in the config is not correct: file name, file location, resources file… If you search for custom element doesn't exist
on the forum you will find plenty of cases with things to look at.
No, I am trying to get it working on my local network, so I am using wss://192.168.2.111:8089/ws . Does this mean I have to have a local DNS server? I created the certificate and added it to my local machine as trusted, but am still using the IP address. I tried editing my host file but it wont even attempt a connection looking at the logs.
Have DNS resolver are you using and can it be kept all local?
AFAIK, you can’t have at the same time a valid cert (required by webrtc/WSS) and use IP address. So somehow, you must use a name. So, a local DNS or another way (host file) to do the job. As I am using pihole on my network, I did it with this tool.
Hi, have a look in the Code of “doordroid-card.js”. At the Last line there is the real name you have to call your custom Card : customElements.define('doorpi-card', DoorPiCard);
or customElements.define('doordroid-card', DoorDroidCard);
Cheers
Sascha
Tnx I have actually managed to get the card working. The only issue was to get HA to reload file changes. Deleting the resource from the UI and then adding it again. Then restarting the server and hard reloading seems to work? Is there easier way to reflect changes? I can’t find the reload resources button behind 3 dots.
I have installed pihole on docker and dns seems to works. The issue now seems to be my self signed certificate. Tnx for your help so far. Will spend more time on it this weekend.
I managed to get a certificate from lets encrypt to external domain and used local dns (pihole) to point to the freepbx on my local network, so all that is working now. I can place a call to the HA view but so far can’t answer it or reject it and have to wait until it times out. Still trying to figure out if the issue is with HA or webrtc in general.
Restarting HA will do. But, more importantly, clearing the cache of your browser. And reload.
When receiving the call, the card should turn on an input_boolean in HA. And a button should appear on the card. Is that the case?
Yeah the buttons appear but clicking them results in nothing so far. Multiple clicking shows error in the console about state undefined or something. I am still trying to figure out what is going on.
Clicking answer or decline once results in no action and eventually the call just times out.
Have you declared the two input_boolean on HA side? It looks like they are not in the config hence the state undefined
oh I have not done that. I have checked the logs on asterisk and found that accepting or rejecting call is not calling the asterisk server at all. Will try and set the input_boolean on HA and test. I feel like I am so close, tnx for guiding me though the process though! Much appreciated.
Edit: turns out it is not the input boolean in HA. The error is in this part:
acceptCallBtn.addEventListener('click', () => {
session.answer(callOptions);
});
the session.answer function just hangs and never completes looks like.
Edit 2:
So I changed around the code to isolate the issue I am having. I completely removed the camera view for now and the JSSIP registers with asterisk fine. I can call it from other devices but still cant answer. I tried placing a call from webrtc to other devices and it is not working either.
I also tried testing webrtc extension from another computer using microSIP and call works fine there.
Looking at the asterisk log, the only activity I originating from webrtc is registering with the server. No other action originating from webrtc is being sent to the asterisk it looks like.
here is the config I am using
sip_settings:
sip_password: password11
sip_server: my_domain
sip_username: '202'
sip_wss_url: 'wss://my_domain:8089/ws'
type: 'custom:doordroid-card'
title: Doorbell card
Edit 3:
I can now answer and reject calls. Turns out my HA certificate was not trusted and connection wasn’t being made. Accepting the call now leads to this error in console.
cause: "WebRTC Error"
message: null
originator: "system"
I finally managed to get it working. The problem was the extension configuration. After I deleted the webrtc extension and made a new one it started working.
@greengolfer thank you so much for the help man! much appreciated.
Great that is now working for you. Mine works too now. The only Problem is, that it is not working correctly with the HA Companion App under Android. There, the Audio is not working. Can somebody confirm that ? It would be great if we can use the Companion App on mobile phone to talk to the Door. Or do you guys use the Door Intercom only from a Tablet inside the house ? Sure outside i can use a normal SIP Softphone App or something, but then i have only voice and no Cam picture. How do you think about it ?
I don’t know if the HA Companion app implements a webrtc client. I suspect not… So, on your phone, you can (or have to) use eg. chrome that has webrtc available. This works. I am using it.
Ah okay, i thougt it was an gerenell Problem with the use of the Microphone because on both cards, doorpi-card and doordroid-card, it dont work. I thought one use SIP and one use WebRTC. But yes both cards use WebRTC right ?