Announcement

Collapse
No announcement yet.

SMS alarm conditions

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    SMS alarm conditions

    Use VoipBuster to send an (free) SMS if an alarm condition occurs in the RFXCOM plug-in.

    You need to have an account at www.voipbuster.com
    Edit the script below with your parameters,
    Remove the spaces from this string "< / B R >".
    Create an Event that triggers on an alarm condition and execute this script.


    Code:
    Sub Main(Optional ByVal pParms As String = "")
        Dim strUserName As String = "enter between these quotes your VoipBuster user name"
        Dim strPassword As String = "enter between these quotes your VoipBuster password"
        Dim strPhoneNumber As String = "enter between these quotes the phone number that should receive the SMS"
        'the phonenumber should be in international format for example "+31653123456"
    
        Dim strMessage As String
        Dim chrSecCode As Char
        Dim intCharPos As Integer
    
        chrSecCode = hs.GetINISetting("Startup", "SecDevHC", "", "hspi_RFXCOM.ini")
        If chrSecCode <> "" Then
            strMessage = hs.DeviceString(chrSecCode & "3")
            intCharPos = Instr(strMessage, "border=0>")
            If intCharPos <> 0 Then
                strMessage = Mid(strMessage, intCharPos + 9, Len(strMessage) - intCharPos - 15)
                strMessage = Left(Replace(strMessage, "< / B R >", " / "), 160)
            Else
                strMessage = Left(strMessage, 160)
            End If
            hs.launch("iexplore.exe", "https://myaccount.voipbuster.com/clx/sendsms.php?username=" & strUserName _
            & "&password=" & strPassword & "&from=" & strUserName & "&to=" & strPhoneNumber & "&text=" & strMessage)
        Else
            hs.WriteLog("RFXCOM", "RFXCOM_alarm_sms.vb  ERROR: No house code found for security devices")
        End If
    End Sub

    #2
    Very nice indeed! I don't have an internet connection where my HS lives yet, but I will keep this tip in mind to use as soon as I do!

    Thanks Bert
    HS3 Pro Edition 3.0.0.548| Plug-Ins Enabled: Sonos 3.1.0.57, RFXCOM 30.0.0.45, X10 3.0.0.62, IPThermostat 3.4.5.0, Pushover 3P 0.0.0.54, Blue-Iris 3.1.3.33206, Z-Wave 3.0.10.0, BLML2HS 2.0.28.0, mcsMQTT 6.12.4.0, Insteon 3.0.7.19​​ | Win 7 32-bit | Intel Atom D2550 @ 1.86GHz 4GB RAM

    Comment


      #3
      Bert this works great!
      Thanks,

      Comment


        #4
        Had a play with this sms script and it works fine.

        I notice that a new IE window is opened each time the script is run. What's the best method of closing these windows automatically?

        Am I right in thinking that Homeseer does not have an inbuilt function for terminating other applications? I have seen on the forums here a couple of utilities for terminating running processes / application and I just wondered what others are using.

        Thanks

        Paul..

        Comment


          #5
          Update

          It may not be the most elegant way but this small vb script terminates any IE processes that are running on the HS machine.

          I have it set to run 45 seconds after the sms script and it seems to work fine.

          Paul..

          Code:
           
          Sub Main(Optional ByVal Parms As String = "")
              Dim oProcess
              Dim strProcessname = "'iexplore.exe'"
           
              For Each oProcess In GetObject("winmgmts:").InstancesOf("Win32_Process")
                  If InStr(UCase(strProcessName), UCase(oProcess.Name)) <> 0 Then
                      oProcess.Terminate()
                  End If
              Next
          End Sub

          Comment


            #6
            Preventing IE windows tot pop while sending SMS

            Hi,

            I am new to RFXcom and am playing with all new stuff. So I found the SMS script and played with it. I did not like the IE window popping up. After sending my solution to Bert, he asked me to post the answer to prevent IE starting here too.

            I am using voipcheap myself (because SMS is then free) so you might want to correct the https link. The line replaces the line from Bert's script that starts with "hs.Launch"

            Code:
            [FONT=Courier New]result = hs.urlaction([COLOR=#a31515]"[URL="https://myaccount.voipcheap.com/clx/sendsms.php?username="][COLOR=#0000ff]https://myaccount.voipcheap.com/clx/sendsms.php?username=[/COLOR][/URL]"[/COLOR] _[/FONT]
            [FONT=Courier New]      & strUserName [/FONT][FONT=Courier New]& [COLOR=#a31515]"&password="[/COLOR] & strPassword & [COLOR=#a31515]"&from=" _[/COLOR][/FONT]
            [FONT=Courier New]      & strUserName & [COLOR=#a31515]"&to="[/COLOR] & strPhoneNumber _[/FONT]
            [FONT=Courier New]      & [COLOR=#a31515]"&text="[/COLOR] & strMessage, [COLOR=#a31515]"GET"[/COLOR], [COLOR=#a31515]""[/COLOR], [COLOR=#a31515]""[/COLOR])[/FONT]
            The contents in result wil be the contents that is displayed on the IE window, stripped from XML.

            Greetings,

            Wim
            -- Wim

            Plugins: JowiHue, RFXCOM, Sonos4, Jon00's Perfmon and Network monitor, EasyTrigger, Pushover 3P, rnbWeather, BLBackup, AK SmartDevice, Pushover, PHLocation, Zwave, GCalseer, SDJ-Health, Device History, BLGData

            1210 devices/features ---- 392 events ----- 40 scripts

            Comment


              #7
              Wim,

              that's a very interesting alternative. I have modified my notifications script to use urlaction as you indicate. I had a problem some time ago, where I got locked out of my router and could not connect to HS to kill any open IE instances (Unfortunately I don't have mine automated as Sooty suggests) for about 5 days... when I finally got access, I had 67 IE instances running on the server!!!!

              Cheers
              HS3 Pro Edition 3.0.0.548| Plug-Ins Enabled: Sonos 3.1.0.57, RFXCOM 30.0.0.45, X10 3.0.0.62, IPThermostat 3.4.5.0, Pushover 3P 0.0.0.54, Blue-Iris 3.1.3.33206, Z-Wave 3.0.10.0, BLML2HS 2.0.28.0, mcsMQTT 6.12.4.0, Insteon 3.0.7.19​​ | Win 7 32-bit | Intel Atom D2550 @ 1.86GHz 4GB RAM

              Comment


                #8
                Voipbuster has changed the URL for the SMS function.
                It has been changed from:
                https://myaccount.voipbuster.com/clx/sendsms.php?
                To:
                https://www.voipbuster.com/myaccount/sendsms.php?

                The certificate of the 1st URL is expired so you have to change your scripts.

                Comment


                  #9
                  Strange, just used they updated URL, does not work, reverted back to the original one and its texting again.

                  Looks like they have hit the undo button

                  Francois

                  Comment


                    #10
                    Mine is working with the new url

                    Comment


                      #11
                      Just set up and tried this routine with VOIPBUSTER.

                      It seems great with one exception. If I allow the alarm panel devicestring as in Bert's example, VOIPBUSTER reject my message on the "</BR>" string whereas if I remove that substring from the strMessage variable they send my SMS fine.

                      Anyone else seen this or am I missing something?

                      Comment


                        #12
                        Did you check the RFXCOM_alarm_sms.vb in the script directory and in the programmers guide? http://www.rfxcom.com/documents/RFXC...rs%20Guide.pdf

                        Comment


                          #13
                          I didn't realise that this was covered in the guide - thank you for telling me, it's neat! - I took the script from the top of this thread.

                          Checking the guide now, the VOIPBUSTER url needs to be changed to:

                          https://www.voipbuster.com/myaccount/sendsms.php?.....

                          It is interesting to me that I had to eliminate the HTML in the device string before voipbuster would send an sms
                          Last edited by simonog; March 5, 2010, 11:32 AM.

                          Comment


                            #14
                            I am using the "Alarm SMS script using VoipBuster" from the RFXCOM user manual (6.3.3.2), and having some troubles.

                            My first Oregon Scientific temp. sensor now reports battery low. It does so every 2-3min. causing the script to send me e-mail constantly every 2-3mins. reporting the sensors low battery.

                            Has anyone a remedy for this? I thought the sensor only transmitted the battery status when there is a change, but apparently not when low...

                            Comment


                              #15
                              The battery low should only be transmitted if the battery status is changed. Is the battery empty state of the sensor changing (or another value in the sensor)?
                              Please send me by email the HS log with debug level 2 enabled for the receiver.

                              Comment

                              Working...
                              X