Announcement

Collapse
No announcement yet.

CallerID Script

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

    CallerID Script

    I have a script named PhonCall.vbs with a property of CIDreceived that is populated with the actual Caller ID from my Stargate.
    So how would I code this so that on a specific string match HomeSeer would speak a specific string?
    Can I just do this:

    Sub Main()

    If CIDreceived = '555-123-4567 Mom' then
    hs.speak "Mother is calling", TRUE

    End Sub

    (I know, I know! I am new to this HS scripting. I just need a little syntax shove to get me started. Be gentle with me....)

    #2
    Jeese! 20 views and NOBODY knows how to do this
    Come on folks...I'm dying here....

    Comment


      #3
      Kevin,
      As long as you instantiate the HS object in the vbs script the above example should work perfectly.
      -Rupp
      sigpic

      Comment


        #4
        Kevin,

        You'll need to double quote your string though.

        CIDreceived = '555-123-4567 Mom' will have to be changed to: CIDreceived = "555-123-4567 Mom"

        Comment


          #5
          <BLOCKQUOTE class="ip-ubbcode-quote"><font size="-1">quote:</font><HR>Originally posted by Rupp:
          Kevin,
          As long as you instantiate the HS object in the vbs script the above example should work perfectly. <HR></BLOCKQUOTE>

          Ok, the double quotes is one thing I wondered about. Thank you Joe AND Rupp for the help!

          Comment


            #6
            Yea, The problem with programming in javascript and vbscript is it's a daily battle to get the quotes correct.
            -Rupp
            sigpic

            Comment


              #7
              <BLOCKQUOTE class="ip-ubbcode-quote"><font size="-1">quote:</font><HR>Originally posted by Rupp:
              Yea, The problem with programming in javascript and vbscript is it's a daily battle to get the quotes correct. <HR></BLOCKQUOTE>

              I understand.

              Quick question though, you stated "As long as you instantiate the HS object in the vbs script". My VBS skills are fairly new. I understand about instantiation, when a new object is created from say a template, the new object is instantiated and obtains a unique GUID and properties and methods among other things. Well, here is what I did: From my Stargate I send this string to HomeSeer and the Stargate Plugin:
              $$PhoneCall.vbs:CIDreceived(CID)

              The Stargate/HomeSeer plugin will recognize the $$ to mean that PhoneCall.vbs is a script that will need to be run, and the CIDreceived is an object that will contain the Caller ID information that Stargate writes to it via a built-in Stargate function of (CID).

              Therefore, the question is, if indeed the CID info (CID) from Stargate is written into the vb object of ‘CIDreceived’ and this is passed through the plugin to the PhoneCall.vbs script, how do I get this information into HomeSeer?
              I looked at my devices and don't see any device I could create to handle the CallerID string. Or do I really need a device? While looking at the device types, I don't see where/how I would trigger an event from 'any change' of the CIDreceived's value which I could then compare to a "string" value then do stuff.

              AM I rambling?

              Thanks Rupp for helping me BTW!

              Kevin

              Comment


                #8
                Kevin,
                Did the code you posted not work? I would think you could simply add the code you posted above without the sub man() and end sub into the vbs file and it should work.
                -Rupp
                sigpic

                Comment


                  #9
                  <BLOCKQUOTE class="ip-ubbcode-quote"><font size="-1">quote:</font><HR>Originally posted by Rupp:
                  Kevin,
                  Did the code you posted not work? I would think you could simply add the code you posted above without the sub man() and end sub into the vbs file and it should work. <HR></BLOCKQUOTE>

                  Well not yet Rupp and I aploigize for jumping the gun on this. BTW, how exactly do I instantiate an object within a vb script?

                  Thank you!

                  Comment


                    #10
                    Kevin,
                    Try this:

                    Set hs = CreateObject("HomeSeer.Application")
                    msgbox(hs.sunset)
                    -Rupp
                    sigpic

                    Comment

                    Working...
                    X