SIP/VoIP Custom Component for Home Assistant

Hi everyone,

Previously, I shared an ESPHome-based SIP project here. This time, I’ve made a Custom Component version called hass-sip and wanted to share it with the community.

Key Features & What's Working:

  • Make & Receive Calls: Initiate and answer SIP calls directly through Home Assistant.

  • TTS (Text-to-Speech): Send TTS audio over the phone call (great for automated voice alerts).

  • Lovelace Card: A clean UI card to handle calls from your dashboard.

Under Development / Experimental:

  • Voice Assistant Integration: Working on forwarding call audio to Home Assistant's native Voice Assistant (Assist). Note: This part is still experimental and not fully tested yet, but the groundwork is there!

Check out the repository for installation instructions and documentation:

https://github.com/eigger/hass-sip

5 Likes

This looks impressive and promising. Can you quickly clarify one thing: is calling through the companion app or browser possible or planned?

No, that’s not the case. This feature registers Home Assistant (HA) itself as a VoIP phone. This allows HA to call other phones to play TTS announcements, or to answer incoming calls to HA (using TTS, Voice Assistant, or for device control). If you want to use your smartphone as a VoIP phone, you can do so using an app called Zoiper.

1 Like

Finally some progress regarding calling and HA... Even some way to connect it to the Voice Assists :smiley: Only one thing... How should this work? I dialed to a test line, call was up and running and I used the sip start assist action. But then nothing happens. What did I miss there? I have more than one assist device btw. Is that maybe the problem? And yes I am very aware that you wrote about being experimental in your post. I just wonder if I missed some step on my side

I did set it up so that a pipeline connection with Voice Assist is possible, but I haven't been able to test it properly yet, so there might be some issues. I originally built this primarily for TTS purposes. While I did plan to support Voice Assist later on, that part just hasn't been fully tested yet. I will do some testing on my end and get back to you with more feedback.

1 Like

Could you try testing with 1.1.1? I haven't been able to proceed as my basic voice assistant is currently not functioning.

After running sip.start_assist, could you please check if you get a response when you speak into the handset?

They don't seem to react. I wonder which of the assist devices is the right one then. I have a few spread through the house. Maybe one indeed is reacting, but then I did not realize it. I will try later a bit more after I just realized that HACS happily ignored your updates...

Here a log snippet from one of my Voice assistants when I answer a call from your Addin:

13:04:20.945][S][sensor]: 'Heap Max Block' >> 61440 B
[13:04:20.945][S][sensor]: 'Freier PSRAM' >> 3984708 B
[13:04:22.796][W][component:473]: speaker_source.media_player took a long time for an operation (59 ms), max is 50 ms
[13:04:23.034][W][esp-idf:000][md_reader]: D (169152183) micro_decoder.http_client: Connected: status=200 content-type='application/octet-stream'
[13:04:23.036][W][esp-idf:000][md_reader]: I (169152184) micro_decoder.audio_reader: Streaming http://192.168.181.42:8123/api/esphome/ffmpeg_proxy/31c284bcc7c26e51c99a35e901436b36/anqZEJ3sUNVLzN9Ky_yx5w.flac (FLAC)
[13:04:23.167][W][esp-idf:000][md_reader]: D (169152317) micro_decoder.audio_reader: HTTP read complete
[13:04:23.169][W][esp-idf:000][md_reader]: D (169152318) micro_decoder.decoder_source: Reader finished
[13:04:24.803][W][esp-idf:000][md_decoder]: D (169153953) micro_decoder.decoder_source: Decode finished
[13:04:24.916][S][media_player]: 'Media Player' >> IDLE
[13:04:24.916][S][media_player]: Volume: 100%
[13:04:25.942][S][sensor]: 'Heap Frei' >> 74092 B
[13:04:25.943][S][sensor]: 'Loop-Zeit' >> 60 ms
[13:04:25.943][S][sensor]: 'CPU-Frequenz' >> 160000000 Hz
[13:04:25.944][S][sensor]: 'Heap Max Block' >> 61440 B
[13:04:25.944][S][sensor]: 'Freier PSRAM' >> 4045424 B
[13:04:30.940][S][sensor]: 'Heap Frei' >> 74092 B
[13:04:30.941][S][sensor]: 'Loop-Zeit' >> 17 ms
[13:04:30.944][S][sensor]: 'CPU-Frequenz' >> 160000000 Hz
[13:04:30.944][S][sensor]: 'Heap Max Block' >> 61440 B
[13:04:30.945][S][sensor]: 'Freier PSRAM' >> 4045424 B
[13:04:35.930][S][sensor]: 'Heap Frei' >> 74092 B
[13:04:35.931][S][sensor]: 'Loop-Zeit' >> 17 ms
[13:04:35.931][S][sensor]: 'CPU-Frequenz' >> 160000000 Hz
[13:04:35.932][S][sensor]: 'Heap Max Block' >> 61440 B
[13:04:35.932][S][sensor]: 'Freier PSRAM' >> 4045424 B
[13:04:40.942][S][sensor]: 'Heap Frei' >> 74092 B
[13:04:40.943][S][sensor]: 'Loop-Zeit' >> 17 ms
[13:04:40.943][S][sensor]: 'CPU-Frequenz' >> 160000000 Hz
[13:04:40.944][S][sensor]: 'Heap Max Block' >> 61440 B
[13:04:40.944][S][sensor]: 'Freier PSRAM' >> 4045424 B
[13:04:42.993][W][esp-idf:000][md_reader]: D (169172142) micro_decoder.http_client: Connected: status=200 content-type='application/octet-stream'
[13:04:42.995][W][esp-idf:000][md_reader]: I (169172143) micro_decoder.audio_reader: Streaming http://192.168.181.42:8123/api/esphome/ffmpeg_proxy/31c284bcc7c26e51c99a35e901436b36/UahKB867F-5H8r2CIv2lGQ.flac (FLAC)
[13:04:43.123][S][media_player]: 'Media Player' >> PLAYING
[13:04:43.123][S][media_player]: Volume: 100%
[13:04:43.214][W][esp-idf:000][md_reader]: D (169172326) micro_decoder.audio_reader: HTTP read complete
[13:04:43.216][W][esp-idf:000][md_reader]: D (169172328) micro_decoder.decoder_source: Reader finished
[13:04:45.693][W][esp-idf:000][md_decoder]: D (169174843) micro_decoder.decoder_source: Decode finished
[13:04:45.824][S][media_player]: 'Media Player' >> IDLE
[13:04:45.824][S][media_player]: Volume: 100%
[13:04:45.991][S][sensor]: 'Heap Frei' >> 73776 B
[13:04:45.991][S][sensor]: 'Loop-Zeit' >> 17 ms
[13:04:45.992][S][sensor]: 'CPU-Frequenz' >> 160000000 Hz
[13:04:45.992][S][sensor]: 'Heap Max Block' >> 61440 B
[13:04:45.992][S][sensor]: 'Freier PSRAM' >> 4011900 B

Looks like it receives something and does not know what to do with it? The question now is… What am I missing when my base config of the Assistant ist this one: github://esphome/home-assistant-voice-pe/home-assistant-voice.yaml@dev

Anyways… First I have to upgrade all the devices as the newest ESPHome seems to have upgraded the botloader and now I am stuck regarding updates. Can you show your ESPHome config maybe?