Jump to content

Welcome to Smart Home Forum by FIBARO

Dear Guest,

 

as you can notice parts of Smart Home Forum by FIBARO is not available for you. You have to register in order to view all content and post in our community. Don't worry! Registration is a simple free process that requires minimal information for you to sign up. Become a part of of Smart Home Forum by FIBARO by creating an account.

 

As a member you can:

  •     Start new topics and reply to others
  •     Follow topics and users to get email updates
  •     Get your own profile page and make new friends
  •     Send personal messages
  •     ... and learn a lot about our system!

 

Regards,

Smart Home Forum by FIBARO Team


Voip call on Alarm


Jacques
 Share

Recommended Posts

Dear Fibaro,

 

Because of urgently of an alarm/co2/smoke trigger it is important to get direct notification.

Is it possible to use the HC2 voip capabilities to call an phone number?

Or is their a phone dialer planned?

 

Best Regards

 

Jacques 

Link to comment
Share on other sites

Hello Jacques.

 

See.

Please login or register to see this link.

 

HC2 can manage user rights and supports VoIP functionality and video intercoms.

 

In the maual they also talk about a Voip panel

Link to comment
Share on other sites

Hello Jacques,

 

I managed to have my HC2 system calling my iphone in case of alarm/fire/flooding for already a few years, working well, however not using the voip system of the HC2 (was not aware of this possibility until recently).

In my situation, the HC2 triggers a script (different for the various types of alarms) on a raspberry pi computer, which in turn is setup as a voip phone, calling my iphone.

if you are interested, I can post a setup instruction (need to dig through some old files though, has been a few years since I have setup this system).

 

Cheers, 

Wim

 

 

 

Link to comment
Share on other sites

Hello @Sjakie and @Jacques

 

Herewith the description on how to setup a SIP/VOIP dialer HC2/Raspberry combination. I hope this is complete, it has been a while since I put this in place on my HC2, but working fine already for a few years now.

Let me know if there are any questions on this.

 

Rgrds,

Wim

 

Setup HC2 with Raspberry Pi to call phone in case of alarm

 

Setup on HC2:

 

-        Create a virtual device with one button per alarm type (alarm, fire, flooding, etc.)  with the following LUA code per button (of course, php filename differs per button. The IP address is the address of the Raspberry on which the php code will be run (default port 80):

 

PI1=Net.FHttp("192.168.178.62");

r1, s1, e1 = PI1:GET("/fibaro-inbraak.php");

 

-        Triger the appropriate button of this virtual device in the various alarm scenes

 

Setup on RasPi:

 

-        Install apache2 (webserver for RasPi), PHP (required to run shell script 

-        Install (and configure) sip-phone dialer pjsip/pjsua, details on how to install can be found at the following link)  

Please login or register to see this link.

-        Note that the dialer uses espeak, so that a text from a text file can be spoken and used for the message text of the phone call. 

With the old Raspberry I was using at the time, the process of text-to-speak conversion, speaking the resulting wav file and dialing was a bit too much for the Raspberry. I modified the code slightly, not using text-to-speak conversion anymore, but playing a pre-recorded wav-file for the phone-call instead. The modified c-code is given in the appendix.

-        Put all PHP scripts that you have defined in the Virtual Device in the Raspberry directory /var/www/html

-        The PHP scripts are as follows:

 

<?php

       $command=system("/home/pi/alarm/sip-alarm.sh >/home/pi/alarm/alarm.log 2>&1");

       $filename = "/home/pi/alarm/fibaro-alarm.txt";

       $fhandle  = fopen($filename,"r");

       $jsonspul = fread($fhandle,filesize($filename));

       fclose($fhandle);

 

       echo($jsonspul)

?>

 

-        Each PHP script calls a bash-shell script, which is as follows:

 

#!/bin/bash

 

# define sip-settings

sip_domain="NAME OF SIP SERVER";

sip_user="USERNAME FOR SIP SERVER";

sip_password="PASSWORD FOR SIP SERVER";

play_file="/home/pi/alarm/fibaro-alarm.wav";  #pre-recorded message

 

# define number to call

phone_number="06xxxxxxxx";

 

# make call with sip-alarm

/home/pi/alarm/sip-alarm -sd $sip_domain -su $sip_user -sp $sip_password -pn $phone_number -s 1 -mr 2 -ttsf $play_file

 

-        For info: SIP server can be an external service, but some routers can be configured as a SIP server. I’m using an AVM-FritzBox, which I’ve configured as a SIP server

 

Please login or register to see this attachment.

Link to comment
Share on other sites

  • Topic Author
  • Many thanks Wim,

     

    I shall try your solution because it looks stable and you can generate a message.

     

    What I do now is depending on 2 other services.

     

    e.g. 

    1. Fibaro detects movement.
    2. Swith on a light.
    3. Arlo camera detects light.
    4. Use IFTTT ARLO app let the Iphone ringing.

     

    BR

     

    Jacques

    Link to comment
    Share on other sites

    • 9 months later...

    wow this topic is best 
    i read like this topic in

    Please login or register to see this link.


    i have offer for my friend that read this caption .

    Link to comment
    Share on other sites

    Join the conversation

    You can post now and register later. If you have an account, sign in now to post with your account.

    Guest
    Reply to this topic...

    ×   Pasted as rich text.   Paste as plain text instead

      Only 75 emoji are allowed.

    ×   Your link has been automatically embedded.   Display as a link instead

    ×   Your previous content has been restored.   Clear editor

    ×   You cannot paste images directly. Upload or insert images from URL.

     Share

    ×
    ×
    • Create New...